Skip to content

Commit f2e396e

Browse files
committed
hololens2 を m132 に対応する
1 parent 8a036fa commit f2e396e

File tree

11 files changed

+378
-140
lines changed

11 files changed

+378
-140
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
"fstream": "cpp",
7474
"optional": "cpp",
7575
"sstream": "cpp",
76-
"system_error": "cpp"
76+
"system_error": "cpp",
77+
"arm_neon.h": "c",
78+
"*.inc": "c"
7779
},
7880
}

run.py

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ def get_depot_tools(source_dir, fetch=False):
226226
"ssl_verify_callback_with_native_handle.patch",
227227
"h265.patch",
228228
"fix_perfetto.patch",
229+
"fix_moved_function_call.patch",
230+
"windows_add_optional.patch",
229231
],
230232
"macos_arm64": [
231233
"add_deps.patch",
@@ -380,9 +382,10 @@ def get_depot_tools(source_dir, fetch=False):
380382
"005-h264.patch",
381383
"006-logging.patch",
382384
"007-internal-error.patch",
383-
"008-streamer.patch",
384385
"009-remove-dotprod.patch",
385386
"010-remove-perfetto.patch",
387+
"011-remove-partition-alloc.patch",
388+
"012-fix-neon-vector.patch",
386389
]
387390
WINUWP_ADDITIONAL_DIRS = [
388391
["modules", "audio_device", "winuwp"],
@@ -403,6 +406,7 @@ def apply_patch(patch, dir, depth):
403406
"--ignore-space-change",
404407
"--ignore-whitespace",
405408
"--whitespace=nowarn",
409+
"--reject",
406410
patch,
407411
]
408412
)
@@ -429,7 +433,7 @@ def apply_patches(target, patch_dir, src_dir, patch_until, commit_patch):
429433
# patch_until が指定されている場合、そのパッチファイルまで適用とコミットして、
430434
# patch_until のパッチに関しては適用だけ行う
431435
if patch_until is not None:
432-
if patch_until not in PATCHES[target]:
436+
if patch_until not in PATCHES[target] + WINUWP_ADDITIONAL_PATCHES:
433437
raise Exception(f"{patch_until} file is not in PATCHES")
434438

435439
with cd(src_dir):
@@ -472,10 +476,6 @@ def apply_patches(target, patch_dir, src_dir, patch_until, commit_patch):
472476
dstdir = os.path.join(src_dir, *dir)
473477
rm_rf(dstdir)
474478
shutil.copytree(srcdir, dstdir)
475-
# 追加パッチの適用
476-
for patch in WINUWP_ADDITIONAL_PATCHES:
477-
apply_patch(os.path.join(winuwp_dir, patch), src_dir, 1)
478-
479479
cmd(["gclient", "recurse", "git", "add", "--", ":!*.orig", ":!*.rej"])
480480
cmd(
481481
[
@@ -485,9 +485,28 @@ def apply_patches(target, patch_dir, src_dir, patch_until, commit_patch):
485485
"commit",
486486
"--allow-empty",
487487
"-am",
488-
"[shiguredo-patch] Apply winuwp patches",
488+
"[shiguredo-patch] Apply winuwp patches (additional files)",
489489
]
490490
)
491+
# 追加パッチの適用
492+
for patch in WINUWP_ADDITIONAL_PATCHES:
493+
apply_patch(os.path.join(winuwp_dir, patch), src_dir, 1)
494+
if patch == patch_until and not commit_patch:
495+
break
496+
cmd(["gclient", "recurse", "git", "add", "--", ":!*.orig", ":!*.rej"])
497+
cmd(
498+
[
499+
"gclient",
500+
"recurse",
501+
"git",
502+
"commit",
503+
"--allow-empty",
504+
"-am",
505+
f"[shiguredo-patch] Apply winuwp patches ({patch})",
506+
]
507+
)
508+
if patch == patch_until and commit_patch:
509+
break
491510

492511

493512
# 時雨堂パッチが当たっていない最新のコミットを取得する
@@ -1043,6 +1062,7 @@ def build_webrtc(
10431062
"treat_warnings_as_errors=false",
10441063
"rtc_enable_win_wgc=false",
10451064
"rtc_include_dav1d_in_internal_decoder_factory=false",
1065+
"libyuv_use_neon=false",
10461066
]
10471067
elif target in ("macos_arm64",):
10481068
gn_args += [

winuwp/002-capturer.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ index 5869ecd7..ef1cb868 100644
484484
- const uint8_t* src_uv;
485485
+ const uint8_t* src_uv_cropped;
486486
const int abs_src_height = (src_height < 0) ? -src_height : src_height;
487-
// TODO(nisse): Why allow crop_height < 0?
488487
const int abs_crop_height = (crop_height < 0) ? -crop_height : crop_height;
488+
int r = 0;
489489
@@ -171,19 +174,17 @@ int ConvertToI420(const uint8_t* sample,
490490
break;
491491
// Biplanar formats

winuwp/004-nogeneric.patch

Lines changed: 66 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
Updating depot_tools...
12
diff --git a/call/rtp_payload_params.cc b/call/rtp_payload_params.cc
2-
index 33e9c7666e..dcd0da8650 100644
3+
index acc9e3ca18..dd47ff57f3 100644
34
--- a/call/rtp_payload_params.cc
45
+++ b/call/rtp_payload_params.cc
5-
@@ -316,7 +316,7 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
6+
@@ -330,7 +330,7 @@ void RtpPayloadParams::SetGeneric(const CodecSpecificInfo* codec_specific_info,
67
chains_calculator_.Reset(
78
codec_specific_info->generic_frame_info->part_of_chain);
89
}
@@ -11,7 +12,7 @@ index 33e9c7666e..dcd0da8650 100644
1112
*codec_specific_info->generic_frame_info, frame_id);
1213
return;
1314
}
14-
@@ -420,7 +420,7 @@ void RtpPayloadParams::GenericToGeneric(int64_t frame_id,
15+
@@ -438,7 +438,7 @@ void RtpPayloadParams::GenericToGeneric(int64_t frame_id,
1516
bool is_keyframe,
1617
RTPVideoHeader* rtp_video_header) {
1718
RTPVideoHeader::GenericDescriptorInfo& generic =
@@ -20,7 +21,7 @@ index 33e9c7666e..dcd0da8650 100644
2021

2122
generic.frame_id = frame_id;
2223
generic.decode_target_indications.push_back(DecodeTargetIndication::kSwitch);
23-
@@ -453,7 +453,7 @@ void RtpPayloadParams::H264ToGeneric(const CodecSpecificInfoH264& h264_info,
24+
@@ -471,7 +471,7 @@ void RtpPayloadParams::H264ToGeneric(const CodecSpecificInfoH264& h264_info,
2425
}
2526

2627
RTPVideoHeader::GenericDescriptorInfo& generic =
@@ -29,7 +30,7 @@ index 33e9c7666e..dcd0da8650 100644
2930

3031
generic.frame_id = frame_id;
3132
generic.temporal_index = temporal_index;
32-
@@ -509,7 +509,7 @@ void RtpPayloadParams::Vp8ToGeneric(const CodecSpecificInfoVP8& vp8_info,
33+
@@ -535,7 +535,7 @@ void RtpPayloadParams::Vp8ToGeneric(const CodecSpecificInfoVP8& vp8_info,
3334
}
3435

3536
RTPVideoHeader::GenericDescriptorInfo& generic =
@@ -38,7 +39,7 @@ index 33e9c7666e..dcd0da8650 100644
3839

3940
generic.frame_id = frame_id;
4041
generic.spatial_index = spatial_index;
41-
@@ -578,7 +578,7 @@ void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& vp9_info,
42+
@@ -604,7 +604,7 @@ void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& /* vp9_info */,
4243
}
4344

4445
RTPVideoHeader::GenericDescriptorInfo& result =
@@ -47,7 +48,7 @@ index 33e9c7666e..dcd0da8650 100644
4748

4849
result.frame_id = frame_id;
4950
result.spatial_index = spatial_index;
50-
@@ -643,7 +643,7 @@ void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& vp9_info,
51+
@@ -669,7 +669,7 @@ void RtpPayloadParams::Vp9ToGeneric(const CodecSpecificInfoVP9& /* vp9_info */,
5152
// non-layerd streams.
5253
if (spatial_index > 0 || temporal_index > 0) {
5354
// Prefer to generate no generic layering than an inconsistent one.
@@ -75,10 +76,25 @@ index f4525f0db1..eadbae52eb 100644
7576
if (descriptor.spatial_index < 0 || descriptor.temporal_index < 0 ||
7677
descriptor.spatial_index >=
7778
diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc
78-
index ebca7aaa75..ce5e224a9f 100644
79+
index 8a21d0523f..06b99a6b9c 100644
7980
--- a/modules/rtp_rtcp/source/rtp_sender_video.cc
8081
+++ b/modules/rtp_rtcp/source/rtp_sender_video.cc
81-
@@ -121,9 +121,9 @@ absl::optional<VideoPlayoutDelay> LoadVideoPlayoutDelayOverride(
82+
@@ -103,10 +103,10 @@ bool MinimizeDescriptor(RTPVideoHeader* video_header) {
83+
84+
bool IsBaseLayer(const RTPVideoHeader& video_header) {
85+
// For AV1 & H.265 we fetch temporal index from the generic descriptor.
86+
- if (video_header.generic) {
87+
- const auto& generic = video_header.generic.value();
88+
- return (generic.temporal_index == 0 ||
89+
- generic.temporal_index == kNoTemporalIdx);
90+
+ if (video_header.generic_) {
91+
+ const auto& generic_ = video_header.generic_.value();
92+
+ return (generic_.temporal_index == 0 ||
93+
+ generic_.temporal_index == kNoTemporalIdx);
94+
}
95+
switch (video_header.codec) {
96+
case kVideoCodecVP8: {
97+
@@ -152,9 +152,9 @@ std::optional<VideoPlayoutDelay> LoadVideoPlayoutDelayOverride(
8298
bool PacketWillLikelyBeRequestedForRestransmissionIfLost(
8399
const RTPVideoHeader& video_header) {
84100
return IsBaseLayer(video_header) &&
@@ -90,7 +106,7 @@ index ebca7aaa75..ce5e224a9f 100644
90106
DecodeTargetIndication::kDiscardable)
91107
: false);
92108
}
93-
@@ -358,26 +358,26 @@ void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
109+
@@ -391,26 +391,26 @@ void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
94110
*video_header.absolute_capture_time);
95111
}
96112

@@ -125,7 +141,7 @@ index ebca7aaa75..ce5e224a9f 100644
125141
RTC_DCHECK_EQ(
126142
descriptor.frame_dependencies.decode_target_indications.size(),
127143
video_structure_->num_decode_targets);
128-
@@ -392,7 +392,7 @@ void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
144+
@@ -425,7 +425,7 @@ void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
129145
// layers when inter layer dependency is not used, i.e. S structures.
130146
// Distinguish these two cases by checking if there are any dependencies.
131147
if (video_header.frame_type == VideoFrameType::kVideoFrameKey &&
@@ -134,7 +150,7 @@ index ebca7aaa75..ce5e224a9f 100644
134150
// To avoid extra structure copy, temporary share ownership of the
135151
// video_structure with the dependency descriptor.
136152
descriptor.attached_structure =
137-
@@ -415,17 +415,17 @@ void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
153+
@@ -448,17 +448,17 @@ void RTPSenderVideo::AddRtpHeaderExtensions(const RTPVideoHeader& video_header,
138154

139155
if (first_packet) {
140156
generic_descriptor.SetFrameId(
@@ -157,7 +173,7 @@ index ebca7aaa75..ce5e224a9f 100644
157173

158174
if (video_header.frame_type == VideoFrameType::kVideoFrameKey) {
159175
generic_descriptor.SetResolution(video_header.width,
160-
@@ -504,12 +504,12 @@ bool RTPSenderVideo::SendVideo(int payload_type,
176+
@@ -557,12 +557,12 @@ bool RTPSenderVideo::SendVideo(int payload_type,
161177
}
162178
}
163179

@@ -174,7 +190,7 @@ index ebca7aaa75..ce5e224a9f 100644
174190

175191
// No FEC protection for upper temporal layers, if used.
176192
diff --git a/modules/rtp_rtcp/source/rtp_video_header.cc b/modules/rtp_rtcp/source/rtp_video_header.cc
177-
index b07a7beec4..16b1c94a74 100644
193+
index 558b58289a..4feb91da72 100644
178194
--- a/modules/rtp_rtcp/source/rtp_video_header.cc
179195
+++ b/modules/rtp_rtcp/source/rtp_video_header.cc
180196
@@ -36,12 +36,12 @@ VideoFrameMetadata RTPVideoHeader::GetAsMetadata() const {
@@ -196,12 +212,12 @@ index b07a7beec4..16b1c94a74 100644
196212
}
197213
metadata.SetIsLastFrameInPicture(is_last_frame_in_picture);
198214
metadata.SetSimulcastIdx(simulcastIdx);
199-
@@ -73,15 +73,15 @@ void RTPVideoHeader::SetFromMetadata(const VideoFrameMetadata& metadata) {
215+
@@ -75,15 +75,15 @@ void RTPVideoHeader::SetFromMetadata(const VideoFrameMetadata& metadata) {
200216
rotation = metadata.GetRotation();
201217
content_type = metadata.GetContentType();
202218
if (!metadata.GetFrameId().has_value()) {
203-
- generic = absl::nullopt;
204-
+ generic_ = absl::nullopt;
219+
- generic = std::nullopt;
220+
+ generic_ = std::nullopt;
205221
} else {
206222
- generic.emplace();
207223
- generic->frame_id = metadata.GetFrameId().value();
@@ -220,23 +236,23 @@ index b07a7beec4..16b1c94a74 100644
220236
metadata.GetDecodeTargetIndications().end());
221237
}
222238
diff --git a/modules/rtp_rtcp/source/rtp_video_header.h b/modules/rtp_rtcp/source/rtp_video_header.h
223-
index d185c20c83..57e5627466 100644
239+
index 8bf17fcb35..e0fb156348 100644
224240
--- a/modules/rtp_rtcp/source/rtp_video_header.h
225241
+++ b/modules/rtp_rtcp/source/rtp_video_header.h
226-
@@ -69,7 +69,7 @@ struct RTPVideoHeader {
242+
@@ -70,7 +70,7 @@ struct RTPVideoHeader {
227243
VideoFrameMetadata GetAsMetadata() const;
228244
void SetFromMetadata(const VideoFrameMetadata& metadata);
229245

230-
- absl::optional<GenericDescriptorInfo> generic;
231-
+ absl::optional<GenericDescriptorInfo> generic_;
246+
- std::optional<GenericDescriptorInfo> generic;
247+
+ std::optional<GenericDescriptorInfo> generic_;
232248

233249
VideoFrameType frame_type = VideoFrameType::kEmptyFrame;
234250
uint16_t width = 0;
235251
diff --git a/modules/video_coding/packet_buffer.cc b/modules/video_coding/packet_buffer.cc
236-
index 52ef5c2d85..0dc71c7029 100644
252+
index 9d7b6e550c..2f3c42acfd 100644
237253
--- a/modules/video_coding/packet_buffer.cc
238254
+++ b/modules/video_coding/packet_buffer.cc
239-
@@ -256,7 +256,7 @@ std::vector<std::unique_ptr<PacketBuffer::Packet>> PacketBuffer::FindFrames(
255+
@@ -268,7 +268,7 @@ std::vector<std::unique_ptr<PacketBuffer::Packet>> PacketBuffer::FindFrames(
240256
int64_t frame_timestamp = buffer_[start_index]->timestamp;
241257

242258
// Identify H.264 keyframes by means of SPS, PPS, and IDR.
@@ -245,8 +261,17 @@ index 52ef5c2d85..0dc71c7029 100644
245261
bool is_h264_descriptor =
246262
(buffer_[start_index]->codec() == kVideoCodecH264) && !is_generic;
247263
bool has_h264_sps = false;
264+
@@ -282,7 +282,7 @@ std::vector<std::unique_ptr<PacketBuffer::Packet>> PacketBuffer::FindFrames(
265+
// GFD is only attached to first packet of frame, so update check on
266+
// every packet.
267+
if (buffer_[start_index] != nullptr) {
268+
- is_generic = buffer_[start_index]->video_header.generic.has_value();
269+
+ is_generic = buffer_[start_index]->video_header.generic_.has_value();
270+
if (is_generic) {
271+
is_h264_descriptor = false;
272+
}
248273
diff --git a/modules/video_coding/rtp_frame_reference_finder.cc b/modules/video_coding/rtp_frame_reference_finder.cc
249-
index a44b76bf15..695e161ba6 100644
274+
index b73fcfe9d5..4f818263f5 100644
250275
--- a/modules/video_coding/rtp_frame_reference_finder.cc
251276
+++ b/modules/video_coding/rtp_frame_reference_finder.cc
252277
@@ -48,9 +48,9 @@ RtpFrameReferenceFinder::ReturnVector RtpFrameReferenceFinderImpl::ManageFrame(
@@ -262,10 +287,10 @@ index a44b76bf15..695e161ba6 100644
262287

263288
switch (frame->codec_type()) {
264289
diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc
265-
index e875a5e109..fffcf92bcb 100644
290+
index c0b2001b13..25088f1562 100644
266291
--- a/video/rtp_video_stream_receiver2.cc
267292
+++ b/video/rtp_video_stream_receiver2.cc
268-
@@ -433,7 +433,7 @@ RtpVideoStreamReceiver2::ParseGenericDependenciesExtension(
293+
@@ -430,7 +430,7 @@ RtpVideoStreamReceiver2::ParseGenericDependenciesExtension(
269294
video_header->is_last_packet_in_frame =
270295
dependency_descriptor.last_packet_in_frame;
271296

@@ -274,7 +299,7 @@ index e875a5e109..fffcf92bcb 100644
274299
generic_descriptor_info.frame_id = frame_id;
275300
generic_descriptor_info.spatial_index =
276301
dependency_descriptor.frame_dependencies.spatial_id;
277-
@@ -490,7 +490,7 @@ RtpVideoStreamReceiver2::ParseGenericDependenciesExtension(
302+
@@ -487,7 +487,7 @@ RtpVideoStreamReceiver2::ParseGenericDependenciesExtension(
278303
? VideoFrameType::kVideoFrameKey
279304
: VideoFrameType::kVideoFrameDelta;
280305

@@ -283,7 +308,18 @@ index e875a5e109..fffcf92bcb 100644
283308
int64_t frame_id =
284309
frame_id_unwrapper_.Unwrap(generic_frame_descriptor.FrameId());
285310
generic_descriptor_info.frame_id = frame_id;
286-
@@ -620,12 +620,12 @@ bool RtpVideoStreamReceiver2::OnReceivedPayloadData(
311+
@@ -620,8 +620,8 @@ bool RtpVideoStreamReceiver2::OnReceivedPayloadData(
312+
}
313+
314+
std::optional<int> spatial_id;
315+
- if (video_header.generic.has_value()) {
316+
- spatial_id = video_header.generic->spatial_index;
317+
+ if (video_header.generic_.has_value()) {
318+
+ spatial_id = video_header.generic_->spatial_index;
319+
if (spatial_id >= kMaxSpatialLayers) {
320+
RTC_LOG(LS_WARNING) << "Invalid spatial id: " << *spatial_id
321+
<< ". Ignoring corruption detection mesaage.";
322+
@@ -676,12 +676,12 @@ bool RtpVideoStreamReceiver2::OnReceivedPayloadData(
287323
"frame descriptor, but it is missing.";
288324
} else {
289325
if (video_header.is_first_packet_in_frame) {
@@ -299,10 +335,10 @@ index e875a5e109..fffcf92bcb 100644
299335
loss_notification_controller_->OnReceivedPacket(
300336
rtp_packet.SequenceNumber(), &frame);
301337
} else {
302-
@@ -838,7 +838,7 @@ void RtpVideoStreamReceiver2::OnAssembledFrame(
338+
@@ -895,7 +895,7 @@ void RtpVideoStreamReceiver2::OnAssembledFrame(
303339
RTC_DCHECK(frame);
304340

305-
const absl::optional<RTPVideoHeader::GenericDescriptorInfo>& descriptor =
341+
const std::optional<RTPVideoHeader::GenericDescriptorInfo>& descriptor =
306342
- frame->GetRtpVideoHeader().generic;
307343
+ frame->GetRtpVideoHeader().generic_;
308344

0 commit comments

Comments
 (0)