Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 4e18cf7

Browse files
committed
Patch libvpx with RTC rate control added.
We have to patch libvpx here instead of enabling this in OWT SDK since some of the referenced libvpx headers are referencing internal libvpx headers in the format of relative path.
1 parent fb0b28d commit 4e18cf7

File tree

6 files changed

+1129
-0
lines changed

6 files changed

+1129
-0
lines changed

scripts/prepare_dev.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
THIRD_PARTY_PATH = os.path.join(HOME_PATH, 'third_party')
1919
LIBSRTP_PATH = os.path.join(THIRD_PARTY_PATH, 'libsrtp')
2020
FFMPEG_PATH = os.path.join(THIRD_PARTY_PATH, 'ffmpeg')
21+
LIBVPX_PATH = os.path.join(THIRD_PARTY_PATH, 'libvpx')
22+
LIBVPX_SOURCE_PATH = os.path.join(LIBVPX_PATH, 'source/libvpx')
2123
WEBRTC_OVERRIDES_PATH = os.path.join(THIRD_PARTY_PATH, 'webrtc_overrides')
2224
BUILD_PATH = os.path.join(HOME_PATH, 'build')
2325
CONFIG_PATH = os.path.join(BUILD_PATH, 'config')
@@ -43,6 +45,8 @@
4345
('0014-Fix-missing-ffmpeg-configure-item-for-msvc-build.patch', FFMPEG_PATH),
4446
('0015-Remove-custom-d8-dependency.patch', BUILD_PATH),
4547
('0016-Remove-deprecated-create_srcjar-property.patch', THIRD_PARTY_PATH)
48+
('0015-vp9-add-rate-control-interface-for-RTC.patch', LIBVPX_SOURCE_PATH),
49+
('0016-Build-libvpx-with-RTC-rate-control-impl-included.patch', LIBVPX_PATH)
4650
]
4751

4852
def _patch(ignoreFailures=False):

talk/owt/BUILD.gn

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44

55
import("//build_overrides/webrtc.gni")
66
import("//testing/test.gni")
7+
8+
# Introduced for using libvpx config files. We only enable libvpx rate
9+
# controller for VP9 on Windows.
10+
if (is_win) {
11+
os_category = current_os
12+
13+
if (current_cpu == "x86") {
14+
cpu_arch_full = "ia32"
15+
} else if (current_cpu == "x64") {
16+
cpu_arch_full = "x64"
17+
} else if (current_cpu == "arm") {
18+
if (arm_use_neon) {
19+
cpu_arch_full = "arm-neon"
20+
} else if (is_android) {
21+
cpu_arch_full = "arm-neon-cpu-detect"
22+
} else {
23+
cpu_arch_full = "arm"
24+
}
25+
}
26+
}
27+
728
if (is_android) {
829
import("//build/config/android/config.gni")
930
import("//build/config/android/rules.gni")
@@ -208,9 +229,19 @@ static_library("owt_sdk_base") {
208229
"sdk/base/win/sysmem_allocator.h",
209230
"sdk/base/win/videorendererwin.cc",
210231
"sdk/base/win/videorendererwin.h",
232+
"sdk/base/win/vp9ratecontrol.cc",
233+
"sdk/base/win/vp9ratecontrol.h",
234+
#"sdk/base/win/vp9temporallayers.cc",
235+
#"sdk/base/win/vp9temporallayers.h",
211236
"sdk/base/windowcapturer.cc",
212237
]
213238
public_deps += [ "//third_party/webrtc/modules/audio_device:audio_device_module_from_input_and_output" ]
239+
public_deps += [ "//third_party/libvpx" ]
240+
include_dirs += [
241+
"//third_party/libvpx/source/config",
242+
"//third_party/libvpx/source/config/$os_category/$cpu_arch_full",
243+
"//third_party/libvpx/source/libvpx",
244+
]
214245
}
215246
if (is_linux) {
216247
if (owt_msdk_header_root != "") {

0 commit comments

Comments
 (0)