Closed Bug 830942 Opened 7 years ago Closed 7 years ago

getUserMedia fails to use video capture devices because it doesn't attach to a JVM

Categories

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

ARM
Android
defect

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: dmose, Assigned: dmose)

References

(Blocks 1 open bug)

Details

(Whiteboard: [getUserMedia] [blocking-gum-][android-trunk-needed][android-gum+][qa-])

Attachments

(1 file, 5 obsolete files)

Various sorts of logging shows failures around NumberOfCaptureDevices and its descendents because we're not yet building and packing the appropriate Java classes and then configuring them with SetAndroidObjects.
Depends on: 812650
Summary: attempting to enumerate capture devices fails because Android JNI classes not built and configured → getUserMedia fails to use video capture devices because Android JNI classes not built and configured
Before we land this, we're going to want to do some stuff to make sure that everything's suitably compatible between WebRTC code and Fennec expectations
around

* threading models (and stuff that comes from the JNIEnv?)
* why Fennec's activity context is needed/used by the WebRTC code, and how Android's behavior around killing activities will come into play
Doesn't block gum desktop release, obviously needed for Android
Priority: -- → P2
Whiteboard: [getUserMedia] [blocking-gum-]
Summary: getUserMedia fails to use video capture devices because Android JNI classes not built and configured → getUserMedia fails to use video capture devices because it doesn't attach to a JVM
Updated patch. Watching logcat on a build with this patch (and a few other less relevant ones) reveals:

D/*WEBRTCN*( 3550): SetAndroidObjects: could not find java class

which is being worked on over in bug 835973.
Attachment #706619 - Attachment is obsolete: true
Attachment #707777 - Attachment description: WIP patch to wire up the Java objects for capture, v2 → WIP patch to wire up the JVM for capture, v2
Tweaks some of the logging to be a bit clearer.  Practically speaking, these changes are really part of bug 835973.
Attachment #707777 - Attachment is obsolete: true
Blocks: 835973
Updates from GCP to actually call GetContext rather than passing in a null context, now that we've got a working GetContext patch.
Attachment #707895 - Attachment is obsolete: true
Updated to call the newly renamed GetGlobalContextRef so that we get a symbol that continues to be valid for other threads, and remove unnecessary logging changes.
Attachment #708780 - Attachment is obsolete: true
Landed on alder:

https://hg.mozilla.org/projects/alder/rev/92e321a18e82

Next steps: rebase to trunk, fix global context reference leak, request review.
Whiteboard: [getUserMedia] [blocking-gum-] → [getUserMedia] [blocking-gum-][android-trunk-needed]
Attachment #712202 - Attachment description: WIP patch to wire up JVM for gUM capture, v5 → WIP patch to wire up JVM for gUM capture, v5 (landed on alder)
Before landing on trunk, we'll also need to fix the fact that this breaks FirefoxOS:

/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:33:27: error: AndroidBridge.h: No such file or directory
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp: In member function 'virtual void mozilla::MediaEngineWebRTC::EnumerateVideoDevices(nsTArray<nsRefPtr<mozilla::MediaEngineVideoSource> >*)':
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:49: error: 'mozilla::AndroidBridge' has not been declared
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:52: error: 'JavaVM' was not declared in this scope
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:52: error: 'jvm' was not declared in this scope
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:52: error: 'mozilla::AndroidBridge' has not been declared
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:55: error: 'JNIEnv' was not declared in this scope
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:55: error: 'env' was not declared in this scope
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:56: error: 'jint' was not declared in this scope
/builds/slave/a-ics-armv7a-g-dbg/build/content/media/webrtc/MediaEngineWebRTC.cpp:56: error: expected ';' before 'res'

Should be some simple ifdef tweaking.
Whiteboard: [getUserMedia] [blocking-gum-][android-trunk-needed] → [getUserMedia] [blocking-gum-][android-trunk-needed][android-gum+]
Rebased, fixed the leaks by deleting the reference immediately after use, and removing the unused static global one.
Attachment #712202 - Attachment is obsolete: true
Attachment #731886 - Flags: review?(blassey.bugs)
Attachment #731886 - Flags: review?(blassey.bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/22cd5ee33178
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Whiteboard: [getUserMedia] [blocking-gum-][android-trunk-needed][android-gum+] → [getUserMedia] [blocking-gum-][android-trunk-needed][android-gum+][qa-]
You need to log in before you can comment on or make changes to this bug.