As a workaround I modified LinphoneManager.m "startup()" by calling a separate new method that does a full match with iOS camera list. This is a bit ugly as the name is modified by the upper layers. Maybe mediastreamer should provide nonlocalized names for the cameras.
- (void)detectCameras {
/* First get real cameras */
NSArray *devices = [AVCaptureDevice devices];
const char *frontCamera = NULL;
const char *backCamera = NULL;
for (AVCaptureDevice *device in devices) {
NSLog(@"Device name: %@", [device localizedName]);
if ([device hasMediaType:AVMediaTypeVideo]) {
if ([device position] == AVCaptureDevicePositionBack) {
backCamera = [[@"AV Capture: " stringByAppendingString:
device.localizedName] UTF8String];
}
else {
frontCamera = [[@"AV Capture: " stringByAppendingString:device.localizedName] UTF8String];
}
}
}
/* Match cameras to linphone, which uses localizedName as the device id */
frontCamId = backCamId = nil;
char **camlist = (char **) linphone_core_get_video_devices(theLinphoneCore);
for (char *cam = *camlist; *camlist != NULL; cam = *++camlist) {
if (frontCamera && strcmp(frontCamera, cam) == 0) {
frontCamId = cam;
linphone_core_set_video_device(theLinphoneCore, cam);
}
if (backCamera && strcmp(backCamera, cam) == 0) {
backCamId = cam;
}
}
}
----------------8<-----------------------------