Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I have an application that can set a cell phone's built-in camera in preview mode and display preview images on the screen. The existing application works perfectly for Motorola v710 (BREW 2.1). However, it no longer works for Motorola v325 (BREW 3.1)

I have already recompiled my application with BREW SDK 3.1.2 and added the related ICamera dependency information in the MIF editor. According to the debug information I received, the ICamera interface has been created successfully, the ICAMERA_RegisterNotify has been invoked successfully, the ICamera interface has been set to preview mode ( w= 176, h = 120) successfully and the ICAMERA_Preview() has been invoked successfully.

However, I could only receive a single "CAM_STATUS_START" message in my registered call back function. No "CAM_STATUS_FRAME" is received :-(

Can someone give me some hints on how to fix this problem ? Thanks a lot !

Has anyone here successfully run any ICamera related code on Motorola v325 ?

Has anyone here successfully run any ICamera related code on Motorola v325 ?

FYI, related source code posted here.
bool CBrewCamera::CreateInstance()
{
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_CAMERA, (void **)&m_pICamera) != SUCCESS)
{
DBGPRINTF( "ICAMERA CreateInstance Error");
return false;
}
if( ICAMERA_RegisterNotify(m_pICamera, CBrewCamera::HandleEvent, this) != SUCCESS)
{
DBGPRINTF( "ICAMERA Register Notify Error");
return false;
}
m_pBitmap = new CBrewBitmap();
m_pBitmap->PrepairDIB();
return true;

void CBrewCamera::SetSnapShotSize(int x, int y)
{
m_size.cx = x;
m_size.cy = y;

int CBrewCamera::StartPreview()
{
AEEDeviceInfo m_di;
ISHELL_GetDeviceInfo(m_pIShell,&m_di);
// SetPreviewSize( m_di.cxScreen, m_di.cyScreen);
// SetPreviewSize( 176, 220);
SetPreviewSize( 176, 120);
int nErr = ICAMERA_SetDisplaySize(m_pICamera, &m_sizePreview);
if (nErr)
{
DBGPRINTF("Error in setting DisplaySize nErr=%d\n", nErr);
return nErr;
}
nErr = ICAMERA_Preview(m_pICamera);
if (nErr)
{
DBGPRINTF("Error in calling Preview nErr=%d\n", nErr);
return nErr;
}
m_cameramode = CAMERA_PREVIEW;
return 0;

void CBrewCamera::HandleEvent(void * pUser, AEECameraNotify * pn)
{
CBrewCamera * pme = (CBrewCamera *)pUser;
if (!pme || !pn)
{
DBGPRINTF("Null Pointer Error\n");
return;
}
pme->OnHandleEvent( pn);

void CBrewCamera::OnHandleEvent(AEECameraNotify * pn)
{
DBGPRINTF("## CBrewCamera::OnHandleEvent() ");
DBGPRINTF("#### Status = %d", pn->nStatus );
switch (pn->nStatus)
{
case CAM_STATUS_START:
m_cameramode = CAMERA_PREVIEW;
DBGPRINTF("#### CAMERA_PREVIEW" );
// Preview has begun...
break;
case CAM_STATUS_FRAME:
{
DBGPRINTF("#### CAM_STATUS_FRAME" );
IBitmap * pFrame;
AEEBitmapInfo bi;
//
// IMPORTANT NOTE: You need to do IBITMAP_Release(pFrame) after you're done with pFrame.
//
if (SUCCESS != ICAMERA_GetFrame(m_pICamera, &pFrame))
{
DBGPRINTF("Error in getting Preview Frame\n");
return;
}
m_pBitmap->AttachBitmap( pFrame);
UpdatePreviewImageReady( m_pBitmap );
m_pBitmap->ReleaseResource();
break;
}
case CAM_STATUS_DONE:
if(pn->nCmd == CAM_CMD_START && pn->nSubCmd == CAM_MODE_PREVIEW)
{
if (m_cameramode == CAMERA_PREVIEW_TO_SNAPSHOT )
{
m_cameramode = CAMERA_READY;
SnapShot();
return;
}
}
IBitmap * pFrame;
if (pn->nCmd == CAM_CMD_START && pn->nSubCmd == CAM_STATUS_DONE)
{
if (m_cameramode == CAMERA_SNAPSHOT)
{
if (SUCCESS != ICAMERA_GetFrame(m_pICamera, &pFrame))
{
// Error();
return;
}
// m_pBitmap->AttachBitmap( pFrame);
// UpdateSnapShotImageReady( m_pBitmap );
return;
}
}
if (pn->nCmd == CAM_CMD_ENCODESNAPSHOT)
{
// StartCameraInPreviewMode(pMe);
m_cameramode = CAMERA_READY;
if (m_bRestorePreview)
{
AEEDeviceInfo di;
ISHELL_GetDeviceInfo(m_pIShell, &di);
IDISPLAY_EraseRgn(((AEEApplet *)GETAPPINSTANCE())->m_pIDisplay, 0, 0, di.cxScreen, di.cyScreen);
StartPreview();
}
UpdateSnapShotImageReady( m_filename );
}
// ICAMERA_Stop() was called and preview operation stopped.
break;
case CAM_STATUS_ABORT:
DBGPRINTF("#### CAM_STATUS_ABORT" );
// Preview got aborted.
break;
}

int CBrewCamera::PausePreview(void)
{
int nResult = ICAMERA_Pause(m_pICamera);
return nResult;

int CBrewCamera::ResumePreview(void)
{
int nResult = ICAMERA_Resume(m_pICamera);
return nResult;

int CBrewCamera::Stop(void)
{
int nResult = ICAMERA_Stop(m_pICamera);
return nResult;

int CBrewCamera::SnapShot(void)
{
int nRet;
if ( m_cameramode == CAMERA_PREVIEW )
{
ICAMERA_Stop(m_pICamera);
m_cameramode = CAMERA_PREVIEW_TO_SNAPSHOT;
m_bRestorePreview = TRUE;
return CAMERA_PREVIEW_STOPPED;
}
m_MediaData.clsData = MMD_FILE_NAME;
SPRINTF( m_filename, "snapshot%d.jpg", m_nImageIndex++);
m_MediaData.pData = (void *)m_filename;
m_MediaData.dwSize = 0;
if ((nRet = ICAMERA_SetMediaData( m_pICamera, &m_MediaData, MT_JPEG)) != SUCCESS)
{
DBGPRINTF("ICAMERA_SetMediaData returns FALSE[%d]\n", nRet);
return CAMERA_SET_MEDIADATA_FAILED;
}
if ((nRet = ICAMERA_SetSize(m_pICamera, &m_size)) != SUCCESS)
{
DBGPRINTF("ICAMERA_SetSize returns FALSE[%d]\n", nRet);
return CAMERA_SETSIZE_FAILED;
}
DBGPRINTF("ICAMERA_SetSize returns SUCCESS[%d]\n", nRet);
if ((nRet = ICAMERA_SetVideoEncode(m_pICamera, AEECLSID_JPEG, 0)) != SUCCESS)
{
DBGPRINTF("ICAMERA_SetVideoEncode returns FALSE[%d]\n", nRet);
return CAMERA_SETVIDEOENCODE_FAILED;
}
DBGPRINTF("WE PASS ICAMERA_SetVideoEncode() RET[%d]\n", nRet);
if ((nRet = ICAMERA_RecordSnapshot(m_pICamera)) != SUCCESS)
{
DBGPRINTF("ICAMERA_RecordSnapshot returns FALSE[%d]\n", nRet);
return CAMERA_RECORDSNAPSHOT_FAILED;
}
DBGPRINTF("ICAMERA_RecordSnapshot returns SUCCESS[%d]\n", nRet);
m_cameramode = CAMERA_SNAPSHOT;
return CAMERA_SUCCESS;

int CBrewCamera::AttachObserver(ICameraObserver * pObserver)
{
m_Observers.append(pObserver);
return CAMERA_SUCCESS;

int CBrewCamera::DetachObserver(ICameraObserver * pObserver)
{
m_Observers.remove(pObserver);
return CAMERA_SUCCESS;

int CBrewCamera::Release(void)
{
return CAMERA_SUCCESS;

int CBrewCamera::UpdateSnapShotImageReady( const char * filename )
{
for ( int i = 0; i < m_Observers.size(); i++)
{
m_Observers[i]->SnapShotImageReady( filename );
}
return CAMERA_SUCCESS;

int CBrewCamera::UpdatePreviewImageReady( CBrewBitmap * pBitmap )
{
for ( int i = 0; i < m_Observers.size(); i++)
{
m_Observers[i]->PreviewImageReady( pBitmap );
}
return CAMERA_SUCCESS;

FYI, related source code posted here.
bool CBrewCamera::CreateInstance()
{
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_CAMERA, (void **)&m_pICamera) != SUCCESS)
{
DBGPRINTF( "ICAMERA CreateInstance Error");
return false;
}
if( ICAMERA_RegisterNotify(m_pICamera, CBrewCamera::HandleEvent, this) != SUCCESS)
{
DBGPRINTF( "ICAMERA Register Notify Error");
return false;
}
m_pBitmap = new CBrewBitmap();
m_pBitmap->PrepairDIB();
return true;

void CBrewCamera::SetSnapShotSize(int x, int y)
{
m_size.cx = x;
m_size.cy = y;

int CBrewCamera::StartPreview()
{
AEEDeviceInfo m_di;
ISHELL_GetDeviceInfo(m_pIShell,&m_di);
// SetPreviewSize( m_di.cxScreen, m_di.cyScreen);
// SetPreviewSize( 176, 220);
SetPreviewSize( 176, 120);
int nErr = ICAMERA_SetDisplaySize(m_pICamera, &m_sizePreview);
if (nErr)
{
DBGPRINTF("Error in setting DisplaySize nErr=%d\n", nErr);
return nErr;
}
nErr = ICAMERA_Preview(m_pICamera);
if (nErr)
{
DBGPRINTF("Error in calling Preview nErr=%d\n", nErr);
return nErr;
}
m_cameramode = CAMERA_PREVIEW;
return 0;

void CBrewCamera::HandleEvent(void * pUser, AEECameraNotify * pn)
{
CBrewCamera * pme = (CBrewCamera *)pUser;
if (!pme || !pn)
{
DBGPRINTF("Null Pointer Error\n");
return;
}
pme->OnHandleEvent( pn);

void CBrewCamera::OnHandleEvent(AEECameraNotify * pn)
{
DBGPRINTF("## CBrewCamera::OnHandleEvent() ");
DBGPRINTF("#### Status = %d", pn->nStatus );
switch (pn->nStatus)
{
case CAM_STATUS_START:
m_cameramode = CAMERA_PREVIEW;
DBGPRINTF("#### CAMERA_PREVIEW" );
// Preview has begun...
break;
case CAM_STATUS_FRAME:
{
DBGPRINTF("#### CAM_STATUS_FRAME" );
IBitmap * pFrame;
AEEBitmapInfo bi;
//
// IMPORTANT NOTE: You need to do IBITMAP_Release(pFrame) after you're done with pFrame.
//
if (SUCCESS != ICAMERA_GetFrame(m_pICamera, &pFrame))
{
DBGPRINTF("Error in getting Preview Frame\n");
return;
}
m_pBitmap->AttachBitmap( pFrame);
UpdatePreviewImageReady( m_pBitmap );
m_pBitmap->ReleaseResource();
break;
}
case CAM_STATUS_DONE:
if(pn->nCmd == CAM_CMD_START && pn->nSubCmd == CAM_MODE_PREVIEW)
{
if (m_cameramode == CAMERA_PREVIEW_TO_SNAPSHOT )
{
m_cameramode = CAMERA_READY;
SnapShot();
return;
}
}
IBitmap * pFrame;
if (pn->nCmd == CAM_CMD_START && pn->nSubCmd == CAM_STATUS_DONE)
{
if (m_cameramode == CAMERA_SNAPSHOT)
{
if (SUCCESS != ICAMERA_GetFrame(m_pICamera, &pFrame))
{
// Error();
return;
}
// m_pBitmap->AttachBitmap( pFrame);
// UpdateSnapShotImageReady( m_pBitmap );
return;
}
}
if (pn->nCmd == CAM_CMD_ENCODESNAPSHOT)
{
// StartCameraInPreviewMode(pMe);
m_cameramode = CAMERA_READY;
if (m_bRestorePreview)
{
AEEDeviceInfo di;
ISHELL_GetDeviceInfo(m_pIShell, &di);
IDISPLAY_EraseRgn(((AEEApplet *)GETAPPINSTANCE())->m_pIDisplay, 0, 0, di.cxScreen, di.cyScreen);
StartPreview();
}
UpdateSnapShotImageReady( m_filename );
}
// ICAMERA_Stop() was called and preview operation stopped.
break;
case CAM_STATUS_ABORT:
DBGPRINTF("#### CAM_STATUS_ABORT" );
// Preview got aborted.
break;
}

int CBrewCamera::PausePreview(void)
{
int nResult = ICAMERA_Pause(m_pICamera);
return nResult;

int CBrewCamera::ResumePreview(void)
{
int nResult = ICAMERA_Resume(m_pICamera);
return nResult;

int CBrewCamera::Stop(void)
{
int nResult = ICAMERA_Stop(m_pICamera);
return nResult;

int CBrewCamera::SnapShot(void)
{
int nRet;
if ( m_cameramode == CAMERA_PREVIEW )
{
ICAMERA_Stop(m_pICamera);
m_cameramode = CAMERA_PREVIEW_TO_SNAPSHOT;
m_bRestorePreview = TRUE;
return CAMERA_PREVIEW_STOPPED;
}
m_MediaData.clsData = MMD_FILE_NAME;
SPRINTF( m_filename, "snapshot%d.jpg", m_nImageIndex++);
m_MediaData.pData = (void *)m_filename;
m_MediaData.dwSize = 0;
if ((nRet = ICAMERA_SetMediaData( m_pICamera, &m_MediaData, MT_JPEG)) != SUCCESS)
{
DBGPRINTF("ICAMERA_SetMediaData returns FALSE[%d]\n", nRet);
return CAMERA_SET_MEDIADATA_FAILED;
}
if ((nRet = ICAMERA_SetSize(m_pICamera, &m_size)) != SUCCESS)
{
DBGPRINTF("ICAMERA_SetSize returns FALSE[%d]\n", nRet);
return CAMERA_SETSIZE_FAILED;
}
DBGPRINTF("ICAMERA_SetSize returns SUCCESS[%d]\n", nRet);
if ((nRet = ICAMERA_SetVideoEncode(m_pICamera, AEECLSID_JPEG, 0)) != SUCCESS)
{
DBGPRINTF("ICAMERA_SetVideoEncode returns FALSE[%d]\n", nRet);
return CAMERA_SETVIDEOENCODE_FAILED;
}
DBGPRINTF("WE PASS ICAMERA_SetVideoEncode() RET[%d]\n", nRet);
if ((nRet = ICAMERA_RecordSnapshot(m_pICamera)) != SUCCESS)
{
DBGPRINTF("ICAMERA_RecordSnapshot returns FALSE[%d]\n", nRet);
return CAMERA_RECORDSNAPSHOT_FAILED;
}
DBGPRINTF("ICAMERA_RecordSnapshot returns SUCCESS[%d]\n", nRet);
m_cameramode = CAMERA_SNAPSHOT;
return CAMERA_SUCCESS;

int CBrewCamera::AttachObserver(ICameraObserver * pObserver)
{
m_Observers.append(pObserver);
return CAMERA_SUCCESS;

int CBrewCamera::DetachObserver(ICameraObserver * pObserver)
{
m_Observers.remove(pObserver);
return CAMERA_SUCCESS;

int CBrewCamera::Release(void)
{
return CAMERA_SUCCESS;

int CBrewCamera::UpdateSnapShotImageReady( const char * filename )
{
for ( int i = 0; i < m_Observers.size(); i++)
{
m_Observers[i]->SnapShotImageReady( filename );
}
return CAMERA_SUCCESS;

int CBrewCamera::UpdatePreviewImageReady( CBrewBitmap * pBitmap )
{
for ( int i = 0; i < m_Observers.size(); i++)
{
m_Observers[i]->PreviewImageReady( pBitmap );
}
return CAMERA_SUCCESS;

I will post other parts of my source code if necessary

I will post other parts of my source code if necessary

Any ideas ? Still waiting for a solution now.
Thanks.

Any ideas ? Still waiting for a solution now.
Thanks.

with some help from BREW Technical Support. The camera works properly provided that there's an interval of at least 300 milliseconds between creating the ICamera instance and calling ICAMERA_Preview.
it will solve your problem.

with some help from BREW Technical Support. The camera works properly provided that there's an interval of at least 300 milliseconds between creating the ICamera instance and calling ICAMERA_Preview.
it will solve your problem.

Hi, Thanks a lot for your response. I added an additional function call MSLEEP(500);
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_CAMERA, (void **)&m_pICamera) != SUCCESS)
{
DBGPRINTF( "ICAMERA CreateInstance Error");
return false;
}
MSLEEP(500);
if( ICAMERA_RegisterNotify(m_pICamera, CBrewCamera::HandleEvent, this) != SUCCESS)
{
DBGPRINTF( "ICAMERA Register Notify Error");
return false;
}
after calling ISHELL_CreateInstance, but the situation is still not changed :-( . Debugging information/error messages are still the same as before.
Can you show me your correctly working code ?

Hi, Thanks a lot for your response. I added an additional function call MSLEEP(500);
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_CAMERA, (void **)&m_pICamera) != SUCCESS)
{
DBGPRINTF( "ICAMERA CreateInstance Error");
return false;
}
MSLEEP(500);
if( ICAMERA_RegisterNotify(m_pICamera, CBrewCamera::HandleEvent, this) != SUCCESS)
{
DBGPRINTF( "ICAMERA Register Notify Error");
return false;
}
after calling ISHELL_CreateInstance, but the situation is still not changed :-( . Debugging information/error messages are still the same as before.
Can you show me your correctly working code ?

ISHELL_SetTimer(GET_ISHELL,500,(PFNNOTIFY)Camera_Preview,(void*)(*pApp));
void Camera_Preview(void* pUser)
{
.........
..........
ICAMERA_Preview((pApp)->pICamera);
}

ISHELL_SetTimer(GET_ISHELL,500,(PFNNOTIFY)Camera_Preview,(void*)(*pApp));
void Camera_Preview(void* pUser)
{
.........
..........
ICAMERA_Preview((pApp)->pICamera);
}

Hi, I modified my code as you suggested (listed below). But it still can not work on v325. Debugging information are almost the same as before (i.e. the ICamera callback was called only once, no frames captured).
Can you tell me what happened ?
bool CBrewCamera::CreateInstance()
{
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_CAMERA, (void **)&m_pICamera) != SUCCESS)
{
DBGPRINTF( "ICAMERA CreateInstance Error");
return false;
}
if( ICAMERA_RegisterNotify(m_pICamera, CBrewCamera::HandleEvent, this) != SUCCESS)
{
DBGPRINTF( "ICAMERA Register Notify Error");
return false;
}
m_pBitmap = new CBrewBitmap();
m_pBitmap->PrepairDIB();
return true;

void CBrewCamera::SetSnapShotSize(int x, int y)
{
m_size.cx = x;
m_size.cy = y;

void CBrewCamera::SetTimer( CBrewCamera * pCamera )
{
if (pCamera != NULL )
{
pCamera->OnSetTimer();
}

void CBrewCamera::OnSetTimer()
{
AEEDeviceInfo m_di;
ISHELL_GetDeviceInfo(m_pIShell,&m_di);
DBGPRINTF("**********************");
SetPreviewSize( 176, 120);
DBGPRINTF("Prevew Size x=%d y=%d\n", m_di.cxScreen, m_di.cyScreen);
int nErr = ICAMERA_SetDisplaySize(m_pICamera, &m_sizePreview);
if (nErr)
{
DBGPRINTF("Error in setting DisplaySize nErr=%d\n", nErr);
return;
}
nErr = ICAMERA_Preview(m_pICamera);
if (nErr)
{
DBGPRINTF("Error in calling Preview nErr=%d\n", nErr);
return;
}
m_cameramode = CAMERA_PREVIEW;
}
int CBrewCamera::StartPreview()
{
ISHELL_SetTimer(m_pIShell, 500, (PFNNOTIFY)SetTimer, this );
return 0;

Hi, I modified my code as you suggested (listed below). But it still can not work on v325. Debugging information are almost the same as before (i.e. the ICamera callback was called only once, no frames captured).
Can you tell me what happened ?
bool CBrewCamera::CreateInstance()
{
if (ISHELL_CreateInstance(m_pIShell, AEECLSID_CAMERA, (void **)&m_pICamera) != SUCCESS)
{
DBGPRINTF( "ICAMERA CreateInstance Error");
return false;
}
if( ICAMERA_RegisterNotify(m_pICamera, CBrewCamera::HandleEvent, this) != SUCCESS)
{
DBGPRINTF( "ICAMERA Register Notify Error");
return false;
}
m_pBitmap = new CBrewBitmap();
m_pBitmap->PrepairDIB();
return true;

void CBrewCamera::SetSnapShotSize(int x, int y)
{
m_size.cx = x;
m_size.cy = y;

void CBrewCamera::SetTimer( CBrewCamera * pCamera )
{
if (pCamera != NULL )
{
pCamera->OnSetTimer();
}

void CBrewCamera::OnSetTimer()
{
AEEDeviceInfo m_di;
ISHELL_GetDeviceInfo(m_pIShell,&m_di);
DBGPRINTF("**********************");
SetPreviewSize( 176, 120);
DBGPRINTF("Prevew Size x=%d y=%d\n", m_di.cxScreen, m_di.cyScreen);
int nErr = ICAMERA_SetDisplaySize(m_pICamera, &m_sizePreview);
if (nErr)
{
DBGPRINTF("Error in setting DisplaySize nErr=%d\n", nErr);
return;
}
nErr = ICAMERA_Preview(m_pICamera);
if (nErr)
{
DBGPRINTF("Error in calling Preview nErr=%d\n", nErr);
return;
}
m_cameramode = CAMERA_PREVIEW;
}
int CBrewCamera::StartPreview()
{
ISHELL_SetTimer(m_pIShell, 500, (PFNNOTIFY)SetTimer, this );
return 0;

Is the 300ms delay required when taking a SnapShot as well?
Thanks,

Is the 300ms delay required when taking a SnapShot as well?
Thanks,

I am having a similar problem with the v325. When I start preview mode, I get the CAM_STATUS_START event, but no CAM_STATUS_FRAME events, even though I delay for 500 ms between ICamera creation and starting the preview.
ISHELL_CreateInstance( ICamera )
ICAMERA_RegisterNotify
wait 500 ms using ISHELL_SetTimer
ICAMERA_SetSize( 160x120 )
ICAMERA_SetDisplaySize( 160x120 )
ICAMERA_Preview
The code in question runs fine on a number of other devices, both Motorola and other manufacturers. Any ideas on how to make it work for the v325?

I am having a similar problem with the v325. When I start preview mode, I get the CAM_STATUS_START event, but no CAM_STATUS_FRAME events, even though I delay for 500 ms between ICamera creation and starting the preview.
ISHELL_CreateInstance( ICamera )
ICAMERA_RegisterNotify
wait 500 ms using ISHELL_SetTimer
ICAMERA_SetSize( 160x120 )
ICAMERA_SetDisplaySize( 160x120 )
ICAMERA_Preview
The code in question runs fine on a number of other devices, both Motorola and other manufacturers. Any ideas on how to make it work for the v325?

hi...
first check mif file dependence.....n i think so u r not adding CAMERA class id....
so go to dependence tab n thn add CAMERA dependence...
i think so thn ur code will work

hi...
first check mif file dependence.....n i think so u r not adding CAMERA class id....
so go to dependence tab n thn add CAMERA dependence...
i think so thn ur code will work

Thanks for the suggestion asheesh.
Unfortunately, that is one of the first things that I checked. The dependency on the camera is present in the application's MIF file. Do you have any other ideas?

Thanks for the suggestion asheesh.
Unfortunately, that is one of the first things that I checked. The dependency on the camera is present in the application's MIF file. Do you have any other ideas?

I have some slight progress to support. Instead of running the preview at 160x120, if I choose 160x130, I'll get the callbacks. The 160x120 case fails silently for some reason.
Is there any way to figure out which resolutions will work on a particular phone? I see ICAMERA_GetDisplaySizeList in the BREW documentations, but I can't think of one phone that I've seen for which that function doesn't return EUNSUPPORTED. Is there documentation available somewhere, either through Qualcomm, or through the handset manufacturers?

I have some slight progress to support. Instead of running the preview at 160x120, if I choose 160x130, I'll get the callbacks. The 160x120 case fails silently for some reason.
Is there any way to figure out which resolutions will work on a particular phone? I see ICAMERA_GetDisplaySizeList in the BREW documentations, but I can't think of one phone that I've seen for which that function doesn't return EUNSUPPORTED. Is there documentation available somewhere, either through Qualcomm, or through the handset manufacturers?

V325 support 120(w)x160(h) , 240x320 and 480x640.NOT always 160x120 so on.
so I call ICAMERA_SetSize(120x160) is OK,but 160x120. You try :)

V325 support 120(w)x160(h) , 240x320 and 480x640.NOT always 160x120 so on.
so I call ICAMERA_SetSize(120x160) is OK,but 160x120. You try :)

Thanks lcstudio,
Apparently I tried everything else except for this case. My code works now without trouble.

Thanks lcstudio,
Apparently I tried everything else except for this case. My code works now without trouble.

Hello All,
Did you guys get the ICAMERA_RecordSnapshot() working properly on the v325 motorola? I have a v325. If so, what is your algorithm?
ICAMERA_RecordSnapshot() is not working properly first time around for me. It freezes my app. But, when I terminate the app by PRESSing the END KEY and restart the app and run my code again, it works!
Here's my algorithm typically like everyone else:
When I have the camera in preview mode and the user presses a EVENT KEY, I stop the camera.
Afterwards, since I stopped the camera, the callback returns (CAM_STATUS_DONE && CAM_CMD_START && CAM_MODE_PREVIEW) callback, which tells me that the preview is done and stopped.
so I call:
ICAMERA_SetMediaData, ICAMERA_SetSize,
ICAMERA_SetVideoEncode,
= ICAMERA_SetParm (CAM_PENDING; return status was -1;Result returned via the registered callback )
and then ICAMERA_RecordSnapshot (return status of 13; EBADSTATE: RecordSnapshot() cannot be done in current state)
Now, in the callback notification, I get this:
(remember, this is what happens the first time around)
(CAM_STATUS_START && CAM_CMD_START && CAM_MODE_SNAPSHOT)- this tells me that the snapshot started
Then, I get:
(CAM_STATUS_DONE && CAM_CMD_SETPARM)
and that's it!
It just get's stuck on this.
now, when I stop the app by PRESSing the END KEY and restart the app.
it works fine, it stops the preview and takes a picture and stores it in the directory.
Here is the output of the callback that I get, similar to the previous but with 2 more CAM_STATUS_DONEs:
(remember, this is what happens the SECOND time around)
(CAM_STATUS_START && CAM_CMD_START && CAM_MODE_SNAPSHOT)- this tells me that it started the snapshot
Then, I get:
(CAM_STATUS_DONE && CAM_CMD_SETPARM)
and then,
(CAM_STATUS_DONE, CAM_CMD_START && CAM_MODE_SNAPSHOT)- this tells me that taking the snapshot is done
then I get:
(CAM_STATUS_DONE && CAM_CMD_ENCODESNAPSHOT)- this tells me that it is finished encoding the snapshot.
that's it!
why does this happen and how can I get this to work the first time around?
Thanks all for your time everyone!

Hello All,
Did you guys get the ICAMERA_RecordSnapshot() working properly on the v325 motorola? I have a v325. If so, what is your algorithm?
ICAMERA_RecordSnapshot() is not working properly first time around for me. It freezes my app. But, when I terminate the app by PRESSing the END KEY and restart the app and run my code again, it works!
Here's my algorithm typically like everyone else:
When I have the camera in preview mode and the user presses a EVENT KEY, I stop the camera.
Afterwards, since I stopped the camera, the callback returns (CAM_STATUS_DONE && CAM_CMD_START && CAM_MODE_PREVIEW) callback, which tells me that the preview is done and stopped.
so I call:
ICAMERA_SetMediaData, ICAMERA_SetSize,
ICAMERA_SetVideoEncode,
= ICAMERA_SetParm (CAM_PENDING; return status was -1;Result returned via the registered callback )
and then ICAMERA_RecordSnapshot (return status of 13; EBADSTATE: RecordSnapshot() cannot be done in current state)
Now, in the callback notification, I get this:
(remember, this is what happens the first time around)
(CAM_STATUS_START && CAM_CMD_START && CAM_MODE_SNAPSHOT)- this tells me that the snapshot started
Then, I get:
(CAM_STATUS_DONE && CAM_CMD_SETPARM)
and that's it!
It just get's stuck on this.
now, when I stop the app by PRESSing the END KEY and restart the app.
it works fine, it stops the preview and takes a picture and stores it in the directory.
Here is the output of the callback that I get, similar to the previous but with 2 more CAM_STATUS_DONEs:
(remember, this is what happens the SECOND time around)
(CAM_STATUS_START && CAM_CMD_START && CAM_MODE_SNAPSHOT)- this tells me that it started the snapshot
Then, I get:
(CAM_STATUS_DONE && CAM_CMD_SETPARM)
and then,
(CAM_STATUS_DONE, CAM_CMD_START && CAM_MODE_SNAPSHOT)- this tells me that taking the snapshot is done
then I get:
(CAM_STATUS_DONE && CAM_CMD_ENCODESNAPSHOT)- this tells me that it is finished encoding the snapshot.
that's it!
why does this happen and how can I get this to work the first time around?
Thanks all for your time everyone!

I am suffering the same problem as jingtaow also with Motorola V325. Nothing in response to ICAMERA_RecordSnapshot beyond the initial CAM_STATUS_START. Yes, I tried various 300 and 500 ms delays (using TIMER) between the ICAMERA calls, particularly ICAMERA_Preview. I am using 132x176 and 480x640.
Have also tried 144x176, 130x160 as suggestions or my own experience have sometimes helped. But this camera always forces 3:4 preview aspect ratio on pFrame.
Has there been any solution to this problem?
- Thanks in advance, David

I am suffering the same problem as jingtaow also with Motorola V325. Nothing in response to ICAMERA_RecordSnapshot beyond the initial CAM_STATUS_START. Yes, I tried various 300 and 500 ms delays (using TIMER) between the ICAMERA calls, particularly ICAMERA_Preview. I am using 132x176 and 480x640.
Have also tried 144x176, 130x160 as suggestions or my own experience have sometimes helped. But this camera always forces 3:4 preview aspect ratio on pFrame.
Has there been any solution to this problem?
- Thanks in advance, David

Found it!
Here is the secret:
nerr = ICAMERA_SetMediaData(pMe->m_pcamera, &pMe->md, "image/jpeg");
- David

Found it!
Here is the secret:
nerr = ICAMERA_SetMediaData(pMe->m_pcamera, &pMe->md, "image/jpeg");
- David