Skip to content

Commit

Permalink
Merge pull request #2 from shiguredo/feature/h264
Browse files Browse the repository at this point in the history
ハードウェアエンコーダを使った H264 に対応した
  • Loading branch information
voluntas authored Feb 27, 2020
2 parents abfd74e + 565749c commit 74d28bb
Show file tree
Hide file tree
Showing 28 changed files with 9,263 additions and 29 deletions.
34 changes: 34 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/src",
"${workspaceFolder}/_install/boost/include",
"${workspaceFolder}/_install/json/include",
"${workspaceFolder}/NvCodec/include",
"${workspaceFolder}/NvCodec/NvCodec",
"${workspaceFolder}/_install/webrtc/include",
"${workspaceFolder}/_install/webrtc/include/third_party/abseil-cpp",
"${workspaceFolder}/_install/webrtc/include/third_party/boringssl/src/include",
"${workspaceFolder}/_install/webrtc/include/third_party/libyuv/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"_CONSOLE",
"_WIN32_WINNT=0x0A00",
"WEBRTC_WIN",
"NOMINMAX",
"WIN32_LEAN_AND_MEAN"
],
"windowsSdkVersion": "10.0.18362.0",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

## develop

- [UPDATE] Windows 版では H.264 エンコードに NVIDIA VIDEO CODEC SDK を利用する(利用可能な場合のみ)
- [UPDATE] macOS 版では H.264 のエンコード/デコードに VideoToolbox を利用する

## 1.0.4

- [UPDATE] webrtc-build を 80.3987.2.2 に上げた
Expand Down
20 changes: 17 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ if (MSVC)
iphlpapi.lib
msdmo.lib
Secur32.lib
wmcodecdspuuid.lib)
wmcodecdspuuid.lib
dxgi.lib
D3D11.lib)

set(_COMPILE_DEFINITIONS
_CONSOLE
Expand Down Expand Up @@ -75,8 +77,14 @@ endif ()
string(SUBSTRING ${SORA_UNITY_SDK_COMMIT} 0 8 SORA_UNITY_SDK_COMMIT_SHORT)
string(SUBSTRING ${WEBRTC_SRC_COMMIT} 0 8 WEBRTC_SRC_COMMIT_SHORT)

set(_INCLUDE_DIRECTORIES)

configure_file(src/sora_version.h.template ${CMAKE_CURRENT_BINARY_DIR}/sora_version.h)
set(_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND _INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})

list(APPEND _INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/src)
list(APPEND _INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/NvCodec/include)
list(APPEND _INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/NvCodec/NvCodec)

set(Boost_USE_STATIC_LIBS ON)

Expand All @@ -99,11 +107,16 @@ set(_SOURCES
src/rtc/rtc_connection.cpp
src/rtc/rtc_manager.cpp
src/rtc/scalable_track_source.cpp
src/rtc/hw_video_encoder_factory.cpp
src/rtc/h264_format.cpp
)

if (WIN32)
list(APPEND _SOURCES
src/unity_camera_capturer_d3d11.cpp)
src/unity_camera_capturer_d3d11.cpp
src/hwenc_nvcodec/nvcodec_h264_encoder.cpp
NvCodec/NvCodec/NvEncoder/NvEncoder.cpp
NvCodec/NvCodec/NvEncoder/NvEncoderD3D11.cpp)

add_library(SoraUnitySdk SHARED ${_SOURCES})
elseif (APPLE)
Expand All @@ -121,6 +134,7 @@ elseif (APPLE)
COMPILE_OPTIONS "-x;objective-c++;-fmodules;-fcxx-modules")

add_library(SoraUnitySdk MODULE ${_SOURCES})
target_link_options(SoraUnitySdk PRIVATE -ObjC)
set_target_properties(SoraUnitySdk PROPERTIES BUNDLE TRUE)
set_target_properties(SoraUnitySdk PROPERTIES CXX_VISIBILITY_PRESET hidden)
endif ()
Expand Down
Loading

0 comments on commit 74d28bb

Please sign in to comment.