├── .github
└── workflows
│ └── multi-platform.yml
├── .gitignore
├── CMakeLists.txt
├── LICENSE
├── README.md
├── README.ru.md
├── about.md
├── changelog.md
├── libs
├── ffmpeg
│ ├── libavcodec
│ │ ├── ac3_parser.h
│ │ ├── adts_parser.h
│ │ ├── avcodec.h
│ │ ├── avdct.h
│ │ ├── avfft.h
│ │ ├── bsf.h
│ │ ├── codec.h
│ │ ├── codec_desc.h
│ │ ├── codec_id.h
│ │ ├── codec_par.h
│ │ ├── d3d11va.h
│ │ ├── defs.h
│ │ ├── dirac.h
│ │ ├── dv_profile.h
│ │ ├── dxva2.h
│ │ ├── jni.h
│ │ ├── mediacodec.h
│ │ ├── packet.h
│ │ ├── qsv.h
│ │ ├── vdpau.h
│ │ ├── version.h
│ │ ├── version_major.h
│ │ ├── videotoolbox.h
│ │ └── vorbis_parser.h
│ ├── libavdevice
│ │ ├── avdevice.h
│ │ ├── version.h
│ │ └── version_major.h
│ ├── libavfilter
│ │ ├── avfilter.h
│ │ ├── buffersink.h
│ │ ├── buffersrc.h
│ │ ├── version.h
│ │ └── version_major.h
│ ├── libavformat
│ │ ├── avformat.h
│ │ ├── avio.h
│ │ ├── version.h
│ │ └── version_major.h
│ ├── libavutil
│ │ ├── adler32.h
│ │ ├── aes.h
│ │ ├── aes_ctr.h
│ │ ├── ambient_viewing_environment.h
│ │ ├── attributes.h
│ │ ├── audio_fifo.h
│ │ ├── avassert.h
│ │ ├── avconfig.h
│ │ ├── avstring.h
│ │ ├── avutil.h
│ │ ├── base64.h
│ │ ├── blowfish.h
│ │ ├── bprint.h
│ │ ├── bswap.h
│ │ ├── buffer.h
│ │ ├── camellia.h
│ │ ├── cast5.h
│ │ ├── channel_layout.h
│ │ ├── common.h
│ │ ├── cpu.h
│ │ ├── crc.h
│ │ ├── csp.h
│ │ ├── des.h
│ │ ├── detection_bbox.h
│ │ ├── dict.h
│ │ ├── display.h
│ │ ├── dovi_meta.h
│ │ ├── downmix_info.h
│ │ ├── encryption_info.h
│ │ ├── error.h
│ │ ├── eval.h
│ │ ├── executor.h
│ │ ├── ffversion.h
│ │ ├── fifo.h
│ │ ├── file.h
│ │ ├── film_grain_params.h
│ │ ├── frame.h
│ │ ├── hash.h
│ │ ├── hdr_dynamic_metadata.h
│ │ ├── hdr_dynamic_vivid_metadata.h
│ │ ├── hmac.h
│ │ ├── hwcontext.h
│ │ ├── hwcontext_cuda.h
│ │ ├── hwcontext_d3d11va.h
│ │ ├── hwcontext_d3d12va.h
│ │ ├── hwcontext_drm.h
│ │ ├── hwcontext_dxva2.h
│ │ ├── hwcontext_mediacodec.h
│ │ ├── hwcontext_opencl.h
│ │ ├── hwcontext_qsv.h
│ │ ├── hwcontext_vaapi.h
│ │ ├── hwcontext_vdpau.h
│ │ ├── hwcontext_videotoolbox.h
│ │ ├── hwcontext_vulkan.h
│ │ ├── iamf.h
│ │ ├── imgutils.h
│ │ ├── intfloat.h
│ │ ├── intreadwrite.h
│ │ ├── lfg.h
│ │ ├── log.h
│ │ ├── lzo.h
│ │ ├── macros.h
│ │ ├── mastering_display_metadata.h
│ │ ├── mathematics.h
│ │ ├── md5.h
│ │ ├── mem.h
│ │ ├── motion_vector.h
│ │ ├── murmur3.h
│ │ ├── opt.h
│ │ ├── parseutils.h
│ │ ├── pixdesc.h
│ │ ├── pixelutils.h
│ │ ├── pixfmt.h
│ │ ├── random_seed.h
│ │ ├── rational.h
│ │ ├── rc4.h
│ │ ├── replaygain.h
│ │ ├── ripemd.h
│ │ ├── samplefmt.h
│ │ ├── sha.h
│ │ ├── sha512.h
│ │ ├── spherical.h
│ │ ├── stereo3d.h
│ │ ├── tea.h
│ │ ├── threadmessage.h
│ │ ├── time.h
│ │ ├── timecode.h
│ │ ├── timestamp.h
│ │ ├── tree.h
│ │ ├── twofish.h
│ │ ├── tx.h
│ │ ├── uuid.h
│ │ ├── version.h
│ │ ├── video_enc_params.h
│ │ ├── video_hint.h
│ │ └── xtea.h
│ ├── libpostproc
│ │ ├── postprocess.h
│ │ ├── version.h
│ │ └── version_major.h
│ ├── libswresample
│ │ ├── swresample.h
│ │ ├── version.h
│ │ └── version_major.h
│ ├── libswscale
│ │ ├── swscale.h
│ │ ├── version.h
│ │ └── version_major.h
│ └── x264
│ │ ├── x264.h
│ │ └── x264_config.h
├── imgui
│ ├── CMakeLists.txt
│ ├── LICENSE.txt
│ ├── font.hpp
│ ├── imconfig.h
│ ├── imgui-theme.hpp
│ ├── imgui.cpp
│ ├── imgui.h
│ ├── imgui_demo.cpp
│ ├── imgui_draw.cpp
│ ├── imgui_impl_win32.cpp
│ ├── imgui_impl_win32.h
│ ├── imgui_internal.h
│ ├── imgui_stdlib.cpp
│ ├── imgui_stdlib.h
│ ├── imgui_tables.cpp
│ ├── imgui_widgets.cpp
│ ├── imstb_rectpack.h
│ ├── imstb_textedit.h
│ └── imstb_truetype.h
├── qoi
│ ├── .gitignore
│ ├── LICENSE
│ ├── Makefile
│ ├── README.md
│ ├── qoi.h
│ ├── qoibench.c
│ ├── qoiconv.c
│ └── qoifuzz.c
└── subprocess.hpp
├── logo.png
├── mod.json
├── res
├── GDH_buttonInvisible.png
├── GDH_buttonUI.png
└── github.png
├── src
├── config.hpp
├── flvc.hpp
├── gui.cpp
├── gui.hpp
├── gui_mobile.cpp
├── gui_mobile.hpp
├── h264_encoder.hpp
├── hacks.cpp
├── hacks.hpp
├── hooks.cpp
├── hooks.hpp
├── json.hpp
├── keyMapping.cpp
├── keyMapping.hpp
├── labels.cpp
├── labels.hpp
├── layoutMode.cpp
├── main.cpp
├── memory.cpp
├── memory.hpp
├── popupSystem.cpp
├── popupSystem.hpp
├── recorder.cpp
├── recorder.hpp
├── replayEngine.cpp
├── replayEngine.hpp
├── utils.cpp
└── utils.hpp
└── support.md
/.github/workflows/multi-platform.yml:
--------------------------------------------------------------------------------
1 | name: Build Geode Mod
2 |
3 | on:
4 | workflow_dispatch:
5 | push:
6 | branches:
7 | - "**"
8 |
9 | jobs:
10 | build:
11 | strategy:
12 | fail-fast: false
13 | matrix:
14 | config:
15 | - name: Windows
16 | os: windows-latest
17 |
18 | - name: Android32
19 | os: ubuntu-latest
20 | target: Android32
21 |
22 | - name: Android64
23 | os: ubuntu-latest
24 | target: Android64
25 |
26 |
27 |
28 | name: ${{ matrix.config.name }}
29 | runs-on: ${{ matrix.config.os }}
30 |
31 | steps:
32 | - name: Checkout
33 | uses: actions/checkout@v4
34 |
35 | - name: Get Compiled FFmpeg Libs
36 | uses: actions/checkout@v4
37 | with:
38 | repository: TobyAdd/ffmpeg-libs
39 | token: ${{ secrets.FFMPEG_LIBS_TOKEN }}
40 | path: ffmpeg-libs
41 |
42 | - name: Extracting FFmpeg Builds
43 | run: 7z x ffmpeg-libs/libs.7z -olibs
44 |
45 | - name: Build the mod
46 | uses: geode-sdk/build-geode-mod@main
47 | with:
48 | bindings: geode-sdk/bindings
49 | bindings-ref: main
50 | combine: true
51 | target: ${{ matrix.config.target }}
52 |
53 | package:
54 | name: Package builds
55 | runs-on: ubuntu-latest
56 | needs: ['build']
57 |
58 | steps:
59 | - uses: geode-sdk/build-geode-mod/combine@main
60 | id: build
61 |
62 | - uses: actions/upload-artifact@v4
63 | with:
64 | name: Build Output
65 | path: ${{ steps.build.outputs.build-output }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 |
34 | # Macos be like
35 | **/.DS_Store
36 |
37 | # Cache files for Sublime Text
38 | *.tmlanguage.cache
39 | *.tmPreferences.cache
40 | *.stTheme.cache
41 |
42 | # Ignore build folders
43 | **/build
44 | # Ignore platform specific build folders
45 | build-*/
46 |
47 | # Workspace files are user-specific
48 | *.sublime-workspace
49 |
50 | # ILY vscode
51 | **/.vscode
52 |
53 | # Local History for Visual Studio Code
54 | .history/
55 |
56 | # clangd
57 | .cache/
58 |
59 | # Visual Studio
60 | .vs/
61 |
62 | # CLion
63 | .idea/
64 | /cmake-build-*/
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.21)
2 | set(CMAKE_CXX_STANDARD 20)
3 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
4 | set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
5 | set(CMAKE_CXX_VISIBILITY_PRESET hidden)
6 |
7 | project(GDH VERSION 1.0.0)
8 |
9 | file(GLOB_RECURSE SOURCES src/*.cpp)
10 | add_library(${PROJECT_NAME} SHARED ${SOURCES})
11 |
12 | if (NOT DEFINED ENV{GEODE_SDK})
13 | message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
14 | else()
15 | message(STATUS "Found Geode: $ENV{GEODE_SDK}")
16 | endif()
17 |
18 | add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
19 |
20 | target_include_directories(${PROJECT_NAME} PRIVATE libs libs/ffmpeg)
21 |
22 | set(HAS_IMGUI ON)
23 | add_subdirectory(libs/imgui)
24 | CPMAddPackage("gh:matcool/gd-imgui-cocos#8973953")
25 |
26 | target_link_libraries(${PROJECT_NAME} imgui-cocos imgui)
27 |
28 | if (ANDROID AND ANDROID_ABI STREQUAL "arm64-v8a")
29 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libavcodec/libavcodec.a)
30 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libavdevice/libavdevice.a)
31 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libavfilter/libavfilter.a)
32 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libavformat/libavformat.a)
33 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libavutil/libavutil.a)
34 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libpostproc/libpostproc.a)
35 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libswresample/libswresample.a)
36 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/libswscale/libswscale.a)
37 | target_link_libraries(${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/libs/ffmpeg/x264/libx264.a)
38 | endif()
39 |
40 | setup_geode_mod(${PROJECT_NAME})
41 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 TobyAdd
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # GDH
6 |
7 | GDH is an open-source Geometry Dash mod menu that aims to improve the game's performance and add new features
8 |
9 | Это README также [доступно на русском языке](README.ru.md)
10 |
11 | ## Gallery
12 |
13 |
14 | ## Install GDH directly through the mod catalogue in Geode itself (Recommended)
15 | 1. Make sure [Geode](https://geode-sdk.org/) is installed
16 | 2. In the mod install menu, under the Discover page, find GDH and install it
17 | 3. Restart the game
18 | 4. Press Tab to show the integrated menu
19 |
20 | ## Install GDH using Installer
21 | [Complete Guide](https://github.com/TobyAdd/GDH-Installer/blob/main/README.md#how-to-install)
22 |
23 | ## Install GDH manually
24 | 1. Make sure [Geode](https://geode-sdk.org/) is installed
25 | 2. Download [tobyadd.gdh.geode](https://github.com/TobyAdd/GDH/releases/latest/download/tobyadd.gdh.geode)
26 | 3. Move it to `geode/mods/` folder in Geometry Dash directory (Library → GD → Right click → Browse local files)
27 | 4. Run GD and press Tab to show the integrated menu
28 |
29 | ## Pull requests and Issues
30 | Feel free to submit a pull request.
31 | Also, please, do not create silly issues like "how to install", "there is a virus/cryptominer" or any kind of suggestion.
32 | If you want to propose an idea, you can do so on our [Discord server](https://discord.gg/ahYEz4MAwP).
33 |
34 | ---
35 |
36 | Thanks to the [aciddev_](https://github.com/thisisignitedoreo) for the icon, small README improvements & translating it.
37 | Thanks to all the [contributors](https://github.com/TobyAdd/GDH/graphs/contributors).
38 |
--------------------------------------------------------------------------------
/README.ru.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # GDH
6 |
7 | GDH - мод для Geometry Dash с открытым исходным кодом, и его целью является улучшение производительности и добавление новых фишек
8 |
9 | Note: this readme is [available in English](README.md)
10 |
11 | ## Галерея
12 |
13 |
14 | ## Установка GDH через внутриигровое меню Geode (Рекомендуемо)
15 | 1. Удостоверьтесь что [Geode](https://geode-sdk.org/) установлен
16 | 2. В меню установки модов, во вкладке Discover найдите мод GDH и установите
17 | 3. Перезапустите игру
18 | 4. Нажмите Tab чтобы открыть меню
19 |
20 | ## Установка GDH через установщик
21 | [Гайд на английском](https://github.com/TobyAdd/GDH-Installer/blob/main/README.md#how-to-install)
22 |
23 | ## Установка GDH вручную
24 | 1. Удостоверьтесь что [Geode](https://geode-sdk.org/) установлен
25 | 2. Скачайте файл [tobyadd.gdh.geode](https://github.com/TobyAdd/GDH/releases/latest/download/tobyadd.gdh.geode)
26 | 3. Переместите его в папку `geode/mods/` в директории Geometry Dash (Библиотека Steam → GD → ПКМ → Просмотреть локальные файлы)
27 | 4. Запустите GD и нажмите Tab чтобы открыть меню
28 |
29 | ## Пул Реквесты и Ишью
30 | Не стесняйтесь открывать Пулл Реквесты и создавать Ишью.
31 | Также, пожалуйста, не создавайте глупые Ишью вроде "как установить" и "тут есть вирус/майнер" или Ишью с предложениями новых функций.
32 | Если у вас есть идея то можете рассказать о ней на нашем [Дискорд сервере](https://discord.gg/ahYEz4MAwP).
33 |
34 | ---
35 |
36 | Спасибо [aciddev_](https://github.com/thisisignitedoreo) за создание иконки, небольшие улучшения в README и его перевод.
37 | Спасибо всем [контрибьюторам](https://github.com/TobyAdd/GDH/graphs/contributors).
38 |
--------------------------------------------------------------------------------
/about.md:
--------------------------------------------------------------------------------
1 | ## GDH
2 | GDH is an open-source Geometry Dash mod menu that aims to improve the game's performance and add new features
3 | ## Gallery
4 | 
5 | ## Features
6 | - Basic Hacks
7 | - Bot called ReplayEngine
8 | - TPS Unlocker
9 | - Labels
10 | - Keybinds
11 | - Hitboxes
12 | - And more!
13 | ## Install GDH directly through the mod catalogue in Geode itself (Recommended)
14 | 1. Make sure [Geode](https://geode-sdk.org/) is installed
15 | 2. In the mod install menu, under the Discover page, find GDH and install it
16 | 3. Restart the game
17 | 4. Press **Tab** to show the integrated menu
18 | ## Pull requests and Issues
19 | Feel free to submit a pull request. Also do not create silly issues like "how to install" or any kind of suggestion. If you want to propose an idea, you can do so on our [Discord server](https://discord.gg/ahYEz4MAwP).
20 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/ac3_parser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AC-3 parser prototypes
3 | * Copyright (c) 2003 Fabrice Bellard
4 | * Copyright (c) 2003 Michael Niedermayer
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_AC3_PARSER_H
24 | #define AVCODEC_AC3_PARSER_H
25 |
26 | #include
27 | #include
28 |
29 | /**
30 | * Extract the bitstream ID and the frame size from AC-3 data.
31 | */
32 | int av_ac3_parse_header(const uint8_t *buf, size_t size,
33 | uint8_t *bitstream_id, uint16_t *frame_size);
34 |
35 |
36 | #endif /* AVCODEC_AC3_PARSER_H */
37 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/adts_parser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVCODEC_ADTS_PARSER_H
20 | #define AVCODEC_ADTS_PARSER_H
21 |
22 | #include
23 | #include
24 |
25 | #define AV_AAC_ADTS_HEADER_SIZE 7
26 |
27 | /**
28 | * Extract the number of samples and frames from AAC data.
29 | * @param[in] buf pointer to AAC data buffer
30 | * @param[out] samples Pointer to where number of samples is written
31 | * @param[out] frames Pointer to where number of frames is written
32 | * @return Returns 0 on success, error code on failure.
33 | */
34 | int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
35 | uint8_t *frames);
36 |
37 | #endif /* AVCODEC_ADTS_PARSER_H */
38 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/avdct.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVCODEC_AVDCT_H
20 | #define AVCODEC_AVDCT_H
21 |
22 | #include "libavutil/opt.h"
23 |
24 | /**
25 | * AVDCT context.
26 | * @note function pointers can be NULL if the specific features have been
27 | * disabled at build time.
28 | */
29 | typedef struct AVDCT {
30 | const AVClass *av_class;
31 |
32 | void (*idct)(int16_t *block /* align 16 */);
33 |
34 | /**
35 | * IDCT input permutation.
36 | * Several optimized IDCTs need a permutated input (relative to the
37 | * normal order of the reference IDCT).
38 | * This permutation must be performed before the idct_put/add.
39 | * Note, normally this can be merged with the zigzag/alternate scan
40 | * An example to avoid confusion:
41 | * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
42 | * - (x -> reference DCT -> reference IDCT -> x)
43 | * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
44 | * -> simple_idct_mmx -> x)
45 | * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
46 | * -> simple_idct_mmx -> ...)
47 | */
48 | uint8_t idct_permutation[64];
49 |
50 | void (*fdct)(int16_t *block /* align 16 */);
51 |
52 |
53 | /**
54 | * DCT algorithm.
55 | * must use AVOptions to set this field.
56 | */
57 | int dct_algo;
58 |
59 | /**
60 | * IDCT algorithm.
61 | * must use AVOptions to set this field.
62 | */
63 | int idct_algo;
64 |
65 | void (*get_pixels)(int16_t *block /* align 16 */,
66 | const uint8_t *pixels /* align 8 */,
67 | ptrdiff_t line_size);
68 |
69 | int bits_per_sample;
70 |
71 | void (*get_pixels_unaligned)(int16_t *block /* align 16 */,
72 | const uint8_t *pixels,
73 | ptrdiff_t line_size);
74 | } AVDCT;
75 |
76 | /**
77 | * Allocates a AVDCT context.
78 | * This needs to be initialized with avcodec_dct_init() after optionally
79 | * configuring it with AVOptions.
80 | *
81 | * To free it use av_free()
82 | */
83 | AVDCT *avcodec_dct_alloc(void);
84 | int avcodec_dct_init(AVDCT *);
85 |
86 | const AVClass *avcodec_dct_get_class(void);
87 |
88 | #endif /* AVCODEC_AVDCT_H */
89 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/d3d11va.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Direct3D11 HW acceleration
3 | *
4 | * copyright (c) 2009 Laurent Aimar
5 | * copyright (c) 2015 Steve Lhomme
6 | *
7 | * This file is part of FFmpeg.
8 | *
9 | * FFmpeg is free software; you can redistribute it and/or
10 | * modify it under the terms of the GNU Lesser General Public
11 | * License as published by the Free Software Foundation; either
12 | * version 2.1 of the License, or (at your option) any later version.
13 | *
14 | * FFmpeg is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | * Lesser General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU Lesser General Public
20 | * License along with FFmpeg; if not, write to the Free Software
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 | */
23 |
24 | #ifndef AVCODEC_D3D11VA_H
25 | #define AVCODEC_D3D11VA_H
26 |
27 | /**
28 | * @file
29 | * @ingroup lavc_codec_hwaccel_d3d11va
30 | * Public libavcodec D3D11VA header.
31 | */
32 |
33 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
34 | #undef _WIN32_WINNT
35 | #define _WIN32_WINNT 0x0602
36 | #endif
37 |
38 | #include
39 | #include
40 |
41 | /**
42 | * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11
43 | * @ingroup lavc_codec_hwaccel
44 | *
45 | * @{
46 | */
47 |
48 | /**
49 | * This structure is used to provides the necessary configurations and data
50 | * to the Direct3D11 FFmpeg HWAccel implementation.
51 | *
52 | * The application must make it available as AVCodecContext.hwaccel_context.
53 | *
54 | * Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext.
55 | */
56 | typedef struct AVD3D11VAContext {
57 | /**
58 | * D3D11 decoder object
59 | */
60 | ID3D11VideoDecoder *decoder;
61 |
62 | /**
63 | * D3D11 VideoContext
64 | */
65 | ID3D11VideoContext *video_context;
66 |
67 | /**
68 | * D3D11 configuration used to create the decoder
69 | */
70 | D3D11_VIDEO_DECODER_CONFIG *cfg;
71 |
72 | /**
73 | * The number of surface in the surface array
74 | */
75 | unsigned surface_count;
76 |
77 | /**
78 | * The array of Direct3D surfaces used to create the decoder
79 | */
80 | ID3D11VideoDecoderOutputView **surface;
81 |
82 | /**
83 | * A bit field configuring the workarounds needed for using the decoder
84 | */
85 | uint64_t workaround;
86 |
87 | /**
88 | * Private to the FFmpeg AVHWAccel implementation
89 | */
90 | unsigned report_id;
91 |
92 | /**
93 | * Mutex to access video_context
94 | */
95 | HANDLE context_mutex;
96 | } AVD3D11VAContext;
97 |
98 | /**
99 | * Allocate an AVD3D11VAContext.
100 | *
101 | * @return Newly-allocated AVD3D11VAContext or NULL on failure.
102 | */
103 | AVD3D11VAContext *av_d3d11va_alloc_context(void);
104 |
105 | /**
106 | * @}
107 | */
108 |
109 | #endif /* AVCODEC_D3D11VA_H */
110 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/dv_profile.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVCODEC_DV_PROFILE_H
20 | #define AVCODEC_DV_PROFILE_H
21 |
22 | #include
23 |
24 | #include "libavutil/pixfmt.h"
25 | #include "libavutil/rational.h"
26 |
27 | /* minimum number of bytes to read from a DV stream in order to
28 | * determine the profile */
29 | #define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */
30 |
31 |
32 | /*
33 | * AVDVProfile is used to express the differences between various
34 | * DV flavors. For now it's primarily used for differentiating
35 | * 525/60 and 625/50, but the plans are to use it for various
36 | * DV specs as well (e.g. SMPTE314M vs. IEC 61834).
37 | */
38 | typedef struct AVDVProfile {
39 | int dsf; /* value of the dsf in the DV header */
40 | int video_stype; /* stype for VAUX source pack */
41 | int frame_size; /* total size of one frame in bytes */
42 | int difseg_size; /* number of DIF segments per DIF channel */
43 | int n_difchan; /* number of DIF channels per frame */
44 | AVRational time_base; /* 1/framerate */
45 | int ltc_divisor; /* FPS from the LTS standpoint */
46 | int height; /* picture height in pixels */
47 | int width; /* picture width in pixels */
48 | AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
49 | enum AVPixelFormat pix_fmt; /* picture pixel format */
50 | int bpm; /* blocks per macroblock */
51 | const uint8_t *block_sizes; /* AC block sizes, in bits */
52 | int audio_stride; /* size of audio_shuffle table */
53 | int audio_min_samples[3]; /* min amount of audio samples */
54 | /* for 48kHz, 44.1kHz and 32kHz */
55 | int audio_samples_dist[5]; /* how many samples are supposed to be */
56 | /* in each frame in a 5 frames window */
57 | const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
58 | } AVDVProfile;
59 |
60 | /**
61 | * Get a DV profile for the provided compressed frame.
62 | *
63 | * @param sys the profile used for the previous frame, may be NULL
64 | * @param frame the compressed data buffer
65 | * @param buf_size size of the buffer in bytes
66 | * @return the DV profile for the supplied data or NULL on failure
67 | */
68 | const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
69 | const uint8_t *frame, unsigned buf_size);
70 |
71 | /**
72 | * Get a DV profile for the provided stream parameters.
73 | */
74 | const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt);
75 |
76 | /**
77 | * Get a DV profile for the provided stream parameters.
78 | * The frame rate is used as a best-effort parameter.
79 | */
80 | const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate);
81 |
82 | #endif /* AVCODEC_DV_PROFILE_H */
83 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/dxva2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DXVA2 HW acceleration
3 | *
4 | * copyright (c) 2009 Laurent Aimar
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_DXVA2_H
24 | #define AVCODEC_DXVA2_H
25 |
26 | /**
27 | * @file
28 | * @ingroup lavc_codec_hwaccel_dxva2
29 | * Public libavcodec DXVA2 header.
30 | */
31 |
32 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
33 | #undef _WIN32_WINNT
34 | #define _WIN32_WINNT 0x0602
35 | #endif
36 |
37 | #include
38 | #include
39 | #include
40 |
41 | /**
42 | * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
43 | * @ingroup lavc_codec_hwaccel
44 | *
45 | * @{
46 | */
47 |
48 | /**
49 | * This structure is used to provides the necessary configurations and data
50 | * to the DXVA2 FFmpeg HWAccel implementation.
51 | *
52 | * The application must make it available as AVCodecContext.hwaccel_context.
53 | */
54 | struct dxva_context {
55 | /**
56 | * DXVA2 decoder object
57 | */
58 | IDirectXVideoDecoder *decoder;
59 |
60 | /**
61 | * DXVA2 configuration used to create the decoder
62 | */
63 | const DXVA2_ConfigPictureDecode *cfg;
64 |
65 | /**
66 | * The number of surface in the surface array
67 | */
68 | unsigned surface_count;
69 |
70 | /**
71 | * The array of Direct3D surfaces used to create the decoder
72 | */
73 | LPDIRECT3DSURFACE9 *surface;
74 |
75 | /**
76 | * A bit field configuring the workarounds needed for using the decoder
77 | */
78 | uint64_t workaround;
79 |
80 | /**
81 | * Private to the FFmpeg AVHWAccel implementation
82 | */
83 | unsigned report_id;
84 | };
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | #endif /* AVCODEC_DXVA2_H */
91 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/jni.h:
--------------------------------------------------------------------------------
1 | /*
2 | * JNI public API functions
3 | *
4 | * Copyright (c) 2015-2016 Matthieu Bouron
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_JNI_H
24 | #define AVCODEC_JNI_H
25 |
26 | /*
27 | * Manually set a Java virtual machine which will be used to retrieve the JNI
28 | * environment. Once a Java VM is set it cannot be changed afterwards, meaning
29 | * you can call multiple times av_jni_set_java_vm with the same Java VM pointer
30 | * however it will error out if you try to set a different Java VM.
31 | *
32 | * @param vm Java virtual machine
33 | * @param log_ctx context used for logging, can be NULL
34 | * @return 0 on success, < 0 otherwise
35 | */
36 | int av_jni_set_java_vm(void *vm, void *log_ctx);
37 |
38 | /*
39 | * Get the Java virtual machine which has been set with av_jni_set_java_vm.
40 | *
41 | * @param vm Java virtual machine
42 | * @return a pointer to the Java virtual machine
43 | */
44 | void *av_jni_get_java_vm(void *log_ctx);
45 |
46 | /*
47 | * Set the Android application context which will be used to retrieve the Android
48 | * content resolver to handle content uris.
49 | *
50 | * This function is only available on Android.
51 | *
52 | * @param app_ctx global JNI reference to the Android application context
53 | * @return 0 on success, < 0 otherwise
54 | */
55 | int av_jni_set_android_app_ctx(void *app_ctx, void *log_ctx);
56 |
57 | /*
58 | * Get the Android application context that has been set with
59 | * av_jni_set_android_app_ctx.
60 | *
61 | * This function is only available on Android.
62 | *
63 | * @return a pointer the the Android application context
64 | */
65 | void *av_jni_get_android_app_ctx(void);
66 |
67 | #endif /* AVCODEC_JNI_H */
68 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/mediacodec.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Android MediaCodec public API
3 | *
4 | * Copyright (c) 2016 Matthieu Bouron
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_MEDIACODEC_H
24 | #define AVCODEC_MEDIACODEC_H
25 |
26 | #include "libavcodec/avcodec.h"
27 |
28 | /**
29 | * This structure holds a reference to a android/view/Surface object that will
30 | * be used as output by the decoder.
31 | *
32 | */
33 | typedef struct AVMediaCodecContext {
34 |
35 | /**
36 | * android/view/Surface object reference.
37 | */
38 | void *surface;
39 |
40 | } AVMediaCodecContext;
41 |
42 | /**
43 | * Allocate and initialize a MediaCodec context.
44 | *
45 | * When decoding with MediaCodec is finished, the caller must free the
46 | * MediaCodec context with av_mediacodec_default_free.
47 | *
48 | * @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise
49 | */
50 | AVMediaCodecContext *av_mediacodec_alloc_context(void);
51 |
52 | /**
53 | * Convenience function that sets up the MediaCodec context.
54 | *
55 | * @param avctx codec context
56 | * @param ctx MediaCodec context to initialize
57 | * @param surface reference to an android/view/Surface
58 | * @return 0 on success, < 0 otherwise
59 | */
60 | int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface);
61 |
62 | /**
63 | * This function must be called to free the MediaCodec context initialized with
64 | * av_mediacodec_default_init().
65 | *
66 | * @param avctx codec context
67 | */
68 | void av_mediacodec_default_free(AVCodecContext *avctx);
69 |
70 | /**
71 | * Opaque structure representing a MediaCodec buffer to render.
72 | */
73 | typedef struct MediaCodecBuffer AVMediaCodecBuffer;
74 |
75 | /**
76 | * Release a MediaCodec buffer and render it to the surface that is associated
77 | * with the decoder. This function should only be called once on a given
78 | * buffer, once released the underlying buffer returns to the codec, thus
79 | * subsequent calls to this function will have no effect.
80 | *
81 | * @param buffer the buffer to render
82 | * @param render 1 to release and render the buffer to the surface or 0 to
83 | * discard the buffer
84 | * @return 0 on success, < 0 otherwise
85 | */
86 | int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render);
87 |
88 | /**
89 | * Release a MediaCodec buffer and render it at the given time to the surface
90 | * that is associated with the decoder. The timestamp must be within one second
91 | * of the current `java/lang/System#nanoTime()` (which is implemented using
92 | * `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation
93 | * of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details.
94 | *
95 | * @param buffer the buffer to render
96 | * @param time timestamp in nanoseconds of when to render the buffer
97 | * @return 0 on success, < 0 otherwise
98 | *
99 | * [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long)
100 | */
101 | int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time);
102 |
103 | #endif /* AVCODEC_MEDIACODEC_H */
104 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVCODEC_VERSION_H
20 | #define AVCODEC_VERSION_H
21 |
22 | /**
23 | * @file
24 | * @ingroup libavc
25 | * Libavcodec version macros.
26 | */
27 |
28 | #include "libavutil/version.h"
29 |
30 | #include "version_major.h"
31 |
32 | #define LIBAVCODEC_VERSION_MINOR 19
33 | #define LIBAVCODEC_VERSION_MICRO 100
34 |
35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 | LIBAVCODEC_VERSION_MINOR, \
37 | LIBAVCODEC_VERSION_MICRO)
38 | #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
39 | LIBAVCODEC_VERSION_MINOR, \
40 | LIBAVCODEC_VERSION_MICRO)
41 | #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
42 |
43 | #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
44 |
45 | #endif /* AVCODEC_VERSION_H */
46 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVCODEC_VERSION_MAJOR_H
20 | #define AVCODEC_VERSION_MAJOR_H
21 |
22 | /**
23 | * @file
24 | * @ingroup libavc
25 | * Libavcodec version macros.
26 | */
27 |
28 | #define LIBAVCODEC_VERSION_MAJOR 61
29 |
30 | /**
31 | * FF_API_* defines may be placed below to indicate public API that will be
32 | * dropped at a future version bump. The defines themselves are not part of
33 | * the public API and may change, break or disappear at any time.
34 | *
35 | * @note, when bumping the major version it is recommended to manually
36 | * disable each FF_API_* in its own commit instead of disabling them all
37 | * at once through the bump. This improves the git bisect-ability of the change.
38 | */
39 |
40 | #define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 62)
41 | #define FF_API_SUBFRAMES (LIBAVCODEC_VERSION_MAJOR < 62)
42 | #define FF_API_TICKS_PER_FRAME (LIBAVCODEC_VERSION_MAJOR < 62)
43 | #define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 62)
44 |
45 | #define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62)
46 | #define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62)
47 | #define FF_API_AVCODEC_CLOSE (LIBAVCODEC_VERSION_MAJOR < 62)
48 | #define FF_API_BUFFER_MIN_SIZE (LIBAVCODEC_VERSION_MAJOR < 62)
49 | #define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62)
50 | #define FF_API_QUALITY_FACTOR (LIBAVCODEC_VERSION_MAJOR < 62)
51 |
52 | #endif /* AVCODEC_VERSION_MAJOR_H */
53 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/videotoolbox.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Videotoolbox hardware acceleration
3 | *
4 | * copyright (c) 2012 Sebastien Zwickert
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_VIDEOTOOLBOX_H
24 | #define AVCODEC_VIDEOTOOLBOX_H
25 |
26 | /**
27 | * @file
28 | * @ingroup lavc_codec_hwaccel_videotoolbox
29 | * Public libavcodec Videotoolbox header.
30 | */
31 |
32 | /**
33 | * @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder
34 | * @ingroup lavc_codec_hwaccel
35 | *
36 | * Hardware accelerated decoding using VideoToolbox on Apple Platforms
37 | *
38 | * @{
39 | */
40 |
41 | #include
42 |
43 | #define Picture QuickdrawPicture
44 | #include
45 | #undef Picture
46 |
47 | #include "libavcodec/avcodec.h"
48 |
49 | #include "libavutil/attributes.h"
50 |
51 | /**
52 | * This struct holds all the information that needs to be passed
53 | * between the caller and libavcodec for initializing Videotoolbox decoding.
54 | * Its size is not a part of the public ABI, it must be allocated with
55 | * av_videotoolbox_alloc_context() and freed with av_free().
56 | */
57 | typedef struct AVVideotoolboxContext {
58 | /**
59 | * Videotoolbox decompression session object.
60 | */
61 | VTDecompressionSessionRef session;
62 |
63 | /**
64 | * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
65 | * set by the caller. If this is set to 0, then no specific format is
66 | * requested from the decoder, and its native format is output.
67 | */
68 | OSType cv_pix_fmt_type;
69 |
70 | /**
71 | * CoreMedia Format Description that Videotoolbox will use to create the decompression session.
72 | */
73 | CMVideoFormatDescriptionRef cm_fmt_desc;
74 |
75 | /**
76 | * CoreMedia codec type that Videotoolbox will use to create the decompression session.
77 | */
78 | int cm_codec_type;
79 | } AVVideotoolboxContext;
80 |
81 | /**
82 | * @}
83 | */
84 |
85 | #endif /* AVCODEC_VIDEOTOOLBOX_H */
86 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavcodec/vorbis_parser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * A public API for Vorbis parsing
22 | *
23 | * Determines the duration for each packet.
24 | */
25 |
26 | #ifndef AVCODEC_VORBIS_PARSER_H
27 | #define AVCODEC_VORBIS_PARSER_H
28 |
29 | #include
30 |
31 | typedef struct AVVorbisParseContext AVVorbisParseContext;
32 |
33 | /**
34 | * Allocate and initialize the Vorbis parser using headers in the extradata.
35 | */
36 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
37 | int extradata_size);
38 |
39 | /**
40 | * Free the parser and everything associated with it.
41 | */
42 | void av_vorbis_parse_free(AVVorbisParseContext **s);
43 |
44 | #define VORBIS_FLAG_HEADER 0x00000001
45 | #define VORBIS_FLAG_COMMENT 0x00000002
46 | #define VORBIS_FLAG_SETUP 0x00000004
47 |
48 | /**
49 | * Get the duration for a Vorbis packet.
50 | *
51 | * If @p flags is @c NULL,
52 | * special frames are considered invalid.
53 | *
54 | * @param s Vorbis parser context
55 | * @param buf buffer containing a Vorbis frame
56 | * @param buf_size size of the buffer
57 | * @param flags flags for special frames
58 | */
59 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
60 | int buf_size, int *flags);
61 |
62 | /**
63 | * Get the duration for a Vorbis packet.
64 | *
65 | * @param s Vorbis parser context
66 | * @param buf buffer containing a Vorbis frame
67 | * @param buf_size size of the buffer
68 | */
69 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
70 | int buf_size);
71 |
72 | void av_vorbis_parse_reset(AVVorbisParseContext *s);
73 |
74 | #endif /* AVCODEC_VORBIS_PARSER_H */
75 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavdevice/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVDEVICE_VERSION_H
20 | #define AVDEVICE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * @ingroup lavd
25 | * Libavdevice version macros
26 | */
27 |
28 | #include "libavutil/version.h"
29 |
30 | #include "version_major.h"
31 |
32 | #define LIBAVDEVICE_VERSION_MINOR 3
33 | #define LIBAVDEVICE_VERSION_MICRO 100
34 |
35 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
36 | LIBAVDEVICE_VERSION_MINOR, \
37 | LIBAVDEVICE_VERSION_MICRO)
38 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
39 | LIBAVDEVICE_VERSION_MINOR, \
40 | LIBAVDEVICE_VERSION_MICRO)
41 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
42 |
43 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION)
44 |
45 | #endif /* AVDEVICE_VERSION_H */
46 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavdevice/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVDEVICE_VERSION_MAJOR_H
20 | #define AVDEVICE_VERSION_MAJOR_H
21 |
22 | /**
23 | * @file
24 | * @ingroup lavd
25 | * Libavdevice version macros
26 | */
27 |
28 | #define LIBAVDEVICE_VERSION_MAJOR 61
29 |
30 | /**
31 | * FF_API_* defines may be placed below to indicate public API that will be
32 | * dropped at a future version bump. The defines themselves are not part of
33 | * the public API and may change, break or disappear at any time.
34 | */
35 |
36 | // reminder to remove the bktr device on next major bump
37 | #define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
38 | // reminder to remove the opengl device on next major bump
39 | #define FF_API_OPENGL_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
40 | // reminder to remove the sdl2 device on next major bump
41 | #define FF_API_SDL2_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62)
42 |
43 | #endif /* AVDEVICE_VERSION_MAJOR_H */
44 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavfilter/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFILTER_VERSION_H
22 | #define AVFILTER_VERSION_H
23 |
24 | /**
25 | * @file
26 | * @ingroup lavfi
27 | * Libavfilter version macros
28 | */
29 |
30 | #include "libavutil/version.h"
31 |
32 | #include "version_major.h"
33 |
34 | #define LIBAVFILTER_VERSION_MINOR 4
35 | #define LIBAVFILTER_VERSION_MICRO 100
36 |
37 |
38 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
39 | LIBAVFILTER_VERSION_MINOR, \
40 | LIBAVFILTER_VERSION_MICRO)
41 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \
42 | LIBAVFILTER_VERSION_MINOR, \
43 | LIBAVFILTER_VERSION_MICRO)
44 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT
45 |
46 | #define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION)
47 |
48 | #endif /* AVFILTER_VERSION_H */
49 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavfilter/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFILTER_VERSION_MAJOR_H
22 | #define AVFILTER_VERSION_MAJOR_H
23 |
24 | /**
25 | * @file
26 | * @ingroup lavfi
27 | * Libavfilter version macros
28 | */
29 |
30 | #define LIBAVFILTER_VERSION_MAJOR 10
31 |
32 | /**
33 | * FF_API_* defines may be placed below to indicate public API that will be
34 | * dropped at a future version bump. The defines themselves are not part of
35 | * the public API and may change, break or disappear at any time.
36 | */
37 |
38 | #define FF_API_LINK_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 11)
39 |
40 | #endif /* AVFILTER_VERSION_MAJOR_H */
41 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavformat/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFORMAT_VERSION_H
22 | #define AVFORMAT_VERSION_H
23 |
24 | /**
25 | * @file
26 | * @ingroup libavf
27 | * Libavformat version macros
28 | */
29 |
30 | #include "libavutil/version.h"
31 |
32 | #include "version_major.h"
33 |
34 | #define LIBAVFORMAT_VERSION_MINOR 7
35 | #define LIBAVFORMAT_VERSION_MICRO 100
36 |
37 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
38 | LIBAVFORMAT_VERSION_MINOR, \
39 | LIBAVFORMAT_VERSION_MICRO)
40 | #define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \
41 | LIBAVFORMAT_VERSION_MINOR, \
42 | LIBAVFORMAT_VERSION_MICRO)
43 | #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
44 |
45 | #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
46 |
47 | #endif /* AVFORMAT_VERSION_H */
48 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavformat/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFORMAT_VERSION_MAJOR_H
22 | #define AVFORMAT_VERSION_MAJOR_H
23 |
24 | /**
25 | * @file
26 | * @ingroup libavf
27 | * Libavformat version macros
28 | */
29 |
30 | // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
31 | // Also please add any ticket numbers that you believe might be affected here
32 | #define LIBAVFORMAT_VERSION_MAJOR 61
33 |
34 | /**
35 | * FF_API_* defines may be placed below to indicate public API that will be
36 | * dropped at a future version bump. The defines themselves are not part of
37 | * the public API and may change, break or disappear at any time.
38 | *
39 | * @note, when bumping the major version it is recommended to manually
40 | * disable each FF_API_* in its own commit instead of disabling them all
41 | * at once through the bump. This improves the git bisect-ability of the change.
42 | *
43 | */
44 | #define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 62)
45 | #define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 62)
46 | #define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 62)
47 | #define FF_API_AVSTREAM_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 62)
48 |
49 | #define FF_API_GET_DUR_ESTIMATE_METHOD (LIBAVFORMAT_VERSION_MAJOR < 62)
50 | #define FF_API_INTERNAL_TIMING (LIBAVFORMAT_VERSION_MAJOR < 62)
51 |
52 | #define FF_API_R_FRAME_RATE 1
53 |
54 | #endif /* AVFORMAT_VERSION_MAJOR_H */
55 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/adler32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_adler32
24 | * Public header for Adler-32 hash function implementation.
25 | */
26 |
27 | #ifndef AVUTIL_ADLER32_H
28 | #define AVUTIL_ADLER32_H
29 |
30 | #include
31 | #include
32 | #include "attributes.h"
33 |
34 | /**
35 | * @defgroup lavu_adler32 Adler-32
36 | * @ingroup lavu_hash
37 | * Adler-32 hash function implementation.
38 | *
39 | * @{
40 | */
41 |
42 | typedef uint32_t AVAdler;
43 |
44 | /**
45 | * Calculate the Adler32 checksum of a buffer.
46 | *
47 | * Passing the return value to a subsequent av_adler32_update() call
48 | * allows the checksum of multiple buffers to be calculated as though
49 | * they were concatenated.
50 | *
51 | * @param adler initial checksum value
52 | * @param buf pointer to input buffer
53 | * @param len size of input buffer
54 | * @return updated checksum
55 | */
56 | AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
57 | size_t len) av_pure;
58 |
59 | /**
60 | * @}
61 | */
62 |
63 | #endif /* AVUTIL_ADLER32_H */
64 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/aes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_AES_H
22 | #define AVUTIL_AES_H
23 |
24 | #include
25 |
26 | #include "attributes.h"
27 |
28 | /**
29 | * @defgroup lavu_aes AES
30 | * @ingroup lavu_crypto
31 | * @{
32 | */
33 |
34 | extern const int av_aes_size;
35 |
36 | struct AVAES;
37 |
38 | /**
39 | * Allocate an AVAES context.
40 | */
41 | struct AVAES *av_aes_alloc(void);
42 |
43 | /**
44 | * Initialize an AVAES context.
45 | *
46 | * @param a The AVAES context
47 | * @param key Pointer to the key
48 | * @param key_bits 128, 192 or 256
49 | * @param decrypt 0 for encryption, 1 for decryption
50 | */
51 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
52 |
53 | /**
54 | * Encrypt or decrypt a buffer using a previously initialized context.
55 | *
56 | * @param a The AVAES context
57 | * @param dst destination array, can be equal to src
58 | * @param src source array, can be equal to dst
59 | * @param count number of 16 byte blocks
60 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
61 | * @param decrypt 0 for encryption, 1 for decryption
62 | */
63 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | #endif /* AVUTIL_AES_H */
70 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/aes_ctr.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AES-CTR cipher
3 | * Copyright (c) 2015 Eran Kornblau
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_AES_CTR_H
23 | #define AVUTIL_AES_CTR_H
24 |
25 | /**
26 | * @defgroup lavu_aes_ctr AES-CTR
27 | * @ingroup lavu_crypto
28 | * @{
29 | */
30 |
31 | #include
32 |
33 | #include "attributes.h"
34 |
35 | #define AES_CTR_KEY_SIZE (16)
36 | #define AES_CTR_IV_SIZE (8)
37 |
38 | struct AVAESCTR;
39 |
40 | /**
41 | * Allocate an AVAESCTR context.
42 | */
43 | struct AVAESCTR *av_aes_ctr_alloc(void);
44 |
45 | /**
46 | * Initialize an AVAESCTR context.
47 | *
48 | * @param a The AVAESCTR context to initialize
49 | * @param key encryption key, must have a length of AES_CTR_KEY_SIZE
50 | */
51 | int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
52 |
53 | /**
54 | * Release an AVAESCTR context.
55 | *
56 | * @param a The AVAESCTR context
57 | */
58 | void av_aes_ctr_free(struct AVAESCTR *a);
59 |
60 | /**
61 | * Process a buffer using a previously initialized context.
62 | *
63 | * @param a The AVAESCTR context
64 | * @param dst destination array, can be equal to src
65 | * @param src source array, can be equal to dst
66 | * @param size the size of src and dst
67 | */
68 | void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size);
69 |
70 | /**
71 | * Get the current iv
72 | */
73 | const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
74 |
75 | /**
76 | * Generate a random iv
77 | */
78 | void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
79 |
80 | /**
81 | * Forcefully change the 8-byte iv
82 | */
83 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv);
84 |
85 | /**
86 | * Forcefully change the "full" 16-byte iv, including the counter
87 | */
88 | void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t* iv);
89 |
90 | /**
91 | * Increment the top 64 bit of the iv (performed after each frame)
92 | */
93 | void av_aes_ctr_increment_iv(struct AVAESCTR *a);
94 |
95 | /**
96 | * @}
97 | */
98 |
99 | #endif /* AVUTIL_AES_CTR_H */
100 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/ambient_viewing_environment.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023 Jan Ekström
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
22 | #define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
23 |
24 | #include
25 | #include "frame.h"
26 | #include "rational.h"
27 |
28 | /**
29 | * Ambient viewing environment metadata as defined by H.274. The values are
30 | * saved in AVRationals so that they keep their exactness, while allowing for
31 | * easy access to a double value with f.ex. av_q2d.
32 | *
33 | * @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and
34 | * it must be allocated using av_ambient_viewing_environment_alloc.
35 | */
36 | typedef struct AVAmbientViewingEnvironment {
37 | /**
38 | * Environmental illuminance of the ambient viewing environment in lux.
39 | */
40 | AVRational ambient_illuminance;
41 |
42 | /**
43 | * Normalized x chromaticity coordinate of the environmental ambient light
44 | * in the nominal viewing environment according to the CIE 1931 definition
45 | * of x and y as specified in ISO/CIE 11664-1.
46 | */
47 | AVRational ambient_light_x;
48 |
49 | /**
50 | * Normalized y chromaticity coordinate of the environmental ambient light
51 | * in the nominal viewing environment according to the CIE 1931 definition
52 | * of x and y as specified in ISO/CIE 11664-1.
53 | */
54 | AVRational ambient_light_y;
55 | } AVAmbientViewingEnvironment;
56 |
57 | /**
58 | * Allocate an AVAmbientViewingEnvironment structure.
59 | *
60 | * @return the newly allocated struct or NULL on failure
61 | */
62 | AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size);
63 |
64 | /**
65 | * Allocate and add an AVAmbientViewingEnvironment structure to an existing
66 | * AVFrame as side data.
67 | *
68 | * @return the newly allocated struct, or NULL on failure
69 | */
70 | AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame);
71 |
72 | #endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */
73 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/avassert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2010 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * simple assert() macros that are a bit more flexible than ISO C assert().
24 | * @author Michael Niedermayer
25 | */
26 |
27 | #ifndef AVUTIL_AVASSERT_H
28 | #define AVUTIL_AVASSERT_H
29 |
30 | #include
31 | #ifdef HAVE_AV_CONFIG_H
32 | # include "config.h"
33 | #endif
34 | #include "log.h"
35 | #include "macros.h"
36 |
37 | /**
38 | * assert() equivalent, that is always enabled.
39 | */
40 | #define av_assert0(cond) do { \
41 | if (!(cond)) { \
42 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
43 | AV_STRINGIFY(cond), __FILE__, __LINE__); \
44 | abort(); \
45 | } \
46 | } while (0)
47 |
48 |
49 | /**
50 | * assert() equivalent, that does not lie in speed critical code.
51 | * These asserts() thus can be enabled without fearing speed loss.
52 | */
53 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
54 | #define av_assert1(cond) av_assert0(cond)
55 | #else
56 | #define av_assert1(cond) ((void)0)
57 | #endif
58 |
59 |
60 | /**
61 | * assert() equivalent, that does lie in speed critical code.
62 | */
63 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
64 | #define av_assert2(cond) av_assert0(cond)
65 | #define av_assert2_fpu() av_assert0_fpu()
66 | #else
67 | #define av_assert2(cond) ((void)0)
68 | #define av_assert2_fpu() ((void)0)
69 | #endif
70 |
71 | /**
72 | * Assert that floating point operations can be executed.
73 | *
74 | * This will av_assert0() that the cpu is not in MMX state on X86
75 | */
76 | void av_assert0_fpu(void);
77 |
78 | #endif /* AVUTIL_AVASSERT_H */
79 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/avconfig.h:
--------------------------------------------------------------------------------
1 | /* Generated by ffmpeg configure */
2 | #ifndef AVUTIL_AVCONFIG_H
3 | #define AVUTIL_AVCONFIG_H
4 | #define AV_HAVE_BIGENDIAN 0
5 | #define AV_HAVE_FAST_UNALIGNED 0
6 | #endif /* AVUTIL_AVCONFIG_H */
7 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/base64.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_BASE64_H
22 | #define AVUTIL_BASE64_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_base64 Base64
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | /**
33 | * Decode a base64-encoded string.
34 | *
35 | * @param out buffer for decoded data
36 | * @param in null-terminated input string
37 | * @param out_size size in bytes of the out buffer, must be at
38 | * least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in))
39 | * @return number of bytes written, or a negative value in case of
40 | * invalid input
41 | */
42 | int av_base64_decode(uint8_t *out, const char *in, int out_size);
43 |
44 | /**
45 | * Calculate the output size in bytes needed to decode a base64 string
46 | * with length x to a data buffer.
47 | */
48 | #define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4)
49 |
50 | /**
51 | * Encode data to base64 and null-terminate.
52 | *
53 | * @param out buffer for encoded data
54 | * @param out_size size in bytes of the out buffer (including the
55 | * null terminator), must be at least AV_BASE64_SIZE(in_size)
56 | * @param in input buffer containing the data to encode
57 | * @param in_size size in bytes of the in buffer
58 | * @return out or NULL in case of error
59 | */
60 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
61 |
62 | /**
63 | * Calculate the output size needed to base64-encode x bytes to a
64 | * null-terminated string.
65 | */
66 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
67 |
68 | /**
69 | * @}
70 | */
71 |
72 | #endif /* AVUTIL_BASE64_H */
73 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/blowfish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Blowfish algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_BLOWFISH_H
23 | #define AVUTIL_BLOWFISH_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_blowfish Blowfish
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | #define AV_BF_ROUNDS 16
34 |
35 | typedef struct AVBlowfish {
36 | uint32_t p[AV_BF_ROUNDS + 2];
37 | uint32_t s[4][256];
38 | } AVBlowfish;
39 |
40 | /**
41 | * Allocate an AVBlowfish context.
42 | */
43 | AVBlowfish *av_blowfish_alloc(void);
44 |
45 | /**
46 | * Initialize an AVBlowfish context.
47 | *
48 | * @param ctx an AVBlowfish context
49 | * @param key a key
50 | * @param key_len length of the key
51 | */
52 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
53 |
54 | /**
55 | * Encrypt or decrypt a buffer using a previously initialized context.
56 | *
57 | * @param ctx an AVBlowfish context
58 | * @param xl left four bytes halves of input to be encrypted
59 | * @param xr right four bytes halves of input to be encrypted
60 | * @param decrypt 0 for encryption, 1 for decryption
61 | */
62 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
63 | int decrypt);
64 |
65 | /**
66 | * Encrypt or decrypt a buffer using a previously initialized context.
67 | *
68 | * @param ctx an AVBlowfish context
69 | * @param dst destination array, can be equal to src
70 | * @param src source array, can be equal to dst
71 | * @param count number of 8 byte blocks
72 | * @param iv initialization vector for CBC mode, if NULL ECB will be used
73 | * @param decrypt 0 for encryption, 1 for decryption
74 | */
75 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
76 | int count, uint8_t *iv, int decrypt);
77 |
78 | /**
79 | * @}
80 | */
81 |
82 | #endif /* AVUTIL_BLOWFISH_H */
83 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/bswap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * byte swapping routines
24 | */
25 |
26 | #ifndef AVUTIL_BSWAP_H
27 | #define AVUTIL_BSWAP_H
28 |
29 | #include
30 | #include "libavutil/avconfig.h"
31 | #include "attributes.h"
32 |
33 | #ifdef HAVE_AV_CONFIG_H
34 |
35 | #include "config.h"
36 |
37 | #if ARCH_ARM
38 | # include "arm/bswap.h"
39 | #elif ARCH_RISCV
40 | # include "riscv/bswap.h"
41 | #elif ARCH_X86
42 | # include "x86/bswap.h"
43 | #endif
44 |
45 | #endif /* HAVE_AV_CONFIG_H */
46 |
47 | #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))
48 | #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
49 | #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
50 |
51 | #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
52 |
53 | #ifndef av_bswap16
54 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
55 | {
56 | x= (x>>8) | (x<<8);
57 | return x;
58 | }
59 | #endif
60 |
61 | #ifndef av_bswap32
62 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
63 | {
64 | return AV_BSWAP32C(x);
65 | }
66 | #endif
67 |
68 | #ifndef av_bswap64
69 | static inline uint64_t av_const av_bswap64(uint64_t x)
70 | {
71 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
72 | }
73 | #endif
74 |
75 | // be2ne ... big-endian to native-endian
76 | // le2ne ... little-endian to native-endian
77 |
78 | #if AV_HAVE_BIGENDIAN
79 | #define av_be2ne16(x) (x)
80 | #define av_be2ne32(x) (x)
81 | #define av_be2ne64(x) (x)
82 | #define av_le2ne16(x) av_bswap16(x)
83 | #define av_le2ne32(x) av_bswap32(x)
84 | #define av_le2ne64(x) av_bswap64(x)
85 | #define AV_BE2NEC(s, x) (x)
86 | #define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
87 | #else
88 | #define av_be2ne16(x) av_bswap16(x)
89 | #define av_be2ne32(x) av_bswap32(x)
90 | #define av_be2ne64(x) av_bswap64(x)
91 | #define av_le2ne16(x) (x)
92 | #define av_le2ne32(x) (x)
93 | #define av_le2ne64(x) (x)
94 | #define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
95 | #define AV_LE2NEC(s, x) (x)
96 | #endif
97 |
98 | #define AV_BE2NE16C(x) AV_BE2NEC(16, x)
99 | #define AV_BE2NE32C(x) AV_BE2NEC(32, x)
100 | #define AV_BE2NE64C(x) AV_BE2NEC(64, x)
101 | #define AV_LE2NE16C(x) AV_LE2NEC(16, x)
102 | #define AV_LE2NE32C(x) AV_LE2NEC(32, x)
103 | #define AV_LE2NE64C(x) AV_LE2NEC(64, x)
104 |
105 | #endif /* AVUTIL_BSWAP_H */
106 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/camellia.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the CAMELLIA algorithm as mentioned in RFC3713
3 | * Copyright (c) 2014 Supraja Meedinti
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_CAMELLIA_H
23 | #define AVUTIL_CAMELLIA_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil CAMELLIA algorithm
31 | * @defgroup lavu_camellia CAMELLIA
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_camellia_size;
37 |
38 | struct AVCAMELLIA;
39 |
40 | /**
41 | * Allocate an AVCAMELLIA context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVCAMELLIA *av_camellia_alloc(void);
45 |
46 | /**
47 | * Initialize an AVCAMELLIA context.
48 | *
49 | * @param ctx an AVCAMELLIA context
50 | * @param key a key of 16, 24, 32 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: possible are 128, 192, 256
52 | */
53 | int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context
57 | *
58 | * @param ctx an AVCAMELLIA context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 16 byte blocks
62 | * @param iv initialization vector for CBC mode, NULL for ECB mode
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 | #endif /* AVUTIL_CAMELLIA_H */
71 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/cast5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the CAST128 algorithm as mentioned in RFC2144
3 | * Copyright (c) 2014 Supraja Meedinti
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_CAST5_H
23 | #define AVUTIL_CAST5_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil CAST5 algorithm
31 | * @defgroup lavu_cast5 CAST5
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_cast5_size;
37 |
38 | struct AVCAST5;
39 |
40 | /**
41 | * Allocate an AVCAST5 context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVCAST5 *av_cast5_alloc(void);
45 | /**
46 | * Initialize an AVCAST5 context.
47 | *
48 | * @param ctx an AVCAST5 context
49 | * @param key a key of 5,6,...16 bytes used for encryption/decryption
50 | * @param key_bits number of keybits: possible are 40,48,...,128
51 | * @return 0 on success, less than 0 on failure
52 | */
53 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only
57 | *
58 | * @param ctx an AVCAST5 context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 8 byte blocks
62 | * @param decrypt 0 for encryption, 1 for decryption
63 | */
64 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt);
65 |
66 | /**
67 | * Encrypt or decrypt a buffer using a previously initialized context
68 | *
69 | * @param ctx an AVCAST5 context
70 | * @param dst destination array, can be equal to src
71 | * @param src source array, can be equal to dst
72 | * @param count number of 8 byte blocks
73 | * @param iv initialization vector for CBC mode, NULL for ECB mode
74 | * @param decrypt 0 for encryption, 1 for decryption
75 | */
76 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
77 | /**
78 | * @}
79 | */
80 | #endif /* AVUTIL_CAST5_H */
81 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/crc.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_crc32
24 | * Public header for CRC hash function implementation.
25 | */
26 |
27 | #ifndef AVUTIL_CRC_H
28 | #define AVUTIL_CRC_H
29 |
30 | #include
31 | #include
32 | #include "attributes.h"
33 |
34 | /**
35 | * @defgroup lavu_crc32 CRC
36 | * @ingroup lavu_hash
37 | * CRC (Cyclic Redundancy Check) hash function implementation.
38 | *
39 | * This module supports numerous CRC polynomials, in addition to the most
40 | * widely used CRC-32-IEEE. See @ref AVCRCId for a list of available
41 | * polynomials.
42 | *
43 | * @{
44 | */
45 |
46 | typedef uint32_t AVCRC;
47 |
48 | typedef enum {
49 | AV_CRC_8_ATM,
50 | AV_CRC_16_ANSI,
51 | AV_CRC_16_CCITT,
52 | AV_CRC_32_IEEE,
53 | AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
54 | AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */
55 | AV_CRC_24_IEEE,
56 | AV_CRC_8_EBU,
57 | AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
58 | }AVCRCId;
59 |
60 | /**
61 | * Initialize a CRC table.
62 | * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
63 | * @param le If 1, the lowest bit represents the coefficient for the highest
64 | * exponent of the corresponding polynomial (both for poly and
65 | * actual CRC).
66 | * If 0, you must swap the CRC parameter and the result of av_crc
67 | * if you need the standard representation (can be simplified in
68 | * most cases to e.g. bswap16):
69 | * av_bswap32(crc << (32-bits))
70 | * @param bits number of bits for the CRC
71 | * @param poly generator polynomial without the x**bits coefficient, in the
72 | * representation as specified by le
73 | * @param ctx_size size of ctx in bytes
74 | * @return <0 on failure
75 | */
76 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
77 |
78 | /**
79 | * Get an initialized standard CRC table.
80 | * @param crc_id ID of a standard CRC
81 | * @return a pointer to the CRC table or NULL on failure
82 | */
83 | const AVCRC *av_crc_get_table(AVCRCId crc_id);
84 |
85 | /**
86 | * Calculate the CRC of a block.
87 | * @param ctx initialized AVCRC array (see av_crc_init())
88 | * @param crc CRC of previous blocks if any or initial value for CRC
89 | * @param buffer buffer whose CRC to calculate
90 | * @param length length of the buffer
91 | * @return CRC updated with the data from the given block
92 | *
93 | * @see av_crc_init() "le" parameter
94 | */
95 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
96 | const uint8_t *buffer, size_t length) av_pure;
97 |
98 | /**
99 | * @}
100 | */
101 |
102 | #endif /* AVUTIL_CRC_H */
103 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/des.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DES encryption/decryption
3 | * Copyright (c) 2007 Reimar Doeffinger
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_DES_H
23 | #define AVUTIL_DES_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_des DES
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | typedef struct AVDES {
34 | uint64_t round_keys[3][16];
35 | int triple_des;
36 | } AVDES;
37 |
38 | /**
39 | * Allocate an AVDES context.
40 | */
41 | AVDES *av_des_alloc(void);
42 |
43 | /**
44 | * @brief Initializes an AVDES context.
45 | *
46 | * @param d pointer to a AVDES structure to initialize
47 | * @param key pointer to the key to use
48 | * @param key_bits must be 64 or 192
49 | * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
50 | * @return zero on success, negative value otherwise
51 | */
52 | int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
53 |
54 | /**
55 | * @brief Encrypts / decrypts using the DES algorithm.
56 | *
57 | * @param d pointer to the AVDES structure
58 | * @param dst destination array, can be equal to src, must be 8-byte aligned
59 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
60 | * @param count number of 8 byte blocks
61 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used,
62 | * must be 8-byte aligned
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
66 |
67 | /**
68 | * @brief Calculates CBC-MAC using the DES algorithm.
69 | *
70 | * @param d pointer to the AVDES structure
71 | * @param dst destination array, can be equal to src, must be 8-byte aligned
72 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
73 | * @param count number of 8 byte blocks
74 | */
75 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
76 |
77 | /**
78 | * @}
79 | */
80 |
81 | #endif /* AVUTIL_DES_H */
82 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/detection_bbox.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_DETECTION_BBOX_H
20 | #define AVUTIL_DETECTION_BBOX_H
21 |
22 | #include "rational.h"
23 | #include "avassert.h"
24 | #include "frame.h"
25 |
26 | typedef struct AVDetectionBBox {
27 | /**
28 | * Distance in pixels from the left/top edge of the frame,
29 | * together with width and height, defining the bounding box.
30 | */
31 | int x;
32 | int y;
33 | int w;
34 | int h;
35 |
36 | #define AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE 64
37 |
38 | /**
39 | * Detect result with confidence
40 | */
41 | char detect_label[AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE];
42 | AVRational detect_confidence;
43 |
44 | /**
45 | * At most 4 classifications based on the detected bounding box.
46 | * For example, we can get max 4 different attributes with 4 different
47 | * DNN models on one bounding box.
48 | * classify_count is zero if no classification.
49 | */
50 | #define AV_NUM_DETECTION_BBOX_CLASSIFY 4
51 | uint32_t classify_count;
52 | char classify_labels[AV_NUM_DETECTION_BBOX_CLASSIFY][AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE];
53 | AVRational classify_confidences[AV_NUM_DETECTION_BBOX_CLASSIFY];
54 | } AVDetectionBBox;
55 |
56 | typedef struct AVDetectionBBoxHeader {
57 | /**
58 | * Information about how the bounding box is generated.
59 | * for example, the DNN model name.
60 | */
61 | char source[256];
62 |
63 | /**
64 | * Number of bounding boxes in the array.
65 | */
66 | uint32_t nb_bboxes;
67 |
68 | /**
69 | * Offset in bytes from the beginning of this structure at which
70 | * the array of bounding boxes starts.
71 | */
72 | size_t bboxes_offset;
73 |
74 | /**
75 | * Size of each bounding box in bytes.
76 | */
77 | size_t bbox_size;
78 | } AVDetectionBBoxHeader;
79 |
80 | /*
81 | * Get the bounding box at the specified {@code idx}. Must be between 0 and nb_bboxes.
82 | */
83 | static av_always_inline AVDetectionBBox *
84 | av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx)
85 | {
86 | av_assert0(idx < header->nb_bboxes);
87 | return (AVDetectionBBox *)((uint8_t *)header + header->bboxes_offset +
88 | idx * header->bbox_size);
89 | }
90 |
91 | /**
92 | * Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes}
93 | * AVDetectionBBox, and initializes the variables.
94 | * Can be freed with a normal av_free() call.
95 | *
96 | * @param nb_bboxes number of AVDetectionBBox structures to allocate
97 | * @param out_size if non-NULL, the size in bytes of the resulting data array is
98 | * written here.
99 | */
100 | AVDetectionBBoxHeader *av_detection_bbox_alloc(uint32_t nb_bboxes, size_t *out_size);
101 |
102 | /**
103 | * Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes}
104 | * AVDetectionBBox, in the given AVFrame {@code frame} as AVFrameSideData of type
105 | * AV_FRAME_DATA_DETECTION_BBOXES and initializes the variables.
106 | */
107 | AVDetectionBBoxHeader *av_detection_bbox_create_side_data(AVFrame *frame, uint32_t nb_bboxes);
108 | #endif
109 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/display.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Vittorio Giovara
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_video_display
24 | * Display matrix
25 | */
26 |
27 | #ifndef AVUTIL_DISPLAY_H
28 | #define AVUTIL_DISPLAY_H
29 |
30 | #include
31 |
32 | /**
33 | * @defgroup lavu_video_display Display transformation matrix functions
34 | * @ingroup lavu_video
35 | *
36 | * The display transformation matrix specifies an affine transformation that
37 | * should be applied to video frames for correct presentation. It is compatible
38 | * with the matrices stored in the ISO/IEC 14496-12 container format.
39 | *
40 | * The data is a 3x3 matrix represented as a 9-element array:
41 | *
42 | * @code{.unparsed}
43 | * | a b u |
44 | * (a, b, u, c, d, v, x, y, w) -> | c d v |
45 | * | x y w |
46 | * @endcode
47 | *
48 | * All numbers are stored in native endianness, as 16.16 fixed-point values,
49 | * except for u, v and w, which are stored as 2.30 fixed-point values.
50 | *
51 | * The transformation maps a point (p, q) in the source (pre-transformation)
52 | * frame to the point (p', q') in the destination (post-transformation) frame as
53 | * follows:
54 | *
55 | * @code{.unparsed}
56 | * | a b u |
57 | * (p, q, 1) . | c d v | = z * (p', q', 1)
58 | * | x y w |
59 | * @endcode
60 | *
61 | * The transformation can also be more explicitly written in components as
62 | * follows:
63 | *
64 | * @code{.unparsed}
65 | * p' = (a * p + c * q + x) / z;
66 | * q' = (b * p + d * q + y) / z;
67 | * z = u * p + v * q + w
68 | * @endcode
69 | *
70 | * @{
71 | */
72 |
73 | /**
74 | * Extract the rotation component of the transformation matrix.
75 | *
76 | * @param matrix the transformation matrix
77 | * @return the angle (in degrees) by which the transformation rotates the frame
78 | * counterclockwise. The angle will be in range [-180.0, 180.0],
79 | * or NaN if the matrix is singular.
80 | *
81 | * @note floating point numbers are inherently inexact, so callers are
82 | * recommended to round the return value to nearest integer before use.
83 | */
84 | double av_display_rotation_get(const int32_t matrix[9]);
85 |
86 | /**
87 | * Initialize a transformation matrix describing a pure clockwise
88 | * rotation by the specified angle (in degrees).
89 | *
90 | * @param[out] matrix a transformation matrix (will be fully overwritten
91 | * by this function)
92 | * @param angle rotation angle in degrees.
93 | */
94 | void av_display_rotation_set(int32_t matrix[9], double angle);
95 |
96 | /**
97 | * Flip the input matrix horizontally and/or vertically.
98 | *
99 | * @param[in,out] matrix a transformation matrix
100 | * @param hflip whether the matrix should be flipped horizontally
101 | * @param vflip whether the matrix should be flipped vertically
102 | */
103 | void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
104 |
105 | /**
106 | * @}
107 | */
108 |
109 | #endif /* AVUTIL_DISPLAY_H */
110 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/downmix_info.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Tim Walker
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_DOWNMIX_INFO_H
22 | #define AVUTIL_DOWNMIX_INFO_H
23 |
24 | #include "frame.h"
25 |
26 | /**
27 | * @file
28 | * audio downmix medatata
29 | */
30 |
31 | /**
32 | * @addtogroup lavu_audio
33 | * @{
34 | */
35 |
36 | /**
37 | * @defgroup downmix_info Audio downmix metadata
38 | * @{
39 | */
40 |
41 | /**
42 | * Possible downmix types.
43 | */
44 | enum AVDownmixType {
45 | AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
46 | AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */
47 | AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
48 | AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
49 | AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */
50 | };
51 |
52 | /**
53 | * This structure describes optional metadata relevant to a downmix procedure.
54 | *
55 | * All fields are set by the decoder to the value indicated in the audio
56 | * bitstream (if present), or to a "sane" default otherwise.
57 | */
58 | typedef struct AVDownmixInfo {
59 | /**
60 | * Type of downmix preferred by the mastering engineer.
61 | */
62 | enum AVDownmixType preferred_downmix_type;
63 |
64 | /**
65 | * Absolute scale factor representing the nominal level of the center
66 | * channel during a regular downmix.
67 | */
68 | double center_mix_level;
69 |
70 | /**
71 | * Absolute scale factor representing the nominal level of the center
72 | * channel during an Lt/Rt compatible downmix.
73 | */
74 | double center_mix_level_ltrt;
75 |
76 | /**
77 | * Absolute scale factor representing the nominal level of the surround
78 | * channels during a regular downmix.
79 | */
80 | double surround_mix_level;
81 |
82 | /**
83 | * Absolute scale factor representing the nominal level of the surround
84 | * channels during an Lt/Rt compatible downmix.
85 | */
86 | double surround_mix_level_ltrt;
87 |
88 | /**
89 | * Absolute scale factor representing the level at which the LFE data is
90 | * mixed into L/R channels during downmixing.
91 | */
92 | double lfe_mix_level;
93 | } AVDownmixInfo;
94 |
95 | /**
96 | * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
97 | *
98 | * If the side data is absent, it is created and added to the frame.
99 | *
100 | * @param frame the frame for which the side data is to be obtained or created
101 | *
102 | * @return the AVDownmixInfo structure to be edited by the caller, or NULL if
103 | * the structure cannot be allocated.
104 | */
105 | AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
106 |
107 | /**
108 | * @}
109 | */
110 |
111 | /**
112 | * @}
113 | */
114 |
115 | #endif /* AVUTIL_DOWNMIX_INFO_H */
116 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/executor.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2023 Nuo Mi
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_EXECUTOR_H
22 | #define AVUTIL_EXECUTOR_H
23 |
24 | typedef struct AVExecutor AVExecutor;
25 | typedef struct AVTask AVTask;
26 |
27 | struct AVTask {
28 | AVTask *next;
29 | };
30 |
31 | typedef struct AVTaskCallbacks {
32 | void *user_data;
33 |
34 | int local_context_size;
35 |
36 | // return 1 if a's priority > b's priority
37 | int (*priority_higher)(const AVTask *a, const AVTask *b);
38 |
39 | // task is ready for run
40 | int (*ready)(const AVTask *t, void *user_data);
41 |
42 | // run the task
43 | int (*run)(AVTask *t, void *local_context, void *user_data);
44 | } AVTaskCallbacks;
45 |
46 | /**
47 | * Alloc executor
48 | * @param callbacks callback structure for executor
49 | * @param thread_count worker thread number, 0 for run on caller's thread directly
50 | * @return return the executor
51 | */
52 | AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count);
53 |
54 | /**
55 | * Free executor
56 | * @param e pointer to executor
57 | */
58 | void av_executor_free(AVExecutor **e);
59 |
60 | /**
61 | * Add task to executor
62 | * @param e pointer to executor
63 | * @param t pointer to task. If NULL, it will wakeup one work thread
64 | */
65 | void av_executor_execute(AVExecutor *e, AVTask *t);
66 |
67 | #endif //AVUTIL_EXECUTOR_H
68 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/ffversion.h:
--------------------------------------------------------------------------------
1 | /* Automatically generated by version.sh, do not manually edit! */
2 | #ifndef AVUTIL_FFVERSION_H
3 | #define AVUTIL_FFVERSION_H
4 | #define FFMPEG_VERSION "7.1"
5 | #endif /* AVUTIL_FFVERSION_H */
6 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/file.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_FILE_H
20 | #define AVUTIL_FILE_H
21 |
22 | #include
23 | #include
24 |
25 | #include "attributes.h"
26 |
27 | /**
28 | * @file
29 | * Misc file utilities.
30 | */
31 |
32 | /**
33 | * Read the file with name filename, and put its content in a newly
34 | * allocated buffer or map it with mmap() when available.
35 | * In case of success set *bufptr to the read or mmapped buffer, and
36 | * *size to the size in bytes of the buffer in *bufptr.
37 | * Unlike mmap this function succeeds with zero sized files, in this
38 | * case *bufptr will be set to NULL and *size will be set to 0.
39 | * The returned buffer must be released with av_file_unmap().
40 | *
41 | * @param filename path to the file
42 | * @param[out] bufptr pointee is set to the mapped or allocated buffer
43 | * @param[out] size pointee is set to the size in bytes of the buffer
44 | * @param log_offset loglevel offset used for logging
45 | * @param log_ctx context used for logging
46 | * @return a non negative number in case of success, a negative value
47 | * corresponding to an AVERROR error code in case of failure
48 | */
49 | av_warn_unused_result
50 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
51 | int log_offset, void *log_ctx);
52 |
53 | /**
54 | * Unmap or free the buffer bufptr created by av_file_map().
55 | *
56 | * @param bufptr the buffer previously created with av_file_map()
57 | * @param size size in bytes of bufptr, must be the same as returned
58 | * by av_file_map()
59 | */
60 | void av_file_unmap(uint8_t *bufptr, size_t size);
61 |
62 | #endif /* AVUTIL_FILE_H */
63 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hmac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Martin Storsjo
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_HMAC_H
22 | #define AVUTIL_HMAC_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_hmac HMAC
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | enum AVHMACType {
33 | AV_HMAC_MD5,
34 | AV_HMAC_SHA1,
35 | AV_HMAC_SHA224,
36 | AV_HMAC_SHA256,
37 | AV_HMAC_SHA384,
38 | AV_HMAC_SHA512,
39 | };
40 |
41 | typedef struct AVHMAC AVHMAC;
42 |
43 | /**
44 | * Allocate an AVHMAC context.
45 | * @param type The hash function used for the HMAC.
46 | */
47 | AVHMAC *av_hmac_alloc(enum AVHMACType type);
48 |
49 | /**
50 | * Free an AVHMAC context.
51 | * @param ctx The context to free, may be NULL
52 | */
53 | void av_hmac_free(AVHMAC *ctx);
54 |
55 | /**
56 | * Initialize an AVHMAC context with an authentication key.
57 | * @param ctx The HMAC context
58 | * @param key The authentication key
59 | * @param keylen The length of the key, in bytes
60 | */
61 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
62 |
63 | /**
64 | * Hash data with the HMAC.
65 | * @param ctx The HMAC context
66 | * @param data The data to hash
67 | * @param len The length of the data, in bytes
68 | */
69 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
70 |
71 | /**
72 | * Finish hashing and output the HMAC digest.
73 | * @param ctx The HMAC context
74 | * @param out The output buffer to write the digest into
75 | * @param outlen The length of the out buffer, in bytes
76 | * @return The number of bytes written to out, or a negative error code.
77 | */
78 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
79 |
80 | /**
81 | * Hash an array of data with a key.
82 | * @param ctx The HMAC context
83 | * @param data The data to hash
84 | * @param len The length of the data, in bytes
85 | * @param key The authentication key
86 | * @param keylen The length of the key, in bytes
87 | * @param out The output buffer to write the digest into
88 | * @param outlen The length of the out buffer, in bytes
89 | * @return The number of bytes written to out, or a negative error code.
90 | */
91 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
92 | const uint8_t *key, unsigned int keylen,
93 | uint8_t *out, unsigned int outlen);
94 |
95 | /**
96 | * @}
97 | */
98 |
99 | #endif /* AVUTIL_HMAC_H */
100 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hwcontext_cuda.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 |
20 | #ifndef AVUTIL_HWCONTEXT_CUDA_H
21 | #define AVUTIL_HWCONTEXT_CUDA_H
22 |
23 | #ifndef CUDA_VERSION
24 | #include
25 | #endif
26 |
27 | #include "pixfmt.h"
28 |
29 | /**
30 | * @file
31 | * An API-specific header for AV_HWDEVICE_TYPE_CUDA.
32 | *
33 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return
34 | * AVBufferRefs whose data pointer is a CUdeviceptr.
35 | */
36 |
37 | typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal;
38 |
39 | /**
40 | * This struct is allocated as AVHWDeviceContext.hwctx
41 | */
42 | typedef struct AVCUDADeviceContext {
43 | CUcontext cuda_ctx;
44 | CUstream stream;
45 | AVCUDADeviceContextInternal *internal;
46 | } AVCUDADeviceContext;
47 |
48 | /**
49 | * AVHWFramesContext.hwctx is currently not used
50 | */
51 |
52 | /**
53 | * @defgroup hwcontext_cuda Device context creation flags
54 | *
55 | * Flags for av_hwdevice_ctx_create.
56 | *
57 | * @{
58 | */
59 |
60 | /**
61 | * Use primary device context instead of creating a new one.
62 | */
63 | #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0)
64 |
65 | /**
66 | * Use current device context instead of creating a new one.
67 | */
68 | #define AV_CUDA_USE_CURRENT_CONTEXT (1 << 1)
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | #endif /* AVUTIL_HWCONTEXT_CUDA_H */
75 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hwcontext_dxva2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 |
20 | #ifndef AVUTIL_HWCONTEXT_DXVA2_H
21 | #define AVUTIL_HWCONTEXT_DXVA2_H
22 |
23 | /**
24 | * @file
25 | * An API-specific header for AV_HWDEVICE_TYPE_DXVA2.
26 | *
27 | * Only fixed-size pools are supported.
28 | *
29 | * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
30 | * with the data pointer set to a pointer to IDirect3DSurface9.
31 | */
32 |
33 | #include
34 | #include
35 |
36 | /**
37 | * This struct is allocated as AVHWDeviceContext.hwctx
38 | */
39 | typedef struct AVDXVA2DeviceContext {
40 | IDirect3DDeviceManager9 *devmgr;
41 | } AVDXVA2DeviceContext;
42 |
43 | /**
44 | * This struct is allocated as AVHWFramesContext.hwctx
45 | */
46 | typedef struct AVDXVA2FramesContext {
47 | /**
48 | * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or
49 | * DXVA2_VideoDecoderRenderTarget). Must be set by the caller.
50 | */
51 | DWORD surface_type;
52 |
53 | /**
54 | * The surface pool. When an external pool is not provided by the caller,
55 | * this will be managed (allocated and filled on init, freed on uninit) by
56 | * libavutil.
57 | */
58 | IDirect3DSurface9 **surfaces;
59 | int nb_surfaces;
60 |
61 | /**
62 | * Certain drivers require the decoder to be destroyed before the surfaces.
63 | * To allow internally managed pools to work properly in such cases, this
64 | * field is provided.
65 | *
66 | * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on
67 | * it just before the internal surface pool is freed.
68 | *
69 | * This is for convenience only. Some code uses other methods to manage the
70 | * decoder reference.
71 | */
72 | IDirectXVideoDecoder *decoder_to_release;
73 | } AVDXVA2FramesContext;
74 |
75 | #endif /* AVUTIL_HWCONTEXT_DXVA2_H */
76 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hwcontext_mediacodec.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_HWCONTEXT_MEDIACODEC_H
20 | #define AVUTIL_HWCONTEXT_MEDIACODEC_H
21 |
22 | /**
23 | * MediaCodec details.
24 | *
25 | * Allocated as AVHWDeviceContext.hwctx
26 | */
27 | typedef struct AVMediaCodecDeviceContext {
28 | /**
29 | * android/view/Surface handle, to be filled by the user.
30 | *
31 | * This is the default surface used by decoders on this device.
32 | */
33 | void *surface;
34 |
35 | /**
36 | * Pointer to ANativeWindow.
37 | *
38 | * It both surface and native_window is NULL, try to create it
39 | * automatically if create_window is true and OS support
40 | * createPersistentInputSurface.
41 | *
42 | * It can be used as output surface for decoder and input surface for
43 | * encoder.
44 | */
45 | void *native_window;
46 |
47 | /**
48 | * Enable createPersistentInputSurface automatically.
49 | *
50 | * Disabled by default.
51 | *
52 | * It can be enabled by setting this flag directly, or by setting
53 | * AVDictionary of av_hwdevice_ctx_create(), with "create_window" as key.
54 | * The second method is useful for ffmpeg cmdline, e.g., we can enable it
55 | * via:
56 | * -init_hw_device mediacodec=mediacodec,create_window=1
57 | */
58 | int create_window;
59 | } AVMediaCodecDeviceContext;
60 |
61 | #endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */
62 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hwcontext_opencl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_HWCONTEXT_OPENCL_H
20 | #define AVUTIL_HWCONTEXT_OPENCL_H
21 |
22 | #ifdef __APPLE__
23 | #include
24 | #else
25 | #include
26 | #endif
27 |
28 | #include "frame.h"
29 |
30 | /**
31 | * @file
32 | * API-specific header for AV_HWDEVICE_TYPE_OPENCL.
33 | *
34 | * Pools allocated internally are always dynamic, and are primarily intended
35 | * to be used in OpenCL-only cases. If interoperation is required, it is
36 | * typically required to allocate frames in the other API and then map the
37 | * frames context to OpenCL with av_hwframe_ctx_create_derived().
38 | */
39 |
40 | /**
41 | * OpenCL frame descriptor for pool allocation.
42 | *
43 | * In user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
44 | * with the data pointer pointing at an object of this type describing the
45 | * planes of the frame.
46 | */
47 | typedef struct AVOpenCLFrameDescriptor {
48 | /**
49 | * Number of planes in the frame.
50 | */
51 | int nb_planes;
52 | /**
53 | * OpenCL image2d objects for each plane of the frame.
54 | */
55 | cl_mem planes[AV_NUM_DATA_POINTERS];
56 | } AVOpenCLFrameDescriptor;
57 |
58 | /**
59 | * OpenCL device details.
60 | *
61 | * Allocated as AVHWDeviceContext.hwctx
62 | */
63 | typedef struct AVOpenCLDeviceContext {
64 | /**
65 | * The primary device ID of the device. If multiple OpenCL devices
66 | * are associated with the context then this is the one which will
67 | * be used for all operations internal to FFmpeg.
68 | */
69 | cl_device_id device_id;
70 | /**
71 | * The OpenCL context which will contain all operations and frames on
72 | * this device.
73 | */
74 | cl_context context;
75 | /**
76 | * The default command queue for this device, which will be used by all
77 | * frames contexts which do not have their own command queue. If not
78 | * intialised by the user, a default queue will be created on the
79 | * primary device.
80 | */
81 | cl_command_queue command_queue;
82 | } AVOpenCLDeviceContext;
83 |
84 | /**
85 | * OpenCL-specific data associated with a frame pool.
86 | *
87 | * Allocated as AVHWFramesContext.hwctx.
88 | */
89 | typedef struct AVOpenCLFramesContext {
90 | /**
91 | * The command queue used for internal asynchronous operations on this
92 | * device (av_hwframe_transfer_data(), av_hwframe_map()).
93 | *
94 | * If this is not set, the command queue from the associated device is
95 | * used instead.
96 | */
97 | cl_command_queue command_queue;
98 | } AVOpenCLFramesContext;
99 |
100 | #endif /* AVUTIL_HWCONTEXT_OPENCL_H */
101 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hwcontext_qsv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_HWCONTEXT_QSV_H
20 | #define AVUTIL_HWCONTEXT_QSV_H
21 |
22 | #include
23 |
24 | /**
25 | * @file
26 | * An API-specific header for AV_HWDEVICE_TYPE_QSV.
27 | *
28 | * AVHWFramesContext.pool must contain AVBufferRefs whose data pointer points
29 | * to a mfxFrameSurface1 struct.
30 | */
31 |
32 | /**
33 | * This struct is allocated as AVHWDeviceContext.hwctx
34 | */
35 | typedef struct AVQSVDeviceContext {
36 | mfxSession session;
37 | /**
38 | * The mfxLoader handle used for mfxSession creation
39 | *
40 | * This field is only available for oneVPL user. For non-oneVPL user, this
41 | * field must be set to NULL.
42 | *
43 | * Filled by the user before calling av_hwdevice_ctx_init() and should be
44 | * cast to mfxLoader handle. Deallocating the AVHWDeviceContext will always
45 | * release this interface.
46 | */
47 | void *loader;
48 | } AVQSVDeviceContext;
49 |
50 | /**
51 | * This struct is allocated as AVHWFramesContext.hwctx
52 | */
53 | typedef struct AVQSVFramesContext {
54 | /**
55 | * A pointer to a mfxFrameSurface1 struct
56 | *
57 | * It is available when nb_surfaces is non-zero.
58 | */
59 | mfxFrameSurface1 *surfaces;
60 |
61 | /**
62 | * Number of frames in the pool
63 | *
64 | * It is 0 for dynamic frame pools or AVHWFramesContext.initial_pool_size
65 | * for fixed frame pools.
66 | *
67 | * Note only oneVPL GPU runtime 2.9+ can support dynamic frame pools
68 | * on d3d11va or vaapi
69 | */
70 | int nb_surfaces;
71 |
72 | /**
73 | * A combination of MFX_MEMTYPE_* describing the frame pool.
74 | */
75 | int frame_type;
76 |
77 | /**
78 | * A pointer to a mfxFrameInfo struct
79 | *
80 | * It is available when nb_surfaces is 0, all buffers allocated from the
81 | * pool have the same mfxFrameInfo.
82 | */
83 | mfxFrameInfo *info;
84 | } AVQSVFramesContext;
85 |
86 | #endif /* AVUTIL_HWCONTEXT_QSV_H */
87 |
88 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/hwcontext_vdpau.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_HWCONTEXT_VDPAU_H
20 | #define AVUTIL_HWCONTEXT_VDPAU_H
21 |
22 | #include
23 |
24 | /**
25 | * @file
26 | * An API-specific header for AV_HWDEVICE_TYPE_VDPAU.
27 | *
28 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return
29 | * AVBufferRefs whose data pointer is a VdpVideoSurface.
30 | */
31 |
32 | /**
33 | * This struct is allocated as AVHWDeviceContext.hwctx
34 | */
35 | typedef struct AVVDPAUDeviceContext {
36 | VdpDevice device;
37 | VdpGetProcAddress *get_proc_address;
38 | } AVVDPAUDeviceContext;
39 |
40 | /**
41 | * AVHWFramesContext.hwctx is currently not used
42 | */
43 |
44 | #endif /* AVUTIL_HWCONTEXT_VDPAU_H */
45 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/intfloat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_INTFLOAT_H
22 | #define AVUTIL_INTFLOAT_H
23 |
24 | #include
25 | #include "attributes.h"
26 |
27 | union av_intfloat32 {
28 | uint32_t i;
29 | float f;
30 | };
31 |
32 | union av_intfloat64 {
33 | uint64_t i;
34 | double f;
35 | };
36 |
37 | /**
38 | * Reinterpret a 32-bit integer as a float.
39 | */
40 | static av_always_inline float av_int2float(uint32_t i)
41 | {
42 | union av_intfloat32 v;
43 | v.i = i;
44 | return v.f;
45 | }
46 |
47 | /**
48 | * Reinterpret a float as a 32-bit integer.
49 | */
50 | static av_always_inline uint32_t av_float2int(float f)
51 | {
52 | union av_intfloat32 v;
53 | v.f = f;
54 | return v.i;
55 | }
56 |
57 | /**
58 | * Reinterpret a 64-bit integer as a double.
59 | */
60 | static av_always_inline double av_int2double(uint64_t i)
61 | {
62 | union av_intfloat64 v;
63 | v.i = i;
64 | return v.f;
65 | }
66 |
67 | /**
68 | * Reinterpret a double as a 64-bit integer.
69 | */
70 | static av_always_inline uint64_t av_double2int(double f)
71 | {
72 | union av_intfloat64 v;
73 | v.f = f;
74 | return v.i;
75 | }
76 |
77 | #endif /* AVUTIL_INTFLOAT_H */
78 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/lfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Lagged Fibonacci PRNG
3 | * Copyright (c) 2008 Michael Niedermayer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LFG_H
23 | #define AVUTIL_LFG_H
24 |
25 | #include
26 |
27 | /**
28 | * Context structure for the Lagged Fibonacci PRNG.
29 | * The exact layout, types and content of this struct may change and should
30 | * not be accessed directly. Only its `sizeof()` is guaranteed to stay the same
31 | * to allow easy instanciation.
32 | */
33 | typedef struct AVLFG {
34 | unsigned int state[64];
35 | int index;
36 | } AVLFG;
37 |
38 | void av_lfg_init(AVLFG *c, unsigned int seed);
39 |
40 | /**
41 | * Seed the state of the ALFG using binary data.
42 | *
43 | * @return 0 on success, negative value (AVERROR) on failure.
44 | */
45 | int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length);
46 |
47 | /**
48 | * Get the next random unsigned 32-bit number using an ALFG.
49 | *
50 | * Please also consider a simple LCG like state= state*1664525+1013904223,
51 | * it may be good enough and faster for your specific use case.
52 | */
53 | static inline unsigned int av_lfg_get(AVLFG *c){
54 | unsigned a = c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
55 | c->index += 1U;
56 | return a;
57 | }
58 |
59 | /**
60 | * Get the next random unsigned 32-bit number using a MLFG.
61 | *
62 | * Please also consider av_lfg_get() above, it is faster.
63 | */
64 | static inline unsigned int av_mlfg_get(AVLFG *c){
65 | unsigned int a= c->state[(c->index-55) & 63];
66 | unsigned int b= c->state[(c->index-24) & 63];
67 | a = c->state[c->index & 63] = 2*a*b+a+b;
68 | c->index += 1U;
69 | return a;
70 | }
71 |
72 | /**
73 | * Get the next two numbers generated by a Box-Muller Gaussian
74 | * generator using the random numbers issued by lfg.
75 | *
76 | * @param lfg pointer to the contex structure
77 | * @param out array where the two generated numbers are placed
78 | */
79 | void av_bmg_get(AVLFG *lfg, double out[2]);
80 |
81 | #endif /* AVUTIL_LFG_H */
82 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/lzo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LZO 1x decompression
3 | * copyright (c) 2006 Reimar Doeffinger
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LZO_H
23 | #define AVUTIL_LZO_H
24 |
25 | /**
26 | * @defgroup lavu_lzo LZO
27 | * @ingroup lavu_crypto
28 | *
29 | * @{
30 | */
31 |
32 | #include
33 |
34 | /** @name Error flags returned by av_lzo1x_decode
35 | * @{ */
36 | /// end of the input buffer reached before decoding finished
37 | #define AV_LZO_INPUT_DEPLETED 1
38 | /// decoded data did not fit into output buffer
39 | #define AV_LZO_OUTPUT_FULL 2
40 | /// a reference to previously decoded data was wrong
41 | #define AV_LZO_INVALID_BACKPTR 4
42 | /// a non-specific error in the compressed bitstream
43 | #define AV_LZO_ERROR 8
44 | /** @} */
45 |
46 | #define AV_LZO_INPUT_PADDING 8
47 | #define AV_LZO_OUTPUT_PADDING 12
48 |
49 | /**
50 | * @brief Decodes LZO 1x compressed data.
51 | * @param out output buffer
52 | * @param outlen size of output buffer, number of bytes left are returned here
53 | * @param in input buffer
54 | * @param inlen size of input buffer, number of bytes left are returned here
55 | * @return 0 on success, otherwise a combination of the error flags above
56 | *
57 | * Make sure all buffers are appropriately padded, in must provide
58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
59 | */
60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_LZO_H */
67 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/macros.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * @ingroup lavu
22 | * Utility Preprocessor macros
23 | */
24 |
25 | #ifndef AVUTIL_MACROS_H
26 | #define AVUTIL_MACROS_H
27 |
28 | #include "libavutil/avconfig.h"
29 |
30 | #if AV_HAVE_BIGENDIAN
31 | # define AV_NE(be, le) (be)
32 | #else
33 | # define AV_NE(be, le) (le)
34 | #endif
35 |
36 | /**
37 | * Comparator.
38 | * For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
39 | * if x == y. This is useful for instance in a qsort comparator callback.
40 | * Furthermore, compilers are able to optimize this to branchless code, and
41 | * there is no risk of overflow with signed types.
42 | * As with many macros, this evaluates its argument multiple times, it thus
43 | * must not have a side-effect.
44 | */
45 | #define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
46 |
47 | #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
48 | #define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
49 | #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
50 | #define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
51 |
52 | #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
53 | #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
54 |
55 | #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
56 | #define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
57 |
58 | /**
59 | * @addtogroup preproc_misc Preprocessor String Macros
60 | *
61 | * String manipulation macros
62 | *
63 | * @{
64 | */
65 |
66 | #define AV_STRINGIFY(s) AV_TOSTRING(s)
67 | #define AV_TOSTRING(s) #s
68 |
69 | #define AV_GLUE(a, b) a ## b
70 | #define AV_JOIN(a, b) AV_GLUE(a, b)
71 |
72 | /**
73 | * @}
74 | */
75 |
76 | #define AV_PRAGMA(s) _Pragma(#s)
77 |
78 | #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
79 |
80 | #endif /* AVUTIL_MACROS_H */
81 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_md5
24 | * Public header for MD5 hash function implementation.
25 | */
26 |
27 | #ifndef AVUTIL_MD5_H
28 | #define AVUTIL_MD5_H
29 |
30 | #include
31 | #include
32 |
33 | #include "attributes.h"
34 |
35 | /**
36 | * @defgroup lavu_md5 MD5
37 | * @ingroup lavu_hash
38 | * MD5 hash function implementation.
39 | *
40 | * @{
41 | */
42 |
43 | extern const int av_md5_size;
44 |
45 | struct AVMD5;
46 |
47 | /**
48 | * Allocate an AVMD5 context.
49 | */
50 | struct AVMD5 *av_md5_alloc(void);
51 |
52 | /**
53 | * Initialize MD5 hashing.
54 | *
55 | * @param ctx pointer to the function context (of size av_md5_size)
56 | */
57 | void av_md5_init(struct AVMD5 *ctx);
58 |
59 | /**
60 | * Update hash value.
61 | *
62 | * @param ctx hash function context
63 | * @param src input data to update hash with
64 | * @param len input data length
65 | */
66 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len);
67 |
68 | /**
69 | * Finish hashing and output digest value.
70 | *
71 | * @param ctx hash function context
72 | * @param dst buffer where output digest value is stored
73 | */
74 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
75 |
76 | /**
77 | * Hash an array of data.
78 | *
79 | * @param dst The output buffer to write the digest into
80 | * @param src The data to hash
81 | * @param len The length of the data, in bytes
82 | */
83 | void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len);
84 |
85 | /**
86 | * @}
87 | */
88 |
89 | #endif /* AVUTIL_MD5_H */
90 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/motion_vector.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_MOTION_VECTOR_H
20 | #define AVUTIL_MOTION_VECTOR_H
21 |
22 | #include
23 |
24 | typedef struct AVMotionVector {
25 | /**
26 | * Where the current macroblock comes from; negative value when it comes
27 | * from the past, positive value when it comes from the future.
28 | * XXX: set exact relative ref frame reference instead of a +/- 1 "direction".
29 | */
30 | int32_t source;
31 | /**
32 | * Width and height of the block.
33 | */
34 | uint8_t w, h;
35 | /**
36 | * Absolute source position. Can be outside the frame area.
37 | */
38 | int16_t src_x, src_y;
39 | /**
40 | * Absolute destination position. Can be outside the frame area.
41 | */
42 | int16_t dst_x, dst_y;
43 | /**
44 | * Extra flag information.
45 | * Currently unused.
46 | */
47 | uint64_t flags;
48 | /**
49 | * Motion vector
50 | * src_x = dst_x + motion_x / motion_scale
51 | * src_y = dst_y + motion_y / motion_scale
52 | */
53 | int32_t motion_x, motion_y;
54 | uint16_t motion_scale;
55 | } AVMotionVector;
56 |
57 | #endif /* AVUTIL_MOTION_VECTOR_H */
58 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/murmur3.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Reimar Döffinger
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_murmur3
24 | * Public header for MurmurHash3 hash function implementation.
25 | */
26 |
27 | #ifndef AVUTIL_MURMUR3_H
28 | #define AVUTIL_MURMUR3_H
29 |
30 | #include
31 | #include
32 |
33 | /**
34 | * @defgroup lavu_murmur3 Murmur3
35 | * @ingroup lavu_hash
36 | * MurmurHash3 hash function implementation.
37 | *
38 | * MurmurHash3 is a non-cryptographic hash function, of which three
39 | * incompatible versions were created by its inventor Austin Appleby:
40 | *
41 | * - 32-bit output
42 | * - 128-bit output for 32-bit platforms
43 | * - 128-bit output for 64-bit platforms
44 | *
45 | * FFmpeg only implements the last variant: 128-bit output designed for 64-bit
46 | * platforms. Even though the hash function was designed for 64-bit platforms,
47 | * the function in reality works on 32-bit systems too, only with reduced
48 | * performance.
49 | *
50 | * @anchor lavu_murmur3_seedinfo
51 | * By design, MurmurHash3 requires a seed to operate. In response to this,
52 | * libavutil provides two functions for hash initiation, one that requires a
53 | * seed (av_murmur3_init_seeded()) and one that uses a fixed arbitrary integer
54 | * as the seed, and therefore does not (av_murmur3_init()).
55 | *
56 | * To make hashes comparable, you should provide the same seed for all calls to
57 | * this hash function -- if you are supplying one yourself, that is.
58 | *
59 | * @{
60 | */
61 |
62 | /**
63 | * Allocate an AVMurMur3 hash context.
64 | *
65 | * @return Uninitialized hash context or `NULL` in case of error
66 | */
67 | struct AVMurMur3 *av_murmur3_alloc(void);
68 |
69 | /**
70 | * Initialize or reinitialize an AVMurMur3 hash context with a seed.
71 | *
72 | * @param[out] c Hash context
73 | * @param[in] seed Random seed
74 | *
75 | * @see av_murmur3_init()
76 | * @see @ref lavu_murmur3_seedinfo "Detailed description" on a discussion of
77 | * seeds for MurmurHash3.
78 | */
79 | void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed);
80 |
81 | /**
82 | * Initialize or reinitialize an AVMurMur3 hash context.
83 | *
84 | * Equivalent to av_murmur3_init_seeded() with a built-in seed.
85 | *
86 | * @param[out] c Hash context
87 | *
88 | * @see av_murmur3_init_seeded()
89 | * @see @ref lavu_murmur3_seedinfo "Detailed description" on a discussion of
90 | * seeds for MurmurHash3.
91 | */
92 | void av_murmur3_init(struct AVMurMur3 *c);
93 |
94 | /**
95 | * Update hash context with new data.
96 | *
97 | * @param[out] c Hash context
98 | * @param[in] src Input data to update hash with
99 | * @param[in] len Number of bytes to read from `src`
100 | */
101 | void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
102 |
103 | /**
104 | * Finish hashing and output digest value.
105 | *
106 | * @param[in,out] c Hash context
107 | * @param[out] dst Buffer where output digest value is stored
108 | */
109 | void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]);
110 |
111 | /**
112 | * @}
113 | */
114 |
115 | #endif /* AVUTIL_MURMUR3_H */
116 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/pixelutils.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_PIXELUTILS_H
20 | #define AVUTIL_PIXELUTILS_H
21 |
22 | #include
23 | #include
24 |
25 | /**
26 | * Sum of abs(src1[x] - src2[x])
27 | */
28 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1,
29 | const uint8_t *src2, ptrdiff_t stride2);
30 |
31 | /**
32 | * Get a potentially optimized pointer to a Sum-of-absolute-differences
33 | * function (see the av_pixelutils_sad_fn prototype).
34 | *
35 | * @param w_bits 1<
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_RANDOM_SEED_H
22 | #define AVUTIL_RANDOM_SEED_H
23 |
24 | #include
25 | #include
26 | /**
27 | * @addtogroup lavu_crypto
28 | * @{
29 | */
30 |
31 | /**
32 | * Get a seed to use in conjunction with random functions.
33 | * This function tries to provide a good seed at a best effort bases.
34 | * Its possible to call this function multiple times if more bits are needed.
35 | * It can be quite slow, which is why it should only be used as seed for a faster
36 | * PRNG. The quality of the seed depends on the platform.
37 | */
38 | uint32_t av_get_random_seed(void);
39 |
40 | /**
41 | * Generate cryptographically secure random data, i.e. suitable for use as
42 | * encryption keys and similar.
43 | *
44 | * @param buf buffer into which the random data will be written
45 | * @param len size of buf in bytes
46 | *
47 | * @retval 0 success, len bytes of random data was written
48 | * into buf
49 | * @retval "a negative AVERROR code" random data could not be generated
50 | */
51 | int av_random_bytes(uint8_t *buf, size_t len);
52 |
53 | /**
54 | * @}
55 | */
56 |
57 | #endif /* AVUTIL_RANDOM_SEED_H */
58 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/rc4.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RC4 encryption/decryption/pseudo-random number generator
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_RC4_H
22 | #define AVUTIL_RC4_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_rc4 RC4
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | typedef struct AVRC4 {
33 | uint8_t state[256];
34 | int x, y;
35 | } AVRC4;
36 |
37 | /**
38 | * Allocate an AVRC4 context.
39 | */
40 | AVRC4 *av_rc4_alloc(void);
41 |
42 | /**
43 | * @brief Initializes an AVRC4 context.
44 | *
45 | * @param d pointer to the AVRC4 context
46 | * @param key buffer containig the key
47 | * @param key_bits must be a multiple of 8
48 | * @param decrypt 0 for encryption, 1 for decryption, currently has no effect
49 | * @return zero on success, negative value otherwise
50 | */
51 | int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
52 |
53 | /**
54 | * @brief Encrypts / decrypts using the RC4 algorithm.
55 | *
56 | * @param d pointer to the AVRC4 context
57 | * @param count number of bytes
58 | * @param dst destination array, can be equal to src
59 | * @param src source array, can be equal to dst, may be NULL
60 | * @param iv not (yet) used for RC4, should be NULL
61 | * @param decrypt 0 for encryption, 1 for decryption, not (yet) used
62 | */
63 | void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
64 |
65 | /**
66 | * @}
67 | */
68 |
69 | #endif /* AVUTIL_RC4_H */
70 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/replaygain.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_REPLAYGAIN_H
20 | #define AVUTIL_REPLAYGAIN_H
21 |
22 | #include
23 |
24 | /**
25 | * ReplayGain information (see
26 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
27 | * The size of this struct is a part of the public ABI.
28 | */
29 | typedef struct AVReplayGain {
30 | /**
31 | * Track replay gain in microbels (divide by 100000 to get the value in dB).
32 | * Should be set to INT32_MIN when unknown.
33 | */
34 | int32_t track_gain;
35 | /**
36 | * Peak track amplitude, with 100000 representing full scale (but values
37 | * may overflow). 0 when unknown.
38 | */
39 | uint32_t track_peak;
40 | /**
41 | * Same as track_gain, but for the whole album.
42 | */
43 | int32_t album_gain;
44 | /**
45 | * Same as track_peak, but for the whole album,
46 | */
47 | uint32_t album_peak;
48 | } AVReplayGain;
49 |
50 | #endif /* AVUTIL_REPLAYGAIN_H */
51 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/ripemd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | /**
23 | * @file
24 | * @ingroup lavu_ripemd
25 | * Public header for RIPEMD hash function implementation.
26 | */
27 |
28 | #ifndef AVUTIL_RIPEMD_H
29 | #define AVUTIL_RIPEMD_H
30 |
31 | #include
32 | #include
33 |
34 | #include "attributes.h"
35 |
36 | /**
37 | * @defgroup lavu_ripemd RIPEMD
38 | * @ingroup lavu_hash
39 | * RIPEMD hash function implementation.
40 | *
41 | * @{
42 | */
43 |
44 | extern const int av_ripemd_size;
45 |
46 | struct AVRIPEMD;
47 |
48 | /**
49 | * Allocate an AVRIPEMD context.
50 | */
51 | struct AVRIPEMD *av_ripemd_alloc(void);
52 |
53 | /**
54 | * Initialize RIPEMD hashing.
55 | *
56 | * @param context pointer to the function context (of size av_ripemd_size)
57 | * @param bits number of bits in digest (128, 160, 256 or 320 bits)
58 | * @return zero if initialization succeeded, -1 otherwise
59 | */
60 | int av_ripemd_init(struct AVRIPEMD* context, int bits);
61 |
62 | /**
63 | * Update hash value.
64 | *
65 | * @param context hash function context
66 | * @param data input data to update hash with
67 | * @param len input data length
68 | */
69 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
70 |
71 | /**
72 | * Finish hashing and output digest value.
73 | *
74 | * @param context hash function context
75 | * @param digest buffer where output digest value is stored
76 | */
77 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest);
78 |
79 | /**
80 | * @}
81 | */
82 |
83 | #endif /* AVUTIL_RIPEMD_H */
84 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/sha.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_sha
24 | * Public header for SHA-1 & SHA-256 hash function implementations.
25 | */
26 |
27 | #ifndef AVUTIL_SHA_H
28 | #define AVUTIL_SHA_H
29 |
30 | #include
31 | #include
32 |
33 | #include "attributes.h"
34 |
35 | /**
36 | * @defgroup lavu_sha SHA
37 | * @ingroup lavu_hash
38 | * SHA-1 and SHA-256 (Secure Hash Algorithm) hash function implementations.
39 | *
40 | * This module supports the following SHA hash functions:
41 | *
42 | * - SHA-1: 160 bits
43 | * - SHA-224: 224 bits, as a variant of SHA-2
44 | * - SHA-256: 256 bits, as a variant of SHA-2
45 | *
46 | * @see For SHA-384, SHA-512, and variants thereof, see @ref lavu_sha512.
47 | *
48 | * @{
49 | */
50 |
51 | extern const int av_sha_size;
52 |
53 | struct AVSHA;
54 |
55 | /**
56 | * Allocate an AVSHA context.
57 | */
58 | struct AVSHA *av_sha_alloc(void);
59 |
60 | /**
61 | * Initialize SHA-1 or SHA-2 hashing.
62 | *
63 | * @param context pointer to the function context (of size av_sha_size)
64 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
65 | * @return zero if initialization succeeded, -1 otherwise
66 | */
67 | int av_sha_init(struct AVSHA* context, int bits);
68 |
69 | /**
70 | * Update hash value.
71 | *
72 | * @param ctx hash function context
73 | * @param data input data to update hash with
74 | * @param len input data length
75 | */
76 | void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len);
77 |
78 | /**
79 | * Finish hashing and output digest value.
80 | *
81 | * @param context hash function context
82 | * @param digest buffer where output digest value is stored
83 | */
84 | void av_sha_final(struct AVSHA* context, uint8_t *digest);
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | #endif /* AVUTIL_SHA_H */
91 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/sha512.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | /**
23 | * @file
24 | * @ingroup lavu_sha512
25 | * Public header for SHA-512 implementation.
26 | */
27 |
28 | #ifndef AVUTIL_SHA512_H
29 | #define AVUTIL_SHA512_H
30 |
31 | #include
32 | #include
33 |
34 | #include "attributes.h"
35 |
36 | /**
37 | * @defgroup lavu_sha512 SHA-512
38 | * @ingroup lavu_hash
39 | * SHA-512 (Secure Hash Algorithm) hash function implementations.
40 | *
41 | * This module supports the following SHA-2 hash functions:
42 | *
43 | * - SHA-512/224: 224 bits
44 | * - SHA-512/256: 256 bits
45 | * - SHA-384: 384 bits
46 | * - SHA-512: 512 bits
47 | *
48 | * @see For SHA-1, SHA-256, and variants thereof, see @ref lavu_sha.
49 | *
50 | * @{
51 | */
52 |
53 | extern const int av_sha512_size;
54 |
55 | struct AVSHA512;
56 |
57 | /**
58 | * Allocate an AVSHA512 context.
59 | */
60 | struct AVSHA512 *av_sha512_alloc(void);
61 |
62 | /**
63 | * Initialize SHA-2 512 hashing.
64 | *
65 | * @param context pointer to the function context (of size av_sha512_size)
66 | * @param bits number of bits in digest (224, 256, 384 or 512 bits)
67 | * @return zero if initialization succeeded, -1 otherwise
68 | */
69 | int av_sha512_init(struct AVSHA512* context, int bits);
70 |
71 | /**
72 | * Update hash value.
73 | *
74 | * @param context hash function context
75 | * @param data input data to update hash with
76 | * @param len input data length
77 | */
78 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len);
79 |
80 | /**
81 | * Finish hashing and output digest value.
82 | *
83 | * @param context hash function context
84 | * @param digest buffer where output digest value is stored
85 | */
86 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest);
87 |
88 | /**
89 | * @}
90 | */
91 |
92 | #endif /* AVUTIL_SHA512_H */
93 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/tea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the TEA algorithm
3 | * Copyright (c) 2015 Vesselin Bontchev
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_TEA_H
23 | #define AVUTIL_TEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @file
29 | * @brief Public header for libavutil TEA algorithm
30 | * @defgroup lavu_tea TEA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_tea_size;
36 |
37 | struct AVTEA;
38 |
39 | /**
40 | * Allocate an AVTEA context
41 | * To free the struct: av_free(ptr)
42 | */
43 | struct AVTEA *av_tea_alloc(void);
44 |
45 | /**
46 | * Initialize an AVTEA context.
47 | *
48 | * @param ctx an AVTEA context
49 | * @param key a key of 16 bytes used for encryption/decryption
50 | * @param rounds the number of rounds in TEA (64 is the "standard")
51 | */
52 | void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds);
53 |
54 | /**
55 | * Encrypt or decrypt a buffer using a previously initialized context.
56 | *
57 | * @param ctx an AVTEA context
58 | * @param dst destination array, can be equal to src
59 | * @param src source array, can be equal to dst
60 | * @param count number of 8 byte blocks
61 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
62 | * @param decrypt 0 for encryption, 1 for decryption
63 | */
64 | void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src,
65 | int count, uint8_t *iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 |
71 | #endif /* AVUTIL_TEA_H */
72 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/time.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2000-2003 Fabrice Bellard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_TIME_H
22 | #define AVUTIL_TIME_H
23 |
24 | #include
25 |
26 | /**
27 | * Get the current time in microseconds.
28 | */
29 | int64_t av_gettime(void);
30 |
31 | /**
32 | * Get the current time in microseconds since some unspecified starting point.
33 | * On platforms that support it, the time comes from a monotonic clock
34 | * This property makes this time source ideal for measuring relative time.
35 | * The returned values may not be monotonic on platforms where a monotonic
36 | * clock is not available.
37 | */
38 | int64_t av_gettime_relative(void);
39 |
40 | /**
41 | * Indicates with a boolean result if the av_gettime_relative() time source
42 | * is monotonic.
43 | */
44 | int av_gettime_relative_is_monotonic(void);
45 |
46 | /**
47 | * Sleep for a period of time. Although the duration is expressed in
48 | * microseconds, the actual delay may be rounded to the precision of the
49 | * system timer.
50 | *
51 | * @param usec Number of microseconds to sleep.
52 | * @return zero on success or (negative) error code.
53 | */
54 | int av_usleep(unsigned usec);
55 |
56 | #endif /* AVUTIL_TIME_H */
57 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/timestamp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * timestamp utils, mostly useful for debugging/logging purposes
22 | */
23 |
24 | #ifndef AVUTIL_TIMESTAMP_H
25 | #define AVUTIL_TIMESTAMP_H
26 |
27 | #include "avutil.h"
28 |
29 | #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
30 | #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
31 | #endif
32 |
33 | #define AV_TS_MAX_STRING_SIZE 32
34 |
35 | /**
36 | * Fill the provided buffer with a string containing a timestamp
37 | * representation.
38 | *
39 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
40 | * @param ts the timestamp to represent
41 | * @return the buffer in input
42 | */
43 | static inline char *av_ts_make_string(char *buf, int64_t ts)
44 | {
45 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
46 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%" PRId64, ts);
47 | return buf;
48 | }
49 |
50 | /**
51 | * Convenience macro, the return value should be used only directly in
52 | * function arguments but never stand-alone.
53 | */
54 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts)
55 |
56 | /**
57 | * Fill the provided buffer with a string containing a timestamp time
58 | * representation.
59 | *
60 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
61 | * @param ts the timestamp to represent
62 | * @param tb the timebase of the timestamp
63 | * @return the buffer in input
64 | */
65 | char *av_ts_make_time_string2(char *buf, int64_t ts, AVRational tb);
66 |
67 | /**
68 | * Fill the provided buffer with a string containing a timestamp
69 | * representation.
70 | *
71 | * @see av_ts_make_time_string2
72 | */
73 | static inline char *av_ts_make_time_string(char *buf, int64_t ts,
74 | const AVRational *tb)
75 | {
76 | return av_ts_make_time_string2(buf, ts, *tb);
77 | }
78 |
79 | /**
80 | * Convenience macro, the return value should be used only directly in
81 | * function arguments but never stand-alone.
82 | */
83 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
84 |
85 | #endif /* AVUTIL_TIMESTAMP_H */
86 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/twofish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the TwoFish algorithm
3 | * Copyright (c) 2015 Supraja Meedinti
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_TWOFISH_H
23 | #define AVUTIL_TWOFISH_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil TWOFISH algorithm
31 | * @defgroup lavu_twofish TWOFISH
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_twofish_size;
37 |
38 | struct AVTWOFISH;
39 |
40 | /**
41 | * Allocate an AVTWOFISH context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVTWOFISH *av_twofish_alloc(void);
45 |
46 | /**
47 | * Initialize an AVTWOFISH context.
48 | *
49 | * @param ctx an AVTWOFISH context
50 | * @param key a key of size ranging from 1 to 32 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise
52 | */
53 | int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context
57 | *
58 | * @param ctx an AVTWOFISH context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 16 byte blocks
62 | * @param iv initialization vector for CBC mode, NULL for ECB mode
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 | #endif /* AVUTIL_TWOFISH_H */
71 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libavutil/xtea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the XTEA algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_XTEA_H
23 | #define AVUTIL_XTEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @file
29 | * @brief Public header for libavutil XTEA algorithm
30 | * @defgroup lavu_xtea XTEA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | typedef struct AVXTEA {
36 | uint32_t key[16];
37 | } AVXTEA;
38 |
39 | /**
40 | * Allocate an AVXTEA context.
41 | */
42 | AVXTEA *av_xtea_alloc(void);
43 |
44 | /**
45 | * Initialize an AVXTEA context.
46 | *
47 | * @param ctx an AVXTEA context
48 | * @param key a key of 16 bytes used for encryption/decryption,
49 | * interpreted as big endian 32 bit numbers
50 | */
51 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
52 |
53 | /**
54 | * Initialize an AVXTEA context.
55 | *
56 | * @param ctx an AVXTEA context
57 | * @param key a key of 16 bytes used for encryption/decryption,
58 | * interpreted as little endian 32 bit numbers
59 | */
60 | void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]);
61 |
62 | /**
63 | * Encrypt or decrypt a buffer using a previously initialized context,
64 | * in big endian format.
65 | *
66 | * @param ctx an AVXTEA context
67 | * @param dst destination array, can be equal to src
68 | * @param src source array, can be equal to dst
69 | * @param count number of 8 byte blocks
70 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
71 | * @param decrypt 0 for encryption, 1 for decryption
72 | */
73 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
74 | int count, uint8_t *iv, int decrypt);
75 |
76 | /**
77 | * Encrypt or decrypt a buffer using a previously initialized context,
78 | * in little endian format.
79 | *
80 | * @param ctx an AVXTEA context
81 | * @param dst destination array, can be equal to src
82 | * @param src source array, can be equal to dst
83 | * @param count number of 8 byte blocks
84 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
85 | * @param decrypt 0 for encryption, 1 for decryption
86 | */
87 | void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
88 | int count, uint8_t *iv, int decrypt);
89 |
90 | /**
91 | * @}
92 | */
93 |
94 | #endif /* AVUTIL_XTEA_H */
95 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libpostproc/postprocess.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef POSTPROC_POSTPROCESS_H
22 | #define POSTPROC_POSTPROCESS_H
23 |
24 | /**
25 | * @file
26 | * @ingroup lpp
27 | * external API header
28 | */
29 |
30 | /**
31 | * @defgroup lpp libpostproc
32 | * Video postprocessing library.
33 | *
34 | * @{
35 | */
36 |
37 | #include "libpostproc/version_major.h"
38 | #ifndef HAVE_AV_CONFIG_H
39 | /* When included as part of the ffmpeg build, only include the major version
40 | * to avoid unnecessary rebuilds. When included externally, keep including
41 | * the full version information. */
42 | #include "libpostproc/version.h"
43 | #endif
44 |
45 | /**
46 | * Return the LIBPOSTPROC_VERSION_INT constant.
47 | */
48 | unsigned postproc_version(void);
49 |
50 | /**
51 | * Return the libpostproc build-time configuration.
52 | */
53 | const char *postproc_configuration(void);
54 |
55 | /**
56 | * Return the libpostproc license.
57 | */
58 | const char *postproc_license(void);
59 |
60 | #define PP_QUALITY_MAX 6
61 |
62 | #include
63 |
64 | typedef void pp_context;
65 | typedef void pp_mode;
66 |
67 | extern const char pp_help[]; ///< a simple help text
68 |
69 | void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
70 | uint8_t * dst[3], const int dstStride[3],
71 | int horizontalSize, int verticalSize,
72 | const int8_t *QP_store, int QP_stride,
73 | pp_mode *mode, pp_context *ppContext, int pict_type);
74 |
75 |
76 | /**
77 | * Return a pp_mode or NULL if an error occurred.
78 | *
79 | * @param name the string after "-pp" on the command line
80 | * @param quality a number from 0 to PP_QUALITY_MAX
81 | */
82 | pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality);
83 | void pp_free_mode(pp_mode *mode);
84 |
85 | pp_context *pp_get_context(int width, int height, int flags);
86 | void pp_free_context(pp_context *ppContext);
87 |
88 | #define PP_CPU_CAPS_MMX 0x80000000
89 | #define PP_CPU_CAPS_MMX2 0x20000000
90 | #define PP_CPU_CAPS_3DNOW 0x40000000
91 | #define PP_CPU_CAPS_ALTIVEC 0x10000000
92 | #define PP_CPU_CAPS_AUTO 0x00080000
93 |
94 | #define PP_FORMAT 0x00000008
95 | #define PP_FORMAT_420 (0x00000011|PP_FORMAT)
96 | #define PP_FORMAT_422 (0x00000001|PP_FORMAT)
97 | #define PP_FORMAT_411 (0x00000002|PP_FORMAT)
98 | #define PP_FORMAT_444 (0x00000000|PP_FORMAT)
99 | #define PP_FORMAT_440 (0x00000010|PP_FORMAT)
100 |
101 | #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale
102 |
103 | /**
104 | * @}
105 | */
106 |
107 | #endif /* POSTPROC_POSTPROCESS_H */
108 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libpostproc/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef POSTPROC_VERSION_H
22 | #define POSTPROC_VERSION_H
23 |
24 | /**
25 | * @file
26 | * Libpostproc version macros
27 | */
28 |
29 | #include "libavutil/version.h"
30 |
31 | #include "version_major.h"
32 |
33 | #define LIBPOSTPROC_VERSION_MINOR 3
34 | #define LIBPOSTPROC_VERSION_MICRO 100
35 |
36 | #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
37 | LIBPOSTPROC_VERSION_MINOR, \
38 | LIBPOSTPROC_VERSION_MICRO)
39 | #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
40 | LIBPOSTPROC_VERSION_MINOR, \
41 | LIBPOSTPROC_VERSION_MICRO)
42 | #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT
43 |
44 | #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
45 |
46 | #endif /* POSTPROC_VERSION_H */
47 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libpostproc/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef POSTPROC_VERSION_MAJOR_H
22 | #define POSTPROC_VERSION_MAJOR_H
23 |
24 | /**
25 | * @file
26 | * Libpostproc version macros
27 | */
28 |
29 | #define LIBPOSTPROC_VERSION_MAJOR 58
30 |
31 | #endif /* POSTPROC_VERSION_MAJOR_H */
32 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libswresample/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of libswresample
5 | *
6 | * libswresample is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * libswresample is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with libswresample; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef SWRESAMPLE_VERSION_H
22 | #define SWRESAMPLE_VERSION_H
23 |
24 | /**
25 | * @file
26 | * Libswresample version macros
27 | */
28 |
29 | #include "libavutil/version.h"
30 |
31 | #include "version_major.h"
32 |
33 | #define LIBSWRESAMPLE_VERSION_MINOR 3
34 | #define LIBSWRESAMPLE_VERSION_MICRO 100
35 |
36 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
37 | LIBSWRESAMPLE_VERSION_MINOR, \
38 | LIBSWRESAMPLE_VERSION_MICRO)
39 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
40 | LIBSWRESAMPLE_VERSION_MINOR, \
41 | LIBSWRESAMPLE_VERSION_MICRO)
42 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT
43 |
44 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
45 |
46 | #endif /* SWRESAMPLE_VERSION_H */
47 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libswresample/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of libswresample
5 | *
6 | * libswresample is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * libswresample is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with libswresample; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef SWRESAMPLE_VERSION_MAJOR_H
22 | #define SWRESAMPLE_VERSION_MAJOR_H
23 |
24 | /**
25 | * @file
26 | * Libswresample version macros
27 | */
28 |
29 | #define LIBSWRESAMPLE_VERSION_MAJOR 5
30 |
31 | #endif /* SWRESAMPLE_VERSION_MAJOR_H */
32 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libswscale/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef SWSCALE_VERSION_H
20 | #define SWSCALE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * swscale version macros
25 | */
26 |
27 | #include "libavutil/version.h"
28 |
29 | #include "version_major.h"
30 |
31 | #define LIBSWSCALE_VERSION_MINOR 3
32 | #define LIBSWSCALE_VERSION_MICRO 100
33 |
34 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
35 | LIBSWSCALE_VERSION_MINOR, \
36 | LIBSWSCALE_VERSION_MICRO)
37 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
38 | LIBSWSCALE_VERSION_MINOR, \
39 | LIBSWSCALE_VERSION_MICRO)
40 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
41 |
42 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
43 |
44 | #endif /* SWSCALE_VERSION_H */
45 |
--------------------------------------------------------------------------------
/libs/ffmpeg/libswscale/version_major.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef SWSCALE_VERSION_MAJOR_H
20 | #define SWSCALE_VERSION_MAJOR_H
21 |
22 | /**
23 | * @file
24 | * swscale version macros
25 | */
26 |
27 | #define LIBSWSCALE_VERSION_MAJOR 8
28 |
29 | /**
30 | * FF_API_* defines may be placed below to indicate public API that will be
31 | * dropped at a future version bump. The defines themselves are not part of
32 | * the public API and may change, break or disappear at any time.
33 | */
34 |
35 | #endif /* SWSCALE_VERSION_MAJOR_H */
36 |
--------------------------------------------------------------------------------
/libs/ffmpeg/x264/x264_config.h:
--------------------------------------------------------------------------------
1 | #define X264_GPL 1
2 | #define X264_INTERLACED 1
3 | #define X264_BIT_DEPTH 0
4 | #define X264_CHROMA_FORMAT 0
5 | #define X264_VERSION ""
6 | #define X264_POINTVER "0.164.x"
7 |
--------------------------------------------------------------------------------
/libs/imgui/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.21)
2 |
3 | add_library(imgui STATIC
4 | imgui.cpp
5 | imgui_demo.cpp
6 | imgui_draw.cpp
7 | imgui_tables.cpp
8 | imgui_widgets.cpp
9 | imgui_stdlib.cpp
10 | )
11 |
12 | target_include_directories(imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
--------------------------------------------------------------------------------
/libs/imgui/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2024 Omar Cornut
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/libs/imgui/imgui_impl_win32.h:
--------------------------------------------------------------------------------
1 | // dear imgui: Platform Backend for Windows (standard windows API for 32-bits AND 64-bits applications)
2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)
3 |
4 | // Implemented features:
5 | // [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui)
6 | // [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
7 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy VK_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
8 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
10 |
11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
13 | // Learn about Dear ImGui:
14 | // - FAQ https://dearimgui.com/faq
15 | // - Getting Started https://dearimgui.com/getting-started
16 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
17 | // - Introduction, links and more at the top of imgui.cpp
18 |
19 | #pragma once
20 | #include "imgui.h" // IMGUI_IMPL_API
21 | #ifndef IMGUI_DISABLE
22 |
23 | IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd);
24 | IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd);
25 | IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown();
26 | IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame();
27 |
28 | // Win32 message handler your application need to call.
29 | // - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on from this helper.
30 | // - You should COPY the line below into your .cpp code to forward declare the function and then you can call it.
31 | // - Call from your application's message handler. Keep calling your message handler unless this function returns TRUE.
32 |
33 | #if 0
34 | extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
35 | #endif
36 |
37 | // DPI-related helpers (optional)
38 | // - Use to enable DPI awareness without having to create an application manifest.
39 | // - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps.
40 | // - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc.
41 | // but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime,
42 | // neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies.
43 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness();
44 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd
45 | IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor
46 |
47 | // Transparency related helpers (optional) [experimental]
48 | // - Use to enable alpha compositing transparency with the desktop.
49 | // - Use together with e.g. clearing your framebuffer with zero-alpha.
50 | IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd); // HWND hwnd
51 |
52 | #endif // #ifndef IMGUI_DISABLE
53 |
--------------------------------------------------------------------------------
/libs/imgui/imgui_stdlib.cpp:
--------------------------------------------------------------------------------
1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.)
2 | // This is also an example of how you may wrap your own similar types.
3 |
4 | // Changelog:
5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string
6 |
7 | // See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki:
8 | // https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness
9 |
10 | #include "imgui.h"
11 | #include "imgui_stdlib.h"
12 |
13 | // Clang warnings with -Weverything
14 | #if defined(__clang__)
15 | #pragma clang diagnostic push
16 | #pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
17 | #endif
18 |
19 | struct InputTextCallback_UserData
20 | {
21 | std::string* Str;
22 | ImGuiInputTextCallback ChainCallback;
23 | void* ChainCallbackUserData;
24 | };
25 |
26 | static int InputTextCallback(ImGuiInputTextCallbackData* data)
27 | {
28 | InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData;
29 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize)
30 | {
31 | // Resize string callback
32 | // If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want.
33 | std::string* str = user_data->Str;
34 | IM_ASSERT(data->Buf == str->c_str());
35 | str->resize(data->BufTextLen);
36 | data->Buf = (char*)str->c_str();
37 | }
38 | else if (user_data->ChainCallback)
39 | {
40 | // Forward to user callback, if any
41 | data->UserData = user_data->ChainCallbackUserData;
42 | return user_data->ChainCallback(data);
43 | }
44 | return 0;
45 | }
46 |
47 | bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
48 | {
49 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
50 | flags |= ImGuiInputTextFlags_CallbackResize;
51 |
52 | InputTextCallback_UserData cb_user_data;
53 | cb_user_data.Str = str;
54 | cb_user_data.ChainCallback = callback;
55 | cb_user_data.ChainCallbackUserData = user_data;
56 | return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
57 | }
58 |
59 | bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
60 | {
61 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
62 | flags |= ImGuiInputTextFlags_CallbackResize;
63 |
64 | InputTextCallback_UserData cb_user_data;
65 | cb_user_data.Str = str;
66 | cb_user_data.ChainCallback = callback;
67 | cb_user_data.ChainCallbackUserData = user_data;
68 | return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data);
69 | }
70 |
71 | bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
72 | {
73 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
74 | flags |= ImGuiInputTextFlags_CallbackResize;
75 |
76 | InputTextCallback_UserData cb_user_data;
77 | cb_user_data.Str = str;
78 | cb_user_data.ChainCallback = callback;
79 | cb_user_data.ChainCallbackUserData = user_data;
80 | return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data);
81 | }
82 |
83 | #if defined(__clang__)
84 | #pragma clang diagnostic pop
85 | #endif
86 |
--------------------------------------------------------------------------------
/libs/imgui/imgui_stdlib.h:
--------------------------------------------------------------------------------
1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.)
2 | // This is also an example of how you may wrap your own similar types.
3 |
4 | // Changelog:
5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string
6 |
7 | // See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki:
8 | // https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness
9 |
10 | #pragma once
11 |
12 | #include
13 |
14 | namespace ImGui
15 | {
16 | // ImGui::InputText() with std::string
17 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity
18 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);
19 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);
20 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr);
21 | }
22 |
--------------------------------------------------------------------------------
/libs/qoi/.gitignore:
--------------------------------------------------------------------------------
1 | images/
2 | stb_image.h
3 | stb_image_write.h
4 | qoibench
5 | qoiconv
6 |
--------------------------------------------------------------------------------
/libs/qoi/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Dominic Szablewski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/libs/qoi/Makefile:
--------------------------------------------------------------------------------
1 | CC ?= gcc
2 | CFLAGS_BENCH ?= -std=gnu99 -O3
3 | LFLAGS_BENCH ?= -lpng $(LDFLAGS)
4 | CFLAGS_CONV ?= -std=c99 -O3
5 | LFLAGS_CONV ?= $(LDFLAGS)
6 |
7 | TARGET_BENCH ?= qoibench
8 | TARGET_CONV ?= qoiconv
9 |
10 | all: $(TARGET_BENCH) $(TARGET_CONV)
11 |
12 | bench: $(TARGET_BENCH)
13 | $(TARGET_BENCH):$(TARGET_BENCH).c qoi.h
14 | $(CC) $(CFLAGS_BENCH) $(CFLAGS) $(TARGET_BENCH).c -o $(TARGET_BENCH) $(LFLAGS_BENCH)
15 |
16 | conv: $(TARGET_CONV)
17 | $(TARGET_CONV):$(TARGET_CONV).c qoi.h
18 | $(CC) $(CFLAGS_CONV) $(CFLAGS) $(TARGET_CONV).c -o $(TARGET_CONV) $(LFLAGS_CONV)
19 |
20 | .PHONY: clean
21 | clean:
22 | $(RM) $(TARGET_BENCH) $(TARGET_CONV)
23 |
--------------------------------------------------------------------------------
/libs/qoi/qoiconv.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Copyright (c) 2021, Dominic Szablewski - https://phoboslab.org
4 | SPDX-License-Identifier: MIT
5 |
6 |
7 | Command line tool to convert between png <> qoi format
8 |
9 | Requires:
10 | -"stb_image.h" (https://github.com/nothings/stb/blob/master/stb_image.h)
11 | -"stb_image_write.h" (https://github.com/nothings/stb/blob/master/stb_image_write.h)
12 | -"qoi.h" (https://github.com/phoboslab/qoi/blob/master/qoi.h)
13 |
14 | Compile with:
15 | gcc qoiconv.c -std=c99 -O3 -o qoiconv
16 |
17 | */
18 |
19 |
20 | #define STB_IMAGE_IMPLEMENTATION
21 | #define STBI_ONLY_PNG
22 | #define STBI_NO_LINEAR
23 | #include "stb_image.h"
24 |
25 | #define STB_IMAGE_WRITE_IMPLEMENTATION
26 | #include "stb_image_write.h"
27 |
28 | #define QOI_IMPLEMENTATION
29 | #include "qoi.h"
30 |
31 |
32 | #define STR_ENDS_WITH(S, E) (strcmp(S + strlen(S) - (sizeof(E)-1), E) == 0)
33 |
34 | int main(int argc, char **argv) {
35 | if (argc < 3) {
36 | puts("Usage: qoiconv ");
37 | puts("Examples:");
38 | puts(" qoiconv input.png output.qoi");
39 | puts(" qoiconv input.qoi output.png");
40 | exit(1);
41 | }
42 |
43 | void *pixels = NULL;
44 | int w, h, channels;
45 | if (STR_ENDS_WITH(argv[1], ".png")) {
46 | if(!stbi_info(argv[1], &w, &h, &channels)) {
47 | printf("Couldn't read header %s\n", argv[1]);
48 | exit(1);
49 | }
50 |
51 | // Force all odd encodings to be RGBA
52 | if(channels != 3) {
53 | channels = 4;
54 | }
55 |
56 | pixels = (void *)stbi_load(argv[1], &w, &h, NULL, channels);
57 | }
58 | else if (STR_ENDS_WITH(argv[1], ".qoi")) {
59 | qoi_desc desc;
60 | pixels = qoi_read(argv[1], &desc, 0);
61 | channels = desc.channels;
62 | w = desc.width;
63 | h = desc.height;
64 | }
65 |
66 | if (pixels == NULL) {
67 | printf("Couldn't load/decode %s\n", argv[1]);
68 | exit(1);
69 | }
70 |
71 | int encoded = 0;
72 | if (STR_ENDS_WITH(argv[2], ".png")) {
73 | encoded = stbi_write_png(argv[2], w, h, channels, pixels, 0);
74 | }
75 | else if (STR_ENDS_WITH(argv[2], ".qoi")) {
76 | encoded = qoi_write(argv[2], pixels, &(qoi_desc){
77 | .width = w,
78 | .height = h,
79 | .channels = channels,
80 | .colorspace = QOI_SRGB
81 | });
82 | }
83 |
84 | if (!encoded) {
85 | printf("Couldn't write/encode %s\n", argv[2]);
86 | exit(1);
87 | }
88 |
89 | free(pixels);
90 | return 0;
91 | }
92 |
--------------------------------------------------------------------------------
/libs/qoi/qoifuzz.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Copyright (c) 2021, Dominic Szablewski - https://phoboslab.org
4 | SPDX-License-Identifier: MIT
5 |
6 |
7 | clang fuzzing harness for qoi_decode
8 |
9 | Compile and run with:
10 | clang -fsanitize=address,fuzzer -g -O0 qoifuzz.c && ./a.out
11 |
12 | */
13 |
14 |
15 | #define QOI_IMPLEMENTATION
16 | #include "qoi.h"
17 | #include
18 | #include
19 |
20 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
21 | int w, h;
22 | if (size < 4) {
23 | return 0;
24 | }
25 |
26 | qoi_desc desc;
27 | void* decoded = qoi_decode((void*)(data + 4), (int)(size - 4), &desc, *((int *)data));
28 | if (decoded != NULL) {
29 | free(decoded);
30 | }
31 | return 0;
32 | }
33 |
--------------------------------------------------------------------------------
/libs/subprocess.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | namespace subprocess {
6 |
7 | struct PipeHandle {
8 | HANDLE handle = nullptr;
9 |
10 | void set_inherit(bool value) {
11 | if (handle) {
12 | SetHandleInformation(handle, HANDLE_FLAG_INHERIT, value * HANDLE_FLAG_INHERIT);
13 | }
14 | }
15 |
16 | void close() {
17 | if (handle) {
18 | CloseHandle(handle);
19 | handle = nullptr;
20 | }
21 | }
22 | };
23 |
24 | struct PipePair {
25 | PipeHandle m_read;
26 | PipeHandle m_write;
27 |
28 | static PipePair create(bool inheritable) {
29 | SECURITY_ATTRIBUTES security = {};
30 | security.nLength = sizeof(security);
31 | security.bInheritHandle = inheritable;
32 | HANDLE read, write;
33 | CreatePipe(&read, &write, &security, 0);
34 | return { { read }, { write } };
35 | }
36 |
37 | void write(const void* const data, size_t size) {
38 | WriteFile(m_write.handle, data, size, nullptr, nullptr);
39 | }
40 |
41 | void close() {
42 | m_read.close();
43 | m_write.close();
44 | }
45 | };
46 |
47 | class Popen {
48 | public:
49 | PipePair m_stdin;
50 | PROCESS_INFORMATION m_proc_info{};
51 | public:
52 | Popen() {}
53 | Popen(const std::string& command) {
54 | STARTUPINFOW start_info = {};
55 |
56 | start_info.cb = sizeof(start_info);
57 | start_info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
58 | start_info.hStdError = GetStdHandle(STD_ERROR_HANDLE);
59 | start_info.dwFlags |= STARTF_USESTDHANDLES;
60 |
61 | m_stdin = PipePair::create(true);
62 | start_info.hStdInput = m_stdin.m_read.handle;
63 | m_stdin.m_write.set_inherit(false);
64 |
65 | auto size = MultiByteToWideChar(CP_UTF8, 0, command.c_str(), -1, nullptr, 0);
66 | auto buffer = new wchar_t[size];
67 | MultiByteToWideChar(CP_UTF8, 0, command.c_str(), -1, buffer, size);
68 |
69 | CreateProcessW(nullptr, buffer, nullptr, nullptr, true, 0, nullptr, nullptr, &start_info, &m_proc_info);
70 |
71 | delete[] buffer;
72 |
73 | m_stdin.m_read.close();
74 | }
75 |
76 | int wait() {
77 | WaitForSingleObject(m_proc_info.hProcess, INFINITE);
78 | DWORD exit_code;
79 | GetExitCodeProcess(m_proc_info.hProcess, &exit_code);
80 | return exit_code;
81 | }
82 |
83 | int close(bool should_wait = true) {
84 | int exit_code = 0;
85 | m_stdin.close();
86 | if (should_wait) exit_code = wait();
87 | CloseHandle(m_proc_info.hProcess);
88 | CloseHandle(m_proc_info.hThread);
89 | return exit_code;
90 | }
91 | };
92 | }
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TobyAdd/GDH/c692d400a560374132f0c935921dc2200dfb479e/logo.png
--------------------------------------------------------------------------------
/mod.json:
--------------------------------------------------------------------------------
1 | {
2 | "geode": "4.6.3",
3 | "gd": {
4 | "win": "2.2074",
5 | "android": "2.2074",
6 | "mac": "2.2074",
7 | "ios": "2.2074"
8 | },
9 | "id": "tobyadd.gdh",
10 | "name": "GDH",
11 | "version": "v5.0.0-beta.8",
12 | "developer": "TobyAdd",
13 | "description": "GDH is an open-source Geometry Dash mod menu that aims to improve the game's performance and add new features",
14 | "early-load": true,
15 | "resources": {
16 | "sprites": [
17 | "res/*.png"
18 | ]
19 | },
20 | "settings": {
21 | "legacy-render": {
22 | "name": "Legacy Render",
23 | "description": "Possibly fix menu rendering issues on older devices",
24 | "type": "bool",
25 | "default": false,
26 | "requires-restart": true
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/res/GDH_buttonInvisible.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TobyAdd/GDH/c692d400a560374132f0c935921dc2200dfb479e/res/GDH_buttonInvisible.png
--------------------------------------------------------------------------------
/res/GDH_buttonUI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TobyAdd/GDH/c692d400a560374132f0c935921dc2200dfb479e/res/GDH_buttonUI.png
--------------------------------------------------------------------------------
/res/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TobyAdd/GDH/c692d400a560374132f0c935921dc2200dfb479e/res/github.png
--------------------------------------------------------------------------------
/src/flvc.hpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #define QOI_IMPLEMENTATION
5 | #include
6 |
7 | class FLVCEncoder {
8 | public:
9 | FLVCEncoder(uint16_t width, uint16_t height, uint16_t fps, const std::filesystem::path& outputFilePath)
10 | : width(width), height(height), fps(fps), frameSize(width * height * 3), frameCount(0), outputFilePath(outputFilePath) {
11 | outputFile.open(outputFilePath, std::ios::binary);
12 | if (!outputFile.is_open()) {
13 | return;
14 | }
15 |
16 | writeHeader();
17 | }
18 |
19 | void close() {
20 | if (outputFile.is_open()) {
21 | updateHeader();
22 | outputFile.close();
23 | }
24 | }
25 |
26 | bool writeFrame(const std::vector& frameData) {
27 | if (frameData.size() != frameSize || !outputFile.is_open()) {
28 | return false;
29 | }
30 |
31 | qoi_desc desc = {width, height, 3, QOI_SRGB};
32 |
33 | int qoiSize;
34 | void* qoiData = qoi_encode(frameData.data(), &desc, &qoiSize);
35 | if (!qoiData) {
36 | return false;
37 | }
38 |
39 | outputFile.write(reinterpret_cast(&qoiSize), sizeof(qoiSize));
40 | outputFile.write(reinterpret_cast(qoiData), qoiSize);
41 |
42 | free(qoiData);
43 |
44 | if (!outputFile) {
45 | return false;
46 | }
47 |
48 | frameCount++;
49 | return true;
50 | }
51 | private:
52 | uint16_t width;
53 | uint16_t height;
54 | uint16_t fps;
55 | size_t frameSize;
56 | size_t frameCount;
57 | std::filesystem::path outputFilePath;
58 | std::ofstream outputFile;
59 |
60 | void writeHeader() {
61 | outputFile.write(reinterpret_cast(&width), sizeof(width));
62 | outputFile.write(reinterpret_cast(&height), sizeof(height));
63 | outputFile.write(reinterpret_cast(&fps), sizeof(fps));
64 | size_t placeholderFrameCount = 0;
65 | outputFile.write(reinterpret_cast(&placeholderFrameCount), sizeof(placeholderFrameCount));
66 | }
67 |
68 | void updateHeader() {
69 | outputFile.seekp(sizeof(width) + sizeof(height) + sizeof(fps), std::ios::beg);
70 | outputFile.write(reinterpret_cast(&frameCount), sizeof(frameCount));
71 | }
72 | };
--------------------------------------------------------------------------------
/src/gui_mobile.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | class HacksTab : public cocos2d::CCMenu {
5 | public:
6 | static HacksTab* create();
7 | void addToggle(const std::string& text, const std::string& desc, bool enabled, const std::function& callback, std::function handlerCustomWindow = nullptr);
8 | float x_lastToggle;
9 | float y_lastToggle;
10 |
11 | geode::prelude::ScrollLayer* m_scrollLayer;
12 | private:
13 | HacksTab() = default;
14 |
15 | bool init();
16 | void onToggle(cocos2d::CCObject* sender);
17 |
18 | protected:
19 | std::map> m_togglerCallbacks;
20 | };
21 |
22 | class HacksLayer : public geode::Popup<> {
23 | private:
24 | std::vector m_buttonTabs;
25 | std::vector m_tabs;
26 | int m_index = 0;
27 |
28 | CCMenuItemToggler* record_toggle;
29 | CCMenuItemToggler* play_toggle;
30 | public:
31 | static HacksLayer* create();
32 |
33 | void switchTab(int newIndex);
34 | bool setup();
35 | void onExit();
36 | };
37 |
38 | class ReplaySelectLayer : public geode::Popup<> {
39 | private:
40 | geode::TextInput* input;
41 | public:
42 | static ReplaySelectLayer* create(geode::TextInput* textInput);
43 | bool setup();
44 | };
45 |
46 | class RecorderLayer : public geode::Popup<> {
47 | public:
48 | static RecorderLayer* create();
49 | bool setup();
50 | };
51 |
52 | class RecorderAudioLayer : public geode::Popup<> {
53 | public:
54 | static RecorderAudioLayer* create();
55 | bool setup();
56 | };
--------------------------------------------------------------------------------
/src/hacks.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 |
5 | enum cheat_state
6 | {
7 | safe_mode,
8 | unwanted,
9 | cheating,
10 | legit
11 | };
12 |
13 | struct hack {
14 | std::string name;
15 | std::string desc;
16 | std::string config;
17 | std::string game_var;
18 |
19 | std::function handlerFunc = nullptr;
20 | void setHandler(std::function func) { handlerFunc = func; }
21 |
22 | std::function handlerCustomWindow = nullptr;
23 | void setCustomWindowHandler(std::function func) { handlerCustomWindow = func; }
24 |
25 | int keybind = 0;
26 | };
27 |
28 | struct window {
29 | std::string name;
30 | float x, y;
31 | float w, h;
32 | std::vector hacks;
33 |
34 | float orig_x, orig_y;
35 | float orig_w, orig_h;
36 | };
37 |
38 | class Hacks {
39 | public:
40 | static Hacks& get() {
41 | static Hacks instance;
42 | return instance;
43 | }
44 |
45 | Hacks& operator=(const Hacks&) = delete;
46 | Hacks(const Hacks&) = delete;
47 |
48 | PauseLayer* pauseLayer;
49 |
50 | std::vector m_windows;
51 | void Init();
52 |
53 | void saveKeybinds();
54 | void loadKeybinds();
55 | void toggleKeybinds(int key);
56 |
57 | cheat_state preCheatState = cheat_state::legit;
58 | cheat_state cheatState = cheat_state::legit;
59 | cheat_state cheatingCheck();
60 | std::string getCheatModulesAndState();
61 | private:
62 | Hacks() = default;
63 |
64 | bool SetHandlerByConfig(const std::string& configName, std::function handler) {
65 | for (auto& window : m_windows) {
66 | auto it = std::find_if(window.hacks.begin(), window.hacks.end(), [&](const hack& h) {
67 | return h.config == configName;
68 | });
69 |
70 | if (it != window.hacks.end()) {
71 | it->setHandler(handler);
72 | return true;
73 | }
74 | }
75 | return false;
76 | }
77 |
78 | bool SetCustomWindowHandlerByConfig(const std::string& configName, std::function handler) {
79 | for (auto& window : m_windows) {
80 | auto it = std::find_if(window.hacks.begin(), window.hacks.end(), [&](const hack& h) {
81 | return h.config == configName;
82 | });
83 |
84 | if (it != window.hacks.end()) {
85 | it->setCustomWindowHandler(handler);
86 | return true;
87 | }
88 | }
89 | return false;
90 | }
91 | };
--------------------------------------------------------------------------------
/src/hooks.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace hooksH {
4 | extern float color_dt;
5 | extern int selectedStartpos;
6 | extern std::vector startPositions;
7 | void switchStartPos(int incBy, bool direction = true);
8 | bool startposExist();
9 | }
10 |
--------------------------------------------------------------------------------
/src/keyMapping.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 |
6 | namespace KeyMappingUtils {
7 | struct KeyMapping {
8 | int glfwKey;
9 | int winApiKey;
10 | std::string name;
11 | };
12 |
13 | std::string GetNameFromGLFW(int glfwKey);
14 | std::string GetNameFromWinAPI(int winApiKey);
15 | int GetGLFWFromWinAPI(int winApiKey);
16 | int GetWinAPIFromGLFW(int glfwKey);
17 | const KeyMapping* GetMappingFromGLFW(int glfwKey);
18 | const KeyMapping* GetMappingFromWinAPI(int winApiKey);
19 | const std::vector& GetKeyMappings();
20 | }
--------------------------------------------------------------------------------
/src/memory.cpp:
--------------------------------------------------------------------------------
1 | #include "memory.hpp"
2 |
3 | struct PatternByte {
4 | bool isWildcard;
5 | uint8_t value;
6 | };
7 |
8 | uintptr_t memory::PatternScan(uintptr_t base, uintptr_t scanSize, const std::string signature) {
9 | std::vector patternData;
10 |
11 | for (size_t i = 0; i < signature.size(); ++i) {
12 | if (signature[i] == ' ') {
13 | continue;
14 | }
15 |
16 | if (signature[i] == '?') {
17 | patternData.push_back({ true, 0 });
18 | }
19 | else {
20 | std::string byteStr = signature.substr(i, 2);
21 | patternData.push_back({ false, static_cast(std::stoul(byteStr, nullptr, 16)) });
22 | i++;
23 | }
24 | }
25 |
26 | for (uintptr_t i = base; /*i < base + scanSize*/; ++i) {
27 | bool found = true;
28 |
29 | for (size_t j = 0; j < patternData.size(); ++j) {
30 | if (patternData[j].isWildcard) {
31 | continue;
32 | }
33 |
34 | if (patternData[j].value != *reinterpret_cast(i + j)) {
35 | found = false;
36 | break;
37 | }
38 | }
39 |
40 | if (found) {
41 | return i;
42 | }
43 | }
44 |
45 | return 0;
46 | }
--------------------------------------------------------------------------------
/src/memory.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | namespace memory {
8 | uintptr_t PatternScan(uintptr_t base, uintptr_t scanSize, const std::string signature);
9 | }
--------------------------------------------------------------------------------
/src/popupSystem.cpp:
--------------------------------------------------------------------------------
1 | #include "popupSystem.hpp"
2 | #include "utils.hpp"
3 |
4 | using namespace geode::prelude;
5 |
6 | bool popupSystem::setup() {
7 | this->setTitle("More Settings");
8 |
9 | return true;
10 | }
11 |
12 | popupSystem* popupSystem::create() {
13 | auto ret = new popupSystem();
14 | if (ret->initAnchored(300.f, 200.f, "GJ_square01.png")) {
15 | ret->autorelease();
16 | return ret;
17 | }
18 |
19 | delete ret;
20 | return nullptr;
21 | }
22 |
23 | void popupSystem::onExit() {
24 | geode::Popup<>::onExit();
25 | }
26 |
27 | void popupSystem::AddText(std::string text, float scale, float y_space) {
28 | auto label = cocos2d::CCLabelBMFont::create(text.c_str(), "bigFont.fnt");
29 | label->setAnchorPoint({0.f, 0.5f});
30 | label->setScale(scale);
31 | label->setPosition({10, currentY});
32 | m_mainLayer->addChild(label);
33 |
34 | currentY -= y_space;
35 | }
36 |
37 | void popupSystem::AddIntInput(std::string hint, int value, std::function callback, float y_space) {
38 | auto input = TextInput::create(285, hint, "chatFont.fnt");
39 | input->setPosition({150.f, currentY});
40 | input->setString(fmt::format("{}", value));
41 | input->setFilter("1234567890");
42 | input->setCallback([callback](const std::string& text) {
43 | if (utilsH::isNumeric(text))
44 | callback(std::stoi(text));
45 | });
46 |
47 | m_mainLayer->addChild(input);
48 |
49 | currentY -= y_space;
50 | }
51 |
52 | void popupSystem::AddFloatInput(std::string hint, float value, std::function callback, float y_space) {
53 | auto input = TextInput::create(285, hint, "chatFont.fnt");
54 | input->setPosition({150.f, currentY});
55 | input->setString(fmt::format("{:.2f}", value));
56 | input->setFilter("1234567890.");
57 | input->setCallback([callback](const std::string& text) {
58 | if (utilsH::isNumeric(text))
59 | callback(std::stof(text));
60 | });
61 |
62 | m_mainLayer->addChild(input);
63 |
64 | currentY -= y_space;
65 | }
66 |
67 | void popupSystem::AddToggle(std::string text, bool value, std::function callback, float y_space) {
68 | CCMenuItemToggler* toggler = CCMenuItemExt::createTogglerWithStandardSprites(0.75f, [this, callback](CCMenuItemToggler* sender) {
69 | callback(!sender->isOn());
70 | });
71 |
72 | toggler->setPosition({ 10, 0 });
73 | toggler->toggle(value);
74 |
75 | auto label = CCLabelBMFont::create(text.c_str(), "bigFont.fnt");
76 | label->setAnchorPoint({0.f, 0.5f});
77 | label->setScale(0.5f);
78 | label->setPosition({ toggler->getPositionX() + 15.f, toggler->getPositionY() });
79 |
80 | auto hack = CCMenu::create();
81 | hack->setPosition({15, currentY});
82 | hack->addChild(toggler);
83 | hack->addChild(label);
84 |
85 | m_mainLayer->addChild(hack);
86 |
87 | currentY -= y_space;
88 | }
--------------------------------------------------------------------------------
/src/popupSystem.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | class popupSystem : public geode::Popup<> {
5 | private:
6 | float currentY = 160.f;
7 | public:
8 | static popupSystem* create();
9 | bool setup();
10 | void onExit();
11 |
12 | void AddText(std::string text, float scale = 0.5f, float y_space = 25.f);
13 | void AddIntInput(std::string hint, int value, std::function callback, float y_space = 35.f);
14 | void AddFloatInput(std::string hint, float value, std::function callback, float y_space = 35.f);
15 | void AddToggle(std::string text, bool value, std::function callback, float y_space = 25.f);
16 | };
--------------------------------------------------------------------------------
/src/replayEngine.hpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | enum state
5 | {
6 | disable,
7 | record,
8 | play
9 | };
10 |
11 | struct replay_data
12 | {
13 | unsigned frame;
14 | float x;
15 | float y;
16 | float rotation;
17 | double y_accel;
18 | bool player;
19 | };
20 |
21 | struct replay_data2
22 | {
23 | unsigned frame;
24 | bool down;
25 | int button;
26 | bool isPlayer1;
27 | };
28 |
29 | class ReplayEngine {
30 | public:
31 | static ReplayEngine& get() {
32 | static ReplayEngine instance;
33 | return instance;
34 | }
35 |
36 | ReplayEngine& operator=(const ReplayEngine&) = delete;
37 | ReplayEngine(const ReplayEngine&) = delete;
38 |
39 | bool engine_v2 = false;
40 |
41 | state mode = state::disable;
42 | std::string replay_name;
43 |
44 | bool accuracy_fix = true;
45 | bool rotation_fix = false;
46 |
47 | bool settings_openned = false;
48 |
49 | bool frame_advance = false;
50 | bool next_frame = false;
51 |
52 | unsigned get_frame();
53 | void remove_actions(unsigned currentFrame);
54 |
55 | size_t get_actions_size();
56 | int get_current_index();
57 |
58 | std::string save(std::string name);
59 | std::string load(std::string name, bool only_p1 = true, bool only_p2 = true);
60 |
61 | std::string save2(std::string name);
62 | std::string load2(std::string name, bool only_p1 = true, bool only_p2 = true);
63 |
64 | std::string clear();
65 |
66 | void handle_update(GJBaseGameLayer* self);
67 | void handle_reset();
68 | void handle_button(bool down, int button, bool isPlayer1);
69 |
70 | void renderUI();
71 |
72 | std::vector& getPhysicFrames(bool player) {
73 | return player ? m_physicFrames_p1 : m_physicFrames_p2;
74 | }
75 |
76 | std::vector& getInputFrames(bool player) {
77 | return player ? m_inputFrames_p1 : m_inputFrames_p2;
78 | }
79 | private:
80 | ReplayEngine() = default;
81 |
82 | std::string load_v1(std::string name);
83 | std::string load_v2(std::string name);
84 | std::string load_v3(std::string name, bool only_p1 = true, bool only_p2 = true);
85 |
86 | std::vector m_physicFrames_p1;
87 | std::vector m_physicFrames_p2;
88 | size_t m_physicIndex_p1 = 0;
89 | size_t m_physicIndex_p2 = 0;
90 |
91 | std::vector m_inputFrames_p1;
92 | std::vector m_inputFrames_p2;
93 | size_t m_inputIndex_p1 = 0;
94 | size_t m_inputIndex_p2 = 0;
95 | };
96 |
97 | class SpamBot
98 | {
99 | public:
100 | static SpamBot& get() {
101 | static SpamBot instance;
102 | return instance;
103 | }
104 |
105 | SpamBot& operator=(const SpamBot&) = delete;
106 | SpamBot(const SpamBot&) = delete;
107 |
108 | int hold_current = 0;
109 | int release_current = 0;
110 |
111 | bool downed = false;
112 |
113 | bool next_frame();
114 | void handle_spambot(GJBaseGameLayer *self);
115 | void reset_temp();
116 | private:
117 | SpamBot() = default;
118 | };
119 |
120 | class StraightFly
121 | {
122 | public:
123 | static StraightFly& get() {
124 | static StraightFly instance;
125 | return instance;
126 | }
127 |
128 | StraightFly& operator=(const StraightFly&) = delete;
129 | StraightFly(const StraightFly&) = delete;
130 |
131 | float accuracy = 40.f;
132 |
133 | void handle_straightfly(GJBaseGameLayer *self);
134 | void start(GJBaseGameLayer *self);
135 |
136 | private:
137 | StraightFly() = default;
138 |
139 | float start_y = 0.0f;
140 | };
--------------------------------------------------------------------------------
/src/utils.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | #include
5 | #include "config.hpp"
6 |
7 | #ifdef GEODE_IS_WINDOWS
8 | struct WindowStateBackup {
9 | HWND hwnd;
10 | LONG Style;
11 | LONG ExStyle;
12 | RECT ClientRect;
13 | POINT WindowPos;
14 | };
15 | #endif
16 |
17 | namespace utilsH {
18 | #ifdef GEODE_IS_WINDOWS
19 | HWND find_hwnd();
20 | #endif
21 | bool isNumeric(const std::string& str);
22 | void UncompleteLevel();
23 | void getFolder();
24 | void setPitchShifter(float pitch);
25 | }
26 |
27 |
28 | static void unimplemented() {}
29 |
30 | static void logMessage(const std::string& message) {
31 | std::ofstream logFile(folderPath / "h264_encode.txt", std::ios::app);
32 | if (logFile.is_open()) {
33 | logFile << message << std::endl;
34 | }
35 | logFile.close();
36 | }
37 |
38 | static void benchmark(const std::string& name, const std::function& func, int runs = 1000) {
39 | using namespace std::chrono;
40 |
41 | long long total_ns = 0;
42 |
43 | for (int i = 0; i < runs; ++i) {
44 | auto start = high_resolution_clock::now();
45 | func();
46 | auto end = high_resolution_clock::now();
47 |
48 | total_ns += duration_cast(end - start).count();
49 | }
50 |
51 | double avg_ns = static_cast(total_ns) / runs;
52 | double avg_ms = avg_ns / 1000.0 / 1000.0;
53 |
54 | geode::log::debug("[Benchmark] {}: avg = {:.0f} ns | {:.4f} ms ({} runs)\n",
55 | name, avg_ns, avg_ms, runs);
56 | }
--------------------------------------------------------------------------------
/support.md:
--------------------------------------------------------------------------------
1 | Edit this file to change your mod's support info, or delete it if you don't need it.
2 |
--------------------------------------------------------------------------------