Webrtc添加x265(hevc)编解码

首先在源码目录执行
gn gen -C out/DDD
再去新建目录DDD下执行 ninja

webrtc/webrtc.gni
rtc_use_h264 = proprietary_codecs && !is_android && !is_ios
rtc_use_h265 = proprietary_codecs


/home/lili/Downloads/webrtc-checkout/src/webrtc/modules/video_coding
rtc_static_library("webrtc_h265"){
sources = [
"codecs/h265/h265.cc",
"codecs/h265/include/h265.h",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}

defines = []
deps = [
":video_coding_utility",
"../../base:rtc_base_approved",
"../../media:rtc_media_base",
"../../system_wrappers",
]

if (rtc_use_h265) {
defines += [ "WEBRTC_USE_H265" ]
if (rtc_initialize_ffmpeg) {
defines += [ "WEBRTC_INITIALIZE_FFMPEG" ]
}
sources += [
"codecs/h265/h265_decoder_impl.cc",
"codecs/h265/h265_decoder_impl.h",
"codecs/h265/h265_encoder_impl.cc",
"codecs/h265/h265_encoder_impl.h",
]
deps += [
"../../common_video",
"../../media:rtc_media_base",
"//third_party/ffmpeg:ffmpeg",
]
}

}
添加webrtcH265的静态块的依赖:
deps = [
":video_coding_utility",
":webrtc_h264",
":webrtc_h265",
":webrtc_i420",
":webrtc_vp8",
":webrtc_vp9",
]

添加x265动态库:
defines += [ "WEBRTC_USE_H265" ]
if (rtc_initialize_ffmpeg) {
defines += [ "WEBRTC_INITIALIZE_FFMPEG" ]
}
sources += [
"codecs/h265/h265_decoder_impl.cc",
"codecs/h265/h265_decoder_impl.h",
"codecs/h265/h265_encoder_impl.cc",
"codecs/h265/h265_encoder_impl.h",
]
deps += [
"../../common_video",
"../../media:rtc_media_base",
"//third_party/ffmpeg:ffmpeg",
]
cflags = ["-I/home/lili/Downloads/webrtc-checkout/src/webrtc"]
libs = ["x265"]
ldflags = ["-L/home/lili/Downloads/webrtc-checkout/src/webrtc"]
}

如果大家有对接方面的问题欢迎咨询我的Chat快问:




你可能感兴趣的:(Webrtc)