Skip to content

Commit afd112e

Browse files
committed
initial commit
0 parents  commit afd112e

141 files changed

Lines changed: 33576 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
8+
9+
project(ffmpeg-api VERSION 1.0.0)
10+
11+
add_library(${PROJECT_NAME} SHARED
12+
src/recorder.cpp
13+
src/audio_mixer.cpp
14+
# Add any extra C++ source files here
15+
)
16+
17+
set_property(TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Final>:Final>")
18+
19+
if (NOT DEFINED ENV{GEODE_SDK})
20+
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
21+
else()
22+
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
23+
endif()
24+
25+
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
26+
27+
target_include_directories(${PROJECT_NAME} PRIVATE
28+
include
29+
)
30+
31+
setup_geode_mod(${PROJECT_NAME})
32+
33+
if (WIN32)
34+
set(STATIC_LIBS
35+
${CMAKE_SOURCE_DIR}/lib/avcodec.lib
36+
${CMAKE_SOURCE_DIR}/lib/avformat.lib
37+
${CMAKE_SOURCE_DIR}/lib/avutil.lib
38+
${CMAKE_SOURCE_DIR}/lib/swresample.lib
39+
${CMAKE_SOURCE_DIR}/lib/swscale.lib
40+
${CMAKE_SOURCE_DIR}/lib/libx264.lib
41+
${CMAKE_SOURCE_DIR}/lib/x265-static.lib
42+
Ws2_32.lib mfplat.lib mf.lib secur32.lib crypt32.lib mfuuid.lib
43+
mf mfplat mfuuid bcrypt strmiids.lib
44+
) # windows
45+
elseif (ANDROID)
46+
set(STATIC_LIBS ...) # android
47+
else ()
48+
set(STATIC_LIBS ...) # macos
49+
endif()
50+
target_link_libraries(${PROJECT_NAME} ${STATIC_LIBS})
51+
52+
if (PROJECT_IS_TOP_LEVEL)
53+
target_compile_definitions(${PROJECT_NAME} PRIVATE FFMPEG_API_EXPORTING)
54+
endif()

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ffmpeg-api
2+
This is where she makes a mod.
3+
4+
<img src="logo.png" width="150" alt="the mod's logo" />
5+
6+
*Update logo.png to change your mod's icon (please)*
7+
8+
## Getting started
9+
We recommend heading over to [the getting started section on our docs](https://docs.geode-sdk.org/getting-started/) for useful info on what to do next.
10+
11+
## Build instructions
12+
For more info, see [our docs](https://docs.geode-sdk.org/getting-started/create-mod#build)
13+
```sh
14+
# Assuming you have the Geode CLI set up already
15+
geode build
16+
```
17+
18+
# Resources
19+
* [Geode SDK Documentation](https://docs.geode-sdk.org/)
20+
* [Geode SDK Source Code](https://github.com/geode-sdk/geode/)
21+
* [Geode CLI](https://github.com/geode-sdk/cli)
22+
* [Bindings](https://github.com/geode-sdk/bindings/)
23+
* [Dev Tools](https://github.com/geode-sdk/DevTools)

about.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Template Mod
2+
3+
Edit about.md to change this

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 1.0.0
2+
- Edit this file to change your mod's changelog.

include/audio_mixer.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
#include "export.hpp"
4+
5+
#include <filesystem>
6+
7+
namespace ffmpeg {
8+
9+
class FFMPEG_API_DLL AudioMixer {
10+
public:
11+
void mixMp4Wav(std::filesystem::path mp4File, std::filesystem::path wavFile, std::filesystem::path outputMp4File);
12+
};
13+
14+
}

include/export.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include <Geode/platform/cplatform.h>
4+
5+
#ifdef GEODE_IS_WINDOWS
6+
#ifdef FFMPEG_API_EXPORTING
7+
#define FFMPEG_API_DLL __declspec(dllexport)
8+
#else
9+
#define FFMPEG_API_DLL __declspec(dllimport)
10+
#endif
11+
#else
12+
#define FFMPEG_API_DLL __attribute__((visibility("default")))
13+
#endif

include/libavcodec/ac3_parser.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 <stddef.h>
27+
#include <stdint.h>
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 */

include/libavcodec/adts_parser.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 <stddef.h>
23+
#include <stdint.h>
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 */

0 commit comments

Comments
 (0)