Camera Framework Issue

All your problems with Audio, Video and Images.

Camera Framework Issue

Postby sanzeiev » Sat Apr 10, 2010 1:43 pm

Getting Camera Failed Error due to successively calling onPause() and onResume() method in the camera.

Here the crash log.
V/Camera ( 4759): onResume V/CameraEngine( 4759): changeEngineState D/CameraEngine( 4759): => 0 V/CameraEngine( 4759): scheduleStartEngine V/CeRequestQueue( 4759): addRequest D/CeRequestQueue( 4759): [0 ] V/CeRequestQueue( 4759): sending START_FIRST_REQUEST V/CameraEngine( 4759): schedulePostInit V/CeRequestQueue( 4759): addRequest D/CeRequestQueue( 4759): [0 2 ] V/CameraEngine( 4759): scheduleSetAllParams V/CeRequestQueue( 4759): addRequest D/CeRequestQueue( 4759): [0 2 9 ]
V/CameraEngine( 4759): scheduleWait: 1mili seconds V/CeRequestQueue( 4759): addRequest D/CeRequestQueue( 4759): [0 2 9 12 ] V/CameraEngine( 4759): scheduleStartPreview V/CeRequestQueue( 4759): addRequest D/CeRequestQueue( 4759): [0 2 9 12 3 ] E/Camera ( 4759): Initialize Camera Sound
V/CeRequestQueue( 4759): startFirstRequest V/CeStateIdle( 4759): HandleRequest - 0 V/CameraEngine( 4759): doStartEngineAsync V/CameraEngine( 4759): changeEngineState D/CameraEngine( 4759): => 1 V/CameraEngine( 4759): got message...{ what=101 when=5494308 } V/CeStateInitializing( 4759): HandleMessage - 101 V/CameraEngine( 4759): opening camera device... E/SecCamera-JNI-Java( 4759): SecCamera.open() E/SecCamera-JNI-Java( 4759): SecCamera() V/SecCamera-JNI-Cpp( 4759): native_setup V/MediaPlayerService( 2186): wait for prepare V/MediaPlayerService( 2186): start V/MediaPlayerService( 2186): wait for playback complete D/CameraService( 2186): CameraService::connect E (pid 4759, client 0x859698) D/CameraService( 2186): CameraService::connect X (pid 4759, new client 0x859698) rejected. (old pid 4759, old client 0x6bd478) V/MediaPlayerService( 2186): return memory @ 0x433fa000, sampleRate=44100, channelCount = 1, format = 1 E/CameraEngine( 4759): service cannot connect. critical exception occured.

Here is the code of connect method in CameraService.cpp.

sp<ICamera> CameraService::connect(const sp<ICameraClient>& cameraClient)
{
int callingPid = getCallingPid();
LOGD("CameraService::connect E (pid %d, client %p)", callingPid,
cameraClient->asBinder().get());

Mutex::Autolock lock(mServiceLock);
sp<Client> client;
if (mClient != 0) {
sp<Client> currentClient = mClient.promote();
if (currentClient != 0) {
sp<ICameraClient> currentCameraClient(currentClient->getCameraClient());
if (cameraClient->asBinder() == currentCameraClient->asBinder()) {
// This is the same client reconnecting...
LOGD("CameraService::connect X (pid %d, same client %p) is reconnecting...",
callingPid, cameraClient->asBinder().get());
return currentClient;
} else {
// It's another client... reject it
LOGD("CameraService::connect X (pid %d, new client %p) rejected. "
"(old pid %d, old client %p)",
callingPid, cameraClient->asBinder().get(),
currentClient->mClientPid, currentCameraClient->asBinder().get());
if (kill(currentClient->mClientPid, 0) == -1 && errno == ESRCH) {
LOGD("The old client is dead!");
}
return client;
}
} else {
// can't promote, the previous client has died...
LOGD("New client (pid %d) connecting, old reference was dangling...",
callingPid);
mClient.clear();
}
}

if (mUsers > 0) {
LOGD("Still have client, rejected");
return client;
}

// create a new Client object
client = new Client(this, cameraClient, callingPid);
mClient = client;
#if DEBUG_CLIENT_REFERENCES
// Enable tracking for this object, and track increments and decrements of
// the refcount.
client->trackMe(true, true);
#endif
LOGD("CameraService::connect X");
return client;
}
sanzeiev
Freshman
Freshman
 
Posts: 8
Joined: Wed Jul 22, 2009 6:08 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 24 guests