FORUMS
Remove All Ads from XDA

Modding the camera driver to use FFC for video chat

123 posts
Thanks Meter: 15
 
By reelportal, Senior Member on 9th February 2011, 01:07 AM
Post Reply Email Thread
Android 2.3 provides 2 methods to open the camera (link):

1) open()
2) open(cameraId)

Method 2) is new to Android 2.3, but not many apps use it yet. Method 1) is provided in Android 2.2, which many video chats app uses. Unfortunately, it is hardcoded to access the rear camera:

public static Camera open() {
int numberOfCameras = getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for (int i = 0; i < numberOfCameras; i++) {
getCameraInfo(i, cameraInfo);
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
return new Camera(i);
}
}
return null;
}

I would like change this logic so that it read in the camera index from some file, e.g. defaultCamera.txt, so the user can change the default cam any time without recompiling.

For someone who has compiled Android before, it would be easy to make this mod. Unfortunately, I don't have the resources to do it.

Any takers out there?
The Following User Says Thank You to reelportal For This Useful Post: [ View ] Gift reelportal Ad-Free
 
 
14th February 2011, 06:56 PM |#2  
Account currently disabled
Flag Brooklyn
Thanks Meter: 7
 
Donate to Me
More
Can't you just use Fring?
14th February 2011, 07:58 PM |#3  
OP Senior Member
Flag Los Angeles
Thanks Meter: 15
 
More
Quote:
Originally Posted by James_Caliber

Can't you just use Fring?

If Fring works on 2.3, then I'd say it's one of a very few apps that are using the 2) method above. However, most other apps are still using the 1) method.

One of them is Adobe AIR 2.5.1, which my ReelPortal app depends on. So while waiting for Adobe to update it's AIR runtime to use the new 2) method, I figured it may be possible to change the underlying Android 2.3 to works with older software by modifying method 1).

You are probably wondering why don't I just abandon AIR. It'd be a lot of rework that I can't afford to do, and more importantly, AIR allows my software to run on multiple platforms. Currently my app runs on PCs, Android, and Blackberry Playbook (simulator). But I anticipate it to work on WebOS when that's out. And potentially iPhone/iPad as well if/when Adobe and Apple play nice w/ each other.
The Following User Says Thank You to reelportal For This Useful Post: [ View ] Gift reelportal Ad-Free
15th February 2011, 01:20 AM |#4  
Senior Member
Thanks Meter: 33
 
More
Quote:
Originally Posted by James_Caliber

Can't you just use Fring?


Haven't used Fring but Tango uses the front camera. And exceptionally well even on 3G.
The Following User Says Thank You to jonjon68 For This Useful Post: [ View ] Gift jonjon68 Ad-Free
15th February 2011, 02:04 AM |#5  
Senior Member
Thanks Meter: 1,116
 
Donate to Me
More
Quote:
Originally Posted by reelportal

Android 2.3 provides 2 methods to open the camera (link):

1) open()
2) open(cameraId)

Method 2) is new to Android 2.3, but not many apps use it yet. Method 1) is provided in Android 2.2, which many video chats app uses. Unfortunately, it is hardcoded to access the rear camera:

public static Camera open() {
int numberOfCameras = getNumberOfCameras();
CameraInfo cameraInfo = new CameraInfo();
for (int i = 0; i < numberOfCameras; i++) {
getCameraInfo(i, cameraInfo);
if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) {
return new Camera(i);
}
}
return null;
}

I would like change this logic so that it read in the camera index from some file, e.g. defaultCamera.txt, so the user can change the default cam any time without recompiling.

For someone who has compiled Android before, it would be easy to make this mod. Unfortunately, I don't have the resources to do it.

Any takers out there?

This would probably be very easy to do. I'll take a look at it
16th February 2011, 04:40 PM |#6  
charlieb620's Avatar
Senior Member
Flag Philadelphia
Thanks Meter: 2,899
 
More
im sure i can speak for everybody when i say we would rather use skype. the update needs to come quick.
17th February 2011, 06:52 PM |#7  
OP Senior Member
Flag Los Angeles
Thanks Meter: 15
 
More
Quote:
Originally Posted by charlieb620

im sure i can speak for everybody when i say we would rather use skype. the update needs to come quick.

I wouldn't say "everybody", but I'd agree most people would use what they are used to. My software is designed to be more flexible for unconventional use.

For example, when both front and back cameras are fully supported by the underlying layers (AIR or Android), it would be possible to stream from both cameras simultaneously. So you can place the phone on a table for a video conference call, and the other side will see everyone at the front and back. I'm just thinking out loud here, as I hadn't actually done it with any phone yet.
17th February 2011, 07:18 PM |#8  
kenvan19's Avatar
Senior Member
Thanks Meter: 549
 
Donate to Me
More
Quote:
Originally Posted by charlieb620

im sure i can speak for everybody when i say we would rather use skype. the update needs to come quick.

Thats not necessary man. reelportal is trying to develop an alternative that has other uses as well and telling him that others do it better is just rude.

Quote:
Originally Posted by reelportal

I wouldn't say "everybody", but I'd agree most people would use what they are used to. My software is designed to be more flexible for unconventional use.

For example, when both front and back cameras are fully supported by the underlying layers (AIR or Android), it would be possible to stream from both cameras simultaneously. So you can place the phone on a table for a video conference call, and the other side will see everyone at the front and back. I'm just thinking out loud here, as I hadn't actually done it with any phone yet.

Keep up the work man, some fools man not see the point in trying to do what hasn't been done but I appreciate your effort.
The Following User Says Thank You to kenvan19 For This Useful Post: [ View ] Gift kenvan19 Ad-Free
17th February 2011, 07:55 PM |#9  
OP Senior Member
Flag Los Angeles
Thanks Meter: 15
 
More
Quote:
Originally Posted by kenvan19

Thats not necessary man. reelportal is trying to develop an alternative that has other uses as well and telling him that others do it better is just rude.



Keep up the work man, some fools man not see the point in trying to do what hasn't been done but I appreciate your effort.

Thanks for the support. Sometimes it's hard to get new ideas across to everyone. ReelPortal as it is right now is just a foundation for the stuff that I want to add on later, so there's a lot of work ahead for me.
21st February 2011, 08:03 PM |#10  
charlieb620's Avatar
Senior Member
Flag Philadelphia
Thanks Meter: 2,899
 
More
I'm not saying what he is doing is irrelevant I'm talking about the availible video chat apps that our phone can use. I was not being rude. I'm speaking for people that would like to use other choices besides tango because android didn't develop much for our phones

Sent from my Nexus S using XDA App
21st February 2011, 08:07 PM |#11  
charlieb620's Avatar
Senior Member
Flag Philadelphia
Thanks Meter: 2,899
 
More
I support you as well that's why I better clarified what I said. i would like to see this as well

Sent from my Nexus S using XDA App
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes