Skip to content

Commit 3984398

Browse files
committed
chore: update chrome version to 143.0.7474.2, update patch file
1 parent af09f06 commit 3984398

File tree

3 files changed

+106
-5
lines changed

3 files changed

+106
-5
lines changed

chromium/build.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else
1313
fi
1414

1515
# https://chromium.googlesource.com/chromium/src/+refs
16-
export VERSION="141.0.7364.1"
16+
export VERSION="143.0.7474.2"
1717
export DEFAULT_BRANCH="tags/${VERSION}"
1818

1919
function setup() {
@@ -91,7 +91,7 @@ function apply_patch() {
9191
local filepath=${DIR}/max-video-decoders_$(echo ${branch} | sed s/'tags\/'//).patch
9292
if [ ! -f ${filepath} ]; then
9393
echo "INFO: patch file not found: ${filepath}, using default patch"
94-
filepath=${DIR}/max-video-decoders_main.patch
94+
filepath=${DIR}/max-video-decoders_latest.patch
9595
fi
9696
cd ${CHROMIUM_SRC}/third_party/webrtc
9797
git apply < ${filepath}
@@ -111,9 +111,9 @@ function update() {
111111
git pull
112112
cd ${CHROMIUM_SRC}
113113
git rebase --abort || true
114-
git fetch origin ${branch} --no-tags
115-
git checkout ${branch}
116-
git pull origin ${branch}
114+
#git fetch origin ${branch} --no-tags
115+
#git checkout ${branch}
116+
#git pull origin ${branch}
117117
gclient sync -D --force --reset --no-history --revision=${branch}
118118
apply_patch ${branch}
119119
}
@@ -123,6 +123,7 @@ function build() {
123123
if [ "${PLATFORM}" = "Linux" ]; then
124124
time ionice -c3 nice -n19 autoninja -C out/Default "chrome/installer/linux:unstable_deb"
125125
mv out/Default/*.deb ${DIR}
126+
autoninja -C out/Default video_replay
126127
else
127128
time nice -n19 autoninja -C out/Default chrome chrome/installer/mac
128129
rm -rf out/Default/Chromium
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc
2+
index ea4b474a..cb11023b 100644
3+
--- a/video/video_receive_stream2.cc
4+
+++ b/video/video_receive_stream2.cc
5+
@@ -105,6 +105,31 @@ namespace {
6+
constexpr TimeDelta kMinBaseMinimumDelay = TimeDelta::Zero();
7+
constexpr TimeDelta kMaxBaseMinimumDelay = TimeDelta::Seconds(10);
8+
9+
+uint getTotalVideoDecoders() {
10+
+ FileWrapper file_wrapper = FileWrapper::OpenReadOnly("/dev/shm/chromium-video-decoders");
11+
+ if (file_wrapper.is_open()) {
12+
+ char buf[256];
13+
+ file_wrapper.Read(buf, sizeof(buf));
14+
+ file_wrapper.Close();
15+
+ return (uint)atoi(buf);
16+
+ }
17+
+ return 0;
18+
+}
19+
+
20+
+void updateTotalVideoDecoders(int value) {
21+
+ char buf[256];
22+
+ uint total_video_decoders = getTotalVideoDecoders();
23+
+ snprintf(buf, sizeof(buf), "%u", std::max<uint>(0, total_video_decoders + value));
24+
+
25+
+ FileWrapper file_wrapper = FileWrapper::OpenWriteOnly("/dev/shm/chromium-video-decoders");
26+
+ if (!file_wrapper.is_open()) {
27+
+ RTC_LOG(LS_ERROR) << "total video decoders file cannot be opened: /dev/shm/chromium-video-decoders";
28+
+ return;
29+
+ }
30+
+ file_wrapper.Write(buf, strlen(buf));
31+
+ file_wrapper.Close();
32+
+}
33+
+
34+
// Concrete instance of RecordableEncodedFrame wrapping needed content
35+
// from EncodedFrame.
36+
class WebRtcRecordableEncodedFrame : public RecordableEncodedFrame {
37+
@@ -182,7 +207,7 @@ class NullVideoDecoder : public VideoDecoder {
38+
39+
int32_t Decode(const EncodedImage& input_image,
40+
int64_t render_time_ms) override {
41+
- RTC_LOG(LS_ERROR) << "The NullVideoDecoder doesn't support decoding.";
42+
+ RTC_LOG(LS_WARNING) << "The NullVideoDecoder doesn't support decoding.";
43+
return WEBRTC_VIDEO_CODEC_OK;
44+
}
45+
46+
@@ -394,6 +419,20 @@ void VideoReceiveStream2::Start() {
47+
renderer = this;
48+
}
49+
50+
+ // Check if we should create video decoders.
51+
+ enable_video_decoders_ = true;
52+
+ std::string max_video_decoders = env_.field_trials().Lookup("WebRTC-MaxVideoDecoders");
53+
+ if (!max_video_decoders.empty()) {
54+
+ uint video_decoders = getTotalVideoDecoders();
55+
+ uint max_decoders = (uint)atoi(max_video_decoders.c_str());
56+
+ RTC_LOG(LS_ERROR) << "WebRTC-MaxVideoDecoders: " << video_decoders << "/" << max_decoders;
57+
+ if (video_decoders >= max_decoders) {
58+
+ enable_video_decoders_ = false;
59+
+ }
60+
+ }
61+
+ if (enable_video_decoders_)
62+
+ updateTotalVideoDecoders(1);
63+
+
64+
for (const Decoder& decoder : config_.decoders) {
65+
VideoDecoder::Settings settings;
66+
settings.set_codec_type(
67+
@@ -472,6 +511,9 @@ void VideoReceiveStream2::Stop() {
68+
stats_proxy_.DecoderThreadStopped();
69+
70+
UpdateHistograms();
71+
+
72+
+ if (enable_video_decoders_)
73+
+ updateTotalVideoDecoders(-1);
74+
}
75+
76+
// TODO(bugs.webrtc.org/11993): Make these calls on the network thread.
77+
@@ -563,8 +605,9 @@ void VideoReceiveStream2::CreateAndRegisterExternalDecoder(
78+
const Decoder& decoder) {
79+
TRACE_EVENT0("webrtc",
80+
"VideoReceiveStream2::CreateAndRegisterExternalDecoder");
81+
- std::unique_ptr<VideoDecoder> video_decoder =
82+
- config_.decoder_factory->Create(env_, decoder.video_format);
83+
+ std::unique_ptr<VideoDecoder> video_decoder = enable_video_decoders_ ?
84+
+ config_.decoder_factory->Create(env_, decoder.video_format) :
85+
+ nullptr;
86+
// If we still have no valid decoder, we have to create a "Null" decoder
87+
// that ignores all calls. The reason we can get into this state is that the
88+
// old decoder factory interface doesn't have a way to query supported
89+
diff --git a/video/video_receive_stream2.h b/video/video_receive_stream2.h
90+
index a07bd08f..0aa6a3f6 100644
91+
--- a/video/video_receive_stream2.h
92+
+++ b/video/video_receive_stream2.h
93+
@@ -298,6 +298,7 @@ class VideoReceiveStream2
94+
RtpStreamsSynchronizer rtp_stream_sync_;
95+
96+
std::unique_ptr<VideoStreamBufferController> buffer_;
97+
+ bool enable_video_decoders_;
98+
99+
// `receiver_controller_` is valid from when RegisterWithTransport is invoked
100+
// until UnregisterFromTransport.

0 commit comments

Comments
 (0)