On 29/12/2013 15:29, Han Wang wrote:

> By the way, in the bin->dexedLibs, I see there is a webrtc.jar lib. Is
> that mean the GeckoView library also support WebRTC as fennec?

Yes, as in, the code to do WebRTC is part of Gecko. That JAR contains
some supporting Java code for the camera driver.

The WebRTC code does need some support from the Android part of the
application:

1) Needs to be able to ask for permission to use the camera. (I see you
ran into this from your later messages, the "DoorHanger" is the message
containing the permission prompt to the user.)

2) Needs an Android SurfaceView or TextureView so it can attach the
camera driver:
http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApp.java#1381
Because of Android limitations especially on < Android 4.0, this Surface
must be "visible", but you can use tricks to make it hidden/invisible
again on most phones, e.g.:
http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApp.java#1788
I think on the newest Android versions you can even do "cameraView = new
TextureView(123); and have it work - it depends which Android phones you
want to support.

3) The Camera driver needs to know when you rotate the phone or leave
the GeckoView application:
http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/BaseGeckoInterface.java#101
http://dxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoAppShell.java#2127

-- 
GCP
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to