EricssonResearch / openwebrtc-android-sdk

SDK for adding OpenWebRTC to your Android app
BSD 2-Clause "Simplified" License
45 stars 29 forks source link

Starting FlashLight #10

Open onlyway opened 9 years ago

onlyway commented 9 years ago

Hi, I have problem to find where is initialisation of the camera in SDK. I need to start a flashlight and I can't figured out where to find it. I need camera variable to make it so.

Rugvip commented 9 years ago

This is very tricky to implement at the moment, as the camera object is hidden quite deep in the jni layer in the GStreamer plugin https://github.com/EricssonResearch/openwebrtc-gst-plugins/blob/e09bfa127e59cd76b2bb0571258aadcdcce966e6/sys/androidvideo/video-source/jni/android_video_capture_device.c#L2326

There might be some good way to expose the object, but nothing is implemented at the moment.

superdump commented 9 years ago

Might it be simpler to use existing Android APIs to control the flash rather than exposing it through all the layers?

Rugvip commented 9 years ago

Not possible, you need to have a reference to the camera object to be able to start the flashlight. "Your application should only have one Camera object active at a time for a particular hardware camera."

onlyway commented 9 years ago

Thanx for your answer, I think it's not worth it for know for me to go such deep to make it work. But thank you for information where to look it for :)