[Galaxy S II Android Development] Sinbios:
Found the cause of the video recording problem I reported before:

https://github.com/Bajee11/android_device_samsung_galaxys2/blob/jb/camera/CameraWrapper.cpp

Specifically the camera_fixup_getparams function:

static char * camera_fixup_getparams(int id, const char * settings)
{
android::CameraParameters params;
params.unflatten(android::String8(settings));

[B] params.remove(android::CameraParameters::KEY_SUPPORTED_VIDEO_SIZES);[/B]

if(params.get("cam_mode"))
{
params.set(android::CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES, video_preview_sizes[id]);
const char* videoSize = params.get(android::CameraParameters::KEY_VIDEO_SIZE);
params.set(android::CameraParameters::KEY_PREVIEW_SIZE, videoSize);
}

params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]);

android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string());

ALOGD("%s: get parameters fixed up", __FUNCTION__);
return ret;
}

The list of supported video sizes is explicitly removed from the parameters. It is added back in camera_fixup_setparams, but only if cam_mode is set which doesn't seem to be the case for the back camera:

char * camera_fixup_setparams(int id, const char * settings)
{
android::CameraParameters params;
params.unflatten(android::String8(settings));

[B] if(params.get("cam_mode"))
{
const char* previewSize = params.get(android::CameraParameters::KEY_PREVIEW_SIZE);
params.set(android::CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO, previewSize);
params.set(android::CameraParameters::KEY_SUPPORTED_VIDEO_SIZES, video_preview_sizes[id]);
}[/B]

if(params.get("iso")) {
const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE);
if(strcmp(isoMode, "ISO50") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "50");
else if(strcmp(isoMode, "ISO100") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "100");
else if(strcmp(isoMode, "ISO200") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "200");
else if(strcmp(isoMode, "ISO400") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "400");
else if(strcmp(isoMode, "ISO800") == 0)
params.set(android::CameraParameters::KEY_ISO_MODE, "800");
}

android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string());

ALOGD("%s: set parameters fixed up", __FUNCTION__);
return ret;
}

I assume the idea here is to make the list of supported video sizes match the list of supported preview sizes.

The problem here is the KEY_SUPPORTED_VIDEO_SIZES parameter is removed and never added back if cam_mode is not set. I'm not sure where this parameter is supposed to be set and which component is supposed to set it.

This is a problem because the setVideoSize() function in MediaRecorder relies on this parameter to determine whether the camera supports a specified resolution or if the function is even supported. Hence the following errors:

09-26 13:15:54.636: D/CameraSource(8675): Camera does not support setVideoSize()
09-26 13:15:54.636: E/CameraSource(8675): Video dimension (1920x1080) is unsupported

My suspicion is the line which removes the KEY_SUPPORTED_VIDEO_SIZES parameter should be shifted down into the if(params.get("cam_mode")) scope, so that it is only removed if it will be added back later.

Bajee11, I'm not familiar with the organization of the repository or the proper channels to contact the developers. If you could look into this issue and escalate upstream or point me towards someone to escalate this with that would be great.