Closed Bug 1451394 Opened 7 years ago Closed 2 years ago

Update video capture code on OS X

Categories

(Core :: WebRTC: Audio/Video, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

It looks like the code in [1] is old (pre webrtc.org 57 merge) and does no longer exist upstream. The current upstream for android capture seems to be [2]. We should also check whether we sit on similar outdated implementations for other platforms, even the ones where webrtc.org holds an implementation, it might be outdated. [1] https://searchfox.org/mozilla-central/rev/a0665934fa05158a5a943d4c8b277465910c029c/media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/webrtc/videoengine/VideoCaptureAndroid.java [2] https://cs.chromium.org/chromium/src/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
Rank: 15
Priority: -- → P2
Blocks: 1457857
Another thing to check out are the devicechange event handlers added to media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc

Chromium has stopped using the webrtc.org video capture code and now uses it's own variant (under src/media/capture). We need to decide whether we want to continue using the webrtc.org code, which is not being actively maintained by upstream or do the work to switch to using the Chromium video capture code.

If we stick with the webrtc.org code, we're stuck doing the maintenance and updates, which could be substantial. For instance, the webrtc.org code does not support MediaFoundation on Windows, which caused problems with using the camera on aarch64 windows. It does appear that Safari uses the webrtc.org code, for instance Bug 1530792 reproduces on Safari, but not Chrome.

If we switch to using the Chromium code, we're stuck depending upon another internal API over which we have no control. Offhand, I'd say it's even less likely we'll be able to upstream our local changes to Chromium than to webrtc.org. We would have to evaluate how much internal Chromium code the capture code depends upon. This could end up basically being a fork rather than something we can update from on a regular basis.

I'm changing the summary to emphasize this is not an update, but a complete switchover.

Summary: Update camera capture modules to new upstream → Consider switching to Chromium video capture code

I take back what I said about Bug 1530792, I can't get Safari to give me an option of what webcam to use, and the builtin camera on my Macbook is not capable of 1920x1280.

It does appear that Safari uses the webrtc.org code, for instance Bug 1530792 reproduces on Safari, but not Chrome.

WebKit does not use libwebrtc for capture. The capture code for the macOS and iOS ports are here, the code for the GTK port is here.

If bug 1530792 reproduced in Safari (it works in TOT), it must have been a conicidence.

(In reply to Eric Carlson from comment #6)

It does appear that Safari uses the webrtc.org code, for instance Bug 1530792 reproduces on Safari, but not Chrome.

WebKit does not use libwebrtc for capture. The capture code for the macOS and iOS ports are here, the code for the GTK port is here.

If bug 1530792 reproduced in Safari (it works in TOT), it must have been a conicidence.

Yes, that was my mistake, I was testing with the builtin camera on my Macbook, which is not capable of the higher resolutions. Thanks for the clarification.

The OS X video capture code which we are using has also been removed from upstream [1]. The Windows and Linux code seems to be maintained, however.

[1] https://webrtc-review.googlesource.com/c/src/+/124828

I updated the Android camera code in Bug 1578073, so let's make this one about updating OS X.

Summary: Consider switching to Chromium video capture code → Consider switching to Chromium video capture code for OS X
See Also: → 1631803

There is OS X video capture code in libwebrtc here: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/sdk/objc/components/capturer/RTCCameraVideoCapturer.m. That will probably be easier than switching to Chromium's code.

No longer blocks: webrtc_upstream_bugs
Severity: normal → S3
Priority: P2 → P3
Summary: Consider switching to Chromium video capture code for OS X → Update video capture code on OS X
Blocks: 1681334
Depends on: 1688216
Blocks: 1688216
No longer depends on: 1688216
Priority: P3 → P2
No longer blocks: 1457857
See Also: → 1731520
Blocks: 1731520
See Also: 1731520

There were no updates for quite a while. Unfortunately, that bug makes Firefox unusable for a good portion of users who want to capture a Full HD webcam.

Are there any plans to update libwebrtc?

I plan to integrate the newer libwebrtc camera backend for mac, to see what that gets us.

Assignee: nobody → apehrson
Status: NEW → ASSIGNED

This is quite ready to go up for review, but I want to have it hooked up to the PerformanceRecorder before pushing.

Depends on: 1796069
Severity: S3 → N/A
Rank: 15
Depends on: 1800920
No longer depends on: 1800920
Pushed by pehrsons@gmail.com: https://hg.mozilla.org/integration/autoland/rev/1f6355b0d42c Fix LogCapability's video type logging in MediaEngineRemoteVideoSource. r=webrtc-reviewers,mjf https://hg.mozilla.org/integration/autoland/rev/b06588889693 Expose mac camera capture backend in .gn and switch it to gecko libyuv. r=webrtc-reviewers,mjf https://hg.mozilla.org/integration/autoland/rev/49002523b70d Update generated files. r=webrtc-reviewers,mjf https://hg.mozilla.org/integration/autoland/rev/703360f0b861 Integrate with the libwebrtc camera backend for Mac. r=webrtc-reviewers,jib https://hg.mozilla.org/integration/autoland/rev/04d6fcc72269 Enable new Mac camera backend in Nightly and early Beta. r=webrtc-reviewers,jib https://hg.mozilla.org/integration/autoland/rev/a7362238c9e6 Record video frame captures with PerformanceRecorder in the new mac camera backend. r=padenot
No longer blocks: 1376873
Regressions: 1806521
Blocks: 1806604
Blocks: 1806605
Blocks: 1806606
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: