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

Developer

Forums

The following codes always return FAILED, why?

ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_CAMERA, (void **)&pMe->pCamera);

You need to make sure that you have ICamera support in your target phone.
ruben

You need to make sure that you have ICamera support in your target phone.
ruben

But which device in SDK3.0 supports ICamera interface?

But which device in SDK3.0 supports ICamera interface?

I believe ICamera support was added in BREW 2.1. As far I know currently only phone which supports ICamera interface is Motorola V710(it is pre-commercial). If you have contacts at verizon/Qualcomm you may be able to get one. It will be available from verizon.

I believe ICamera support was added in BREW 2.1. As far I know currently only phone which supports ICamera interface is Motorola V710(it is pre-commercial). If you have contacts at verizon/Qualcomm you may be able to get one. It will be available from verizon.

hi every one
i want to know that how can test my application which include ICAMERA interface
is there any emulator for that or we need to download it
if yes from where can i download
if no then how to check my applications
thanks
it is very urgent
chary

hi every one
i want to know that how can test my application which include ICAMERA interface
is there any emulator for that or we need to download it
if yes from where can i download
if no then how to check my applications
thanks
it is very urgent
chary

i don't think so that brew sdk emulators contains the facility of checking icamera interface . if u find pls tell me
bye bye
ravi

i don't think so that brew sdk emulators contains the facility of checking icamera interface . if u find pls tell me
bye bye
ravi

is there any free download of emulators available which support camera interface
if u or anybody got the sites name or information send me
ravi

is there any free download of emulators available which support camera interface
if u or anybody got the sites name or information send me
ravi

Currently there is no support for camera in the emulator. This requires emulator to implement BREW API based on windows camera driver/ using direct show API.
Motorola V710 supports camera, which is accessible from BREW. But this phone is not yet commercially available.

Currently there is no support for camera in the emulator. This requires emulator to implement BREW API based on windows camera driver/ using direct show API.
Motorola V710 supports camera, which is accessible from BREW. But this phone is not yet commercially available.

hai ruben,
thanks for information
and also sending another doubt.
Does it mean that MotorolaV710 is in the form of emulator or it is a brew device.
if it is emulator then how to download it and can i utilize webcam as a camera for that emulator for testing camera application. And how to interact with the webcam using emulator.
if available emulator pls specify the site location.
thanks RAVINDER

hai ruben,
thanks for information
and also sending another doubt.
Does it mean that MotorolaV710 is in the form of emulator or it is a brew device.
if it is emulator then how to download it and can i utilize webcam as a camera for that emulator for testing camera application. And how to interact with the webcam using emulator.
if available emulator pls specify the site location.
thanks RAVINDER

Not in the emulator. Camera is available in real device.

Not in the emulator. Camera is available in real device.

thank u for information
then how to test the icamera appliction in the brew?

thank u for information
then how to test the icamera appliction in the brew?

At this point you need to get a phone with ICamera support.

At this point you need to get a phone with ICamera support.

thanks ruben
but do u mean that ,to test my application each time i have to load the application to device
and i have to check ,whether it is working or not on the device
or can i use web cam as camera for emulator
plz send ur reply
bye
ravinder

thanks ruben
but do u mean that ,to test my application each time i have to load the application to device
and i have to check ,whether it is working or not on the device
or can i use web cam as camera for emulator
plz send ur reply
bye
ravinder

hi ruben
can u specify that from where i can get icamera enabled device
i.e from qualcomm or any other
bye
chary

hi ruben
can u specify that from where i can get icamera enabled device
i.e from qualcomm or any other
bye
chary

Motorola V710 is not commercially available yet. You need to have contact with either Verizon/Motorola/Qualcomm to get a pre-commercial version of it. BREW version of this phone is 2.1.1

Motorola V710 is not commercially available yet. You need to have contact with either Verizon/Motorola/Qualcomm to get a pre-commercial version of it. BREW version of this phone is 2.1.1

I think you must write you own oemcamera code on pk

I think you must write you own oemcamera code on pk

Motorola v710 is available as commercial device. Information can be seen on Brew Developers' extranet. There is only one operator named "VIVO" for this device as of now.

Motorola v710 is available as commercial device. Information can be seen on Brew Developers' extranet. There is only one operator named "VIVO" for this device as of now.

rush wrote:Motorola v710 is available as commercial device. Information can be seen on Brew Developers' extranet. There is only one operator named "VIVO" for this device as of now.
You can access all WinApi, DirectX, DirectShow, ... api from the simulator. You just have to implement the camera via DirectShow. Use #ifdef AEE_SIMULATOR to handle this simulation.

rush wrote:Motorola v710 is available as commercial device. Information can be seen on Brew Developers' extranet. There is only one operator named "VIVO" for this device as of now.
You can access all WinApi, DirectX, DirectShow, ... api from the simulator. You just have to implement the camera via DirectShow. Use #ifdef AEE_SIMULATOR to handle this simulation.

Date of my last post was June 2004. As of August 2004, Verizon in US launched V710 commercially. Now there is also LG7000/LG8000 which have support for camera as well.

Date of my last post was June 2004. As of August 2004, Verizon in US launched V710 commercially. Now there is also LG7000/LG8000 which have support for camera as well.

AlexBlock wrote:You can access all WinApi, DirectX, DirectShow, ... api from the simulator. You just have to implement the camera via DirectShow. Use #ifdef AEE_SIMULATOR to handle this simulation.
Do u mean the simulator can be used to develop the application then please let me know the entries, which needs to be done in the #ifdef AEE_SIMULATOR.
In my application, when I am tring to create the instanse of AEECLSID_CAMERA then, it is always returning ECLASSNOTSUPPORT. Even when i am using the emulator of V710.
Please provide some code if you are able to do so.
Gourav Jain

AlexBlock wrote:You can access all WinApi, DirectX, DirectShow, ... api from the simulator. You just have to implement the camera via DirectShow. Use #ifdef AEE_SIMULATOR to handle this simulation.
Do u mean the simulator can be used to develop the application then please let me know the entries, which needs to be done in the #ifdef AEE_SIMULATOR.
In my application, when I am tring to create the instanse of AEECLSID_CAMERA then, it is always returning ECLASSNOTSUPPORT. Even when i am using the emulator of V710.
Please provide some code if you are able to do so.
Gourav Jain

You need to provide your own implementation of ICamera interface in simulator (needed to be implemented using Windows DirectX/DirectShow API)

You need to provide your own implementation of ICamera interface in simulator (needed to be implemented using Windows DirectX/DirectShow API)

Hi,
I am not able to create the instance of ICamera .
When I run the code in the simulator it crashes on the createinstance line .
I was expecting noclass support return value while running the code in the simulator.
So anyone can help me in this?
Regards

Hi,
I am not able to create the instance of ICamera .
When I run the code in the simulator it crashes on the createinstance line .
I was expecting noclass support return value while running the code in the simulator.
So anyone can help me in this?
Regards

Should return EUNSUPPORTED. Could you post your creation code?

Should return EUNSUPPORTED. Could you post your creation code?

Hi,
I am done with instance of Camera. the problem was with the mif.
But now i wanted know where exactly the snapshot will get stored.
Also I have found one function ICamera_SaveAppPicture
but i have no idea about details of the same. Is it from the API's?
If anyone knows , please reply back.
Regards
Swati

Hi,
I am done with instance of Camera. the problem was with the mif.
But now i wanted know where exactly the snapshot will get stored.
Also I have found one function ICamera_SaveAppPicture
but i have no idea about details of the same. Is it from the API's?
If anyone knows , please reply back.
Regards
Swati

I'm having the same problem creating an instance of icamera. The DDS says that my Audiovox 8940 does have icamera support.
What changes are required in the .mif to allow camera capabilities?

I'm having the same problem creating an instance of icamera. The DDS says that my Audiovox 8940 does have icamera support.
What changes are required in the .mif to allow camera capabilities?

Hi,
just check if all previlege levels are given. that is necessary for ICAMERA CREATEINSTANCE .
Regards
Swati

Hi,
just check if all previlege levels are given. that is necessary for ICAMERA CREATEINSTANCE .
Regards
Swati

Your app will not pass TBT using that method. Add a dependency in the MIF editor for AEECLSID_CAMERA.

Your app will not pass TBT using that method. Add a dependency in the MIF editor for AEECLSID_CAMERA.

hi jonathan,
we are using KX2 which supports ICamera interface.what i would like to clarify is that ,does a .mif file need to mention AEECLSID_CAMERA as dependency,for passing TBT ,given that KX2 itself has developer access to ICAMERA.
also,my app is working fine on the handset without giving AEECLSID_CAMERA dependency in .mif.
thanks
ibrew

hi jonathan,
we are using KX2 which supports ICamera interface.what i would like to clarify is that ,does a .mif file need to mention AEECLSID_CAMERA as dependency,for passing TBT ,given that KX2 itself has developer access to ICAMERA.
also,my app is working fine on the handset without giving AEECLSID_CAMERA dependency in .mif.
thanks
ibrew

Sorry for being a newbie, but how do I add the AEECLSID_CAMERA dependecy using the .mif editor?
Using the editor, it seems I need a .bid file in order to click Add within the dependency screen.
Please let me know what I need to do. Thanks.

Sorry for being a newbie, but how do I add the AEECLSID_CAMERA dependecy using the .mif editor?
Using the editor, it seems I need a .bid file in order to click Add within the dependency screen.
Please let me know what I need to do. Thanks.

ibrew,
Some devices need the AEECLSID_CAMERA in order to access the camera. This is just an added level of security. If a device can create an ICamera instance without this dependency (or without the "all" privilege level selected), then no, you do not need to add it to the MIF file.
mcho,
Just create a bid file with the AEECLSID_CAMERA defined. Make sure to use the same class id as given in AEEClassIDs.h.

ibrew,
Some devices need the AEECLSID_CAMERA in order to access the camera. This is just an added level of security. If a device can create an ICamera instance without this dependency (or without the "all" privilege level selected), then no, you do not need to add it to the MIF file.
mcho,
Just create a bid file with the AEECLSID_CAMERA defined. Make sure to use the same class id as given in AEEClassIDs.h.

The 3.1+ Simulator allows webcams compatible with DirectShow to be used with ICamera.

The 3.1+ Simulator allows webcams compatible with DirectShow to be used with ICamera.

I am trying this with a Labtec webcam and I am having bit of a problem. I am not getting the CAM_STATUS_FRAME call for the notify. I imagine my webcam is DirectShow compatible - it seems like most of them are these days.
Has anyone tried a webcam that works properly?
Thanks.

I am trying this with a Labtec webcam and I am having bit of a problem. I am not getting the CAM_STATUS_FRAME call for the notify. I imagine my webcam is DirectShow compatible - it seems like most of them are these days.
Has anyone tried a webcam that works properly?
Thanks.

Most of the webcam drivers are windows directshow compatible (for performance reason).

Most of the webcam drivers are windows directshow compatible (for performance reason).

What Simulator version are you using?

What Simulator version are you using?

Iam using Simulator version 3.1

Iam using Simulator version 3.1

How to Test a camera application using the BREW Simulator?
Is there any means by which a webcam can be used along
with the simulator for this purpose?
Ajaz

How to Test a camera application using the BREW Simulator?
Is there any means by which a webcam can be used along
with the simulator for this purpose?
Ajaz

Yes, there is a description on how to use the camera in the simulator in the BREW SDK User Doc. The section is "Simulating a camera device".

Yes, there is a description on how to use the camera in the simulator in the BREW SDK User Doc. The section is "Simulating a camera device".

I am able to get a live preview of the camera on the Brew Simulator.
I was also able to create a bitmap by using the following code
pme->m_MediaData.clsData = MMD_FILE_NAME;
pme->m_MediaData.pData = "test.bmp";
ICAMERA_SetMediaData(pme->m_pICamera,&pme->m_MediaData,NULL);
etc..... then
ICAMERA_RecordSnapshot(pme->m_pICamera);
________THE ABOVE CODE WORKS FINE !
But if I change the code to get the bitmap in the buffer instead of a file it is not working and ICAMERA_SetMediaData returns EBADPARM: Bad parm error !
My non working code is -
pme->m_MediaData.clsData = MMD_BUFFER;
pme->m_MediaData.pData = pme->m_bitmap; // this is a char * m_bitmap
ICAMERA_SetMediaData(pme->m_pICamera,&pme->m_MediaData,NULL);
__________________________________________________________
Does Brew Simulator support storing of bitmaps in a memory buffer ?
If yes ... what the problem in the above code ? Pls Help
--Anup

I am able to get a live preview of the camera on the Brew Simulator.
I was also able to create a bitmap by using the following code
pme->m_MediaData.clsData = MMD_FILE_NAME;
pme->m_MediaData.pData = "test.bmp";
ICAMERA_SetMediaData(pme->m_pICamera,&pme->m_MediaData,NULL);
etc..... then
ICAMERA_RecordSnapshot(pme->m_pICamera);
________THE ABOVE CODE WORKS FINE !
But if I change the code to get the bitmap in the buffer instead of a file it is not working and ICAMERA_SetMediaData returns EBADPARM: Bad parm error !
My non working code is -
pme->m_MediaData.clsData = MMD_BUFFER;
pme->m_MediaData.pData = pme->m_bitmap; // this is a char * m_bitmap
ICAMERA_SetMediaData(pme->m_pICamera,&pme->m_MediaData,NULL);
__________________________________________________________
Does Brew Simulator support storing of bitmaps in a memory buffer ?
If yes ... what the problem in the above code ? Pls Help
--Anup

Oops... I forgot to MALLOC
The problem is solved
--Anup

Oops... I forgot to MALLOC
The problem is solved
--Anup

Hi,
Iam new in BREW.
How u got a live preview of the camera on the Brew Simulator.
I heard about the directShow api.Do u using that.If yes please post the steps.
Iam getting stucked.I tried a sample app of camera .But simulator crashes when i call the call back function.
my source code is ,
static void camera(PEPlus* pme)
{
DBGPRINTF("In camera");
int nErr;
// Create ICamera instance.
nErr = ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_CAMERA,(void **)&pme->m_pICamera);
DBGPRINTF("In camera2");
if(nErr == SUCCESS)
DBGPRINTF("Camera Creation Success");
else if (nErr == ENOMEMORY)
{
DBGPRINTF("ENOMMEMORY");
return nErr;
}
else if(nErr == ECLASSNOTSUPPORT)
{
DBGPRINTF("ECLASSNOTSUPPORT");
return nErr;
}
DBGPRINTF("In camera3");
// Regter callback notification function.
nErr = ICAMERA_RegisterNotify(pme->m_pICamera,CApp_CameraNotify,pme);
DBGPRINTF("In camera4");
if (nErr)
return nErr;
AEESize size;
size.cx=0;
size.cy =0;
ICAMERA_SetDisplaySize(pme->m_pICamera,&size);
DBGPRINTF("In camera5");
ICAMERA_SetSize(pme->m_pICamera,&size);
DBGPRINTF("In camera6");
nErr = ICAMERA_Preview(pme->m_pICamera);
DBGPRINTF("In camera7");
if (nErr)
return nErr;
return SUCCESS;
}
static void CApp_CameraNotify(void * pUser,AEECameraNotify * pn)
{
DBGPRINTF("In callVBAck");
PEPlus* pme = (PEPlus *)pUser;
if (!pme || !pn)
return;
switch (pn->nStatus)
{
case CAM_STATUS_START:
DBGPRINTF("Camera Start");
break;
case 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(pme->m_pICamera, &pFrame))
return;
// Get the bitmap info...this can be saved in app global structure.
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
// Display the frame at (0, 0) location of the screen
IDISPLAY_BitBlt(pme, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_DONE:
// ICAMERA_Stop() was called and preview operation stopped.
break;
case CAM_STATUS_ABORT:
// Preview got aborted.
break;
}
}
Thanks
Namitha

Hi,
Iam new in BREW.
How u got a live preview of the camera on the Brew Simulator.
I heard about the directShow api.Do u using that.If yes please post the steps.
Iam getting stucked.I tried a sample app of camera .But simulator crashes when i call the call back function.
my source code is ,
static void camera(PEPlus* pme)
{
DBGPRINTF("In camera");
int nErr;
// Create ICamera instance.
nErr = ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_CAMERA,(void **)&pme->m_pICamera);
DBGPRINTF("In camera2");
if(nErr == SUCCESS)
DBGPRINTF("Camera Creation Success");
else if (nErr == ENOMEMORY)
{
DBGPRINTF("ENOMMEMORY");
return nErr;
}
else if(nErr == ECLASSNOTSUPPORT)
{
DBGPRINTF("ECLASSNOTSUPPORT");
return nErr;
}
DBGPRINTF("In camera3");
// Regter callback notification function.
nErr = ICAMERA_RegisterNotify(pme->m_pICamera,CApp_CameraNotify,pme);
DBGPRINTF("In camera4");
if (nErr)
return nErr;
AEESize size;
size.cx=0;
size.cy =0;
ICAMERA_SetDisplaySize(pme->m_pICamera,&size);
DBGPRINTF("In camera5");
ICAMERA_SetSize(pme->m_pICamera,&size);
DBGPRINTF("In camera6");
nErr = ICAMERA_Preview(pme->m_pICamera);
DBGPRINTF("In camera7");
if (nErr)
return nErr;
return SUCCESS;
}
static void CApp_CameraNotify(void * pUser,AEECameraNotify * pn)
{
DBGPRINTF("In callVBAck");
PEPlus* pme = (PEPlus *)pUser;
if (!pme || !pn)
return;
switch (pn->nStatus)
{
case CAM_STATUS_START:
DBGPRINTF("Camera Start");
break;
case 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(pme->m_pICamera, &pFrame))
return;
// Get the bitmap info...this can be saved in app global structure.
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
// Display the frame at (0, 0) location of the screen
IDISPLAY_BitBlt(pme, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_DONE:
// ICAMERA_Stop() was called and preview operation stopped.
break;
case CAM_STATUS_ABORT:
// Preview got aborted.
break;
}
}
Thanks
Namitha

I'm planning on making a program with ICamera.
Can I get live preview via PC-Cam on the Brew Simulator?
To see the program result, Should I transfer it to mobile device?

I'm planning on making a program with ICamera.
Can I get live preview via PC-Cam on the Brew Simulator?
To see the program result, Should I transfer it to mobile device?

kimeunmi wrote:I'm planning on making a program with ICamera.
Can I get live preview via PC-Cam on the Brew Simulator?
To see the program result, Should I transfer it to mobile device?
Yes you would have to always put it on device to test :D

kimeunmi wrote:I'm planning on making a program with ICamera.
Can I get live preview via PC-Cam on the Brew Simulator?
To see the program result, Should I transfer it to mobile device?
Yes you would have to always put it on device to test :D

BREW SDK Manual said:
===========================
To simulate a camera device
1. Ensure that a DirectShow compliant camera device is connected to the system.
2. Load a device pack that simulates a camera device. Device packs with this enabled will have the Camera section “Camera Support” as Yes and Camera CLSID Configuration section “Support” as Yes.
3. Run the application that uses the ICamera APIs.
The Simulator detects and connects to the first available camera device on the system. The Simulator displays the results on the device skin just as on a real device.
===========================
question is: what device pack supports it OR how to make a device pack to support it? i cant find any divece pack editors etc.
in brew 2.1 sdk was a device configurator, dont have it anymore in the brew 3.1 sdk package.
thanks in advance!

BREW SDK Manual said:
===========================
To simulate a camera device
1. Ensure that a DirectShow compliant camera device is connected to the system.
2. Load a device pack that simulates a camera device. Device packs with this enabled will have the Camera section “Camera Support” as Yes and Camera CLSID Configuration section “Support” as Yes.
3. Run the application that uses the ICamera APIs.
The Simulator detects and connects to the first available camera device on the system. The Simulator displays the results on the device skin just as on a real device.
===========================
question is: what device pack supports it OR how to make a device pack to support it? i cant find any divece pack editors etc.
in brew 2.1 sdk was a device configurator, dont have it anymore in the brew 3.1 sdk package.
thanks in advance!

Open the device pack in the Simulator.
Open the device properties (view->properties).
Scroll down to the Camera section.
Make sure it says "yes" for Camera Support.

Open the device pack in the Simulator.
Open the device properties (view->properties).
Scroll down to the Camera section.
Make sure it says "yes" for Camera Support.

mohlendo wrote:Open the device pack in the Simulator.
Open the device properties (view->properties).
Scroll down to the Camera section.
Make sure it says "yes" for Camera Support.
I tried several device packs, BUT in the properties window only "Directories" property is showed. WHY?? I use Simulator v3.1.2.17.
I think there should be some value i should change maybe in registry or config file, but i don't know exactly what :-\
please,
of cource if You can,
help me with this issue.
Thanks in advance!!!

mohlendo wrote:Open the device pack in the Simulator.
Open the device properties (view->properties).
Scroll down to the Camera section.
Make sure it says "yes" for Camera Support.
I tried several device packs, BUT in the properties window only "Directories" property is showed. WHY?? I use Simulator v3.1.2.17.
I think there should be some value i should change maybe in registry or config file, but i don't know exactly what :-\
please,
of cource if You can,
help me with this issue.
Thanks in advance!!!

Can you elaborate more on the Error code you are getting ? You can always use output window on simulator (if it crashes after you start your application.
Also, provide some details on which device pack you are using.
Swapnil.

Can you elaborate more on the Error code you are getting ? You can always use output window on simulator (if it crashes after you start your application.
Also, provide some details on which device pack you are using.
Swapnil.

In "Brew SKD User Doc" documentary, there is a hint: "Ensure that a DirectShow compliant camera device is connected to the system" in order to simute a camera device.
I don't understand "DirectShow compliant camera device". What is this? If I use a webcam to simulate camera device, It is ok?
If that is ok, please guide me how to set up and simutale.
THANKS MUCH.

In "Brew SKD User Doc" documentary, there is a hint: "Ensure that a DirectShow compliant camera device is connected to the system" in order to simute a camera device.
I don't understand "DirectShow compliant camera device". What is this? If I use a webcam to simulate camera device, It is ok?
If that is ok, please guide me how to set up and simutale.
THANKS MUCH.

"DirectShow Compliant " any Camera that has some driver With WDM so if your webcam works with Windows XP smoothly then that is DirectShow Compliant.

"DirectShow Compliant " any Camera that has some driver With WDM so if your webcam works with Windows XP smoothly then that is DirectShow Compliant.

Thank you very much.
I have a webcam which works Windows XP smoothly. Now, I'm programming for start a camera in preview mode, and stimule by stimulator BREW 3.1.5.27.
After I set the frame display size by ICAMERA_Setdisplay size() function, I continue to call ICAMERA_Preview() function, the BREW stimulator notice an error "BREW Simulator has encountered a problem and needs to close. We are sorry for the inconvenience." Then BREW Stimulator escapes.
I'm trying to explain the reason why that is happened. But I can't understand. Please guide me.

Thank you very much.
I have a webcam which works Windows XP smoothly. Now, I'm programming for start a camera in preview mode, and stimule by stimulator BREW 3.1.5.27.
After I set the frame display size by ICAMERA_Setdisplay size() function, I continue to call ICAMERA_Preview() function, the BREW stimulator notice an error "BREW Simulator has encountered a problem and needs to close. We are sorry for the inconvenience." Then BREW Stimulator escapes.
I'm trying to explain the reason why that is happened. But I can't understand. Please guide me.

I think, perhaps, my webcam didn't connect to the system. In other words, my webcam didn't connect to the BREW Stimulator. Therefor, how I can set up my webcam to the BREW stimulator?

I think, perhaps, my webcam didn't connect to the system. In other words, my webcam didn't connect to the BREW Stimulator. Therefor, how I can set up my webcam to the BREW stimulator?

Please check known issues page for this SDK. It says that BREW applications should not invoke ICAMERA_SetSize() and ICAMERA_SetDisplaySize() with size (cx, cy) values of (0, 0) and (-1, -1). If you are doing something like this, it may create a problem.
https://brewx.qualcomm.com/bws/content/gi/products/sdk/3.1/en/3.1.5.27/d...
-- Swapnil.
BREW Support.

Please check known issues page for this SDK. It says that BREW applications should not invoke ICAMERA_SetSize() and ICAMERA_SetDisplaySize() with size (cx, cy) values of (0, 0) and (-1, -1). If you are doing something like this, it may create a problem.
https://brewx.qualcomm.com/bws/content/gi/products/sdk/3.1/en/3.1.5.27/d...
-- Swapnil.
BREW Support.

Hi,
I am making one camera based application which internally uses the camera extention APIs.
I need to test this application on simulator, but dont know how to run the camera on simulator.
Let me know if anyone has done similar thing on simulator.
Thanks,
Santosh.

Hi,
I am making one camera based application which internally uses the camera extention APIs.
I need to test this application on simulator, but dont know how to run the camera on simulator.
Let me know if anyone has done similar thing on simulator.
Thanks,
Santosh.

If I recall correctly, in BREW 3.x QCOMM implemented camera using directshow for windows emulator. In the emulator folder there is a dll called camera.dll, so you should be able to test it using a webcam.

If I recall correctly, in BREW 3.x QCOMM implemented camera using directshow for windows emulator. In the emulator folder there is a dll called camera.dll, so you should be able to test it using a webcam.

Merging similar threads. Please search the forums to see if your question has already been asked.

Merging similar threads. Please search the forums to see if your question has already been asked.

I'm new to BREW and i'm working wth ICamera. Let me know what are the requirements to run a sample program using ICamera.
I did one sample coding using this is ICamera and i'm running that with the emulator LG VX8600. And i also modified the Mif file also.
All things are said to be right, but i don't have any WebCam. Is that WebCam is needed/not?
I'm getting the error EFAILED in Create Instance.
coding given below:
/*===========================================================================
FILE: cameraapp.c
===========================================================================*/
/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEStdlib.h"
#include "AEECamera.h" // Camera interface definitions
#include "AEEFile.h" // File interface definitions
#include "cameraapp.bid"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _cameraapp {
AEEApplet a ; // First element of this structure must be AEEApplet
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
// add your own variables here...
ICamera * m_pICamera;
IDisplay * m_pIDisplay;
AEESize m_sizeFrame,m_sizePreview;
} cameraapp,CApp;
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean cameraapp_HandleEvent(cameraapp* pMe,
AEEEvent eCode, uint16 wParam,
uint32 dwParam);
boolean cameraapp_InitAppData(cameraapp* pMe);
void cameraapp_FreeAppData(cameraapp* pMe);
static int CApp_StartCameraInPreviewMode(CApp * pMe);
static void CApp_CameraNotify(void * , AEECameraNotify *);
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
*ppObj = NULL;
if( ClsId == AEECLSID_CAMERAAPP )
{
// Create the applet and make room for the applet structure
if( AEEApplet_New(sizeof(cameraapp),
ClsId,
pIShell,
po,
(IApplet**)ppObj,
(AEEHANDLER)cameraapp_HandleEvent,
(PFNFREEAPPDATA)cameraapp_FreeAppData) ) // the FreeAppData function is called after sending EVT_APP_STOP to the HandleEvent function
{
//Initialize applet data, this is called before sending EVT_APP_START
// to the HandleEvent function
if(cameraapp_InitAppData((cameraapp*)*ppObj))
{
//Data initialized successfully
return(AEE_SUCCESS);
}
else
{
//Release the applet. This will free the memory allocated for the applet when
// AEEApplet_New was called.
IAPPLET_Release((IApplet*)*ppObj);
return EFAILED;
}
} // end AEEApplet_New
}
return(EFAILED);

/*===========================================================================
FUNCTION SampleAppWizard_HandleEvent
DESCRIPTION
This is the EventHandler for this app. All events to this app are handled in this
function. All APPs must supply an Event Handler.
PROTOTYPE:
boolean SampleAppWizard_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
PARAMETERS:
pi: Pointer to the AEEApplet structure. This structure contains information specific
to this applet. It was initialized during the AEEClsCreateInstance() function.
ecode: Specifies the Event sent to this applet
wParam, dwParam: Event specific data.
DEPENDENCIES
none
RETURN VALUE
TRUE: If the app has processed the event
FALSE: If the app did not process the event
SIDE EFFECTS
none
===========================================================================*/
static boolean cameraapp_HandleEvent(cameraapp* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, L"Sample Camera Appliocation", -1, 0,0, NULL, IDF_ALIGN_TOP|IDF_ALIGN_CENTER );
IDISPLAY_Update(pMe->a.m_pIDisplay);
CApp_StartCameraInPreviewMode(pMe);
return(TRUE);
// App is told it is exiting
case EVT_APP_STOP:
// Add your code here...
return(TRUE);
// App is being suspended
case EVT_APP_SUSPEND:
// Add your code here...
return(TRUE);
// App is being resumed
case EVT_APP_RESUME:
// Add your code here...
return(TRUE);
// An SMS message has arrived for this app. Message is in the dwParam above as (char *)
// sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
case EVT_APP_MESSAGE:
// Add your code here...
return(TRUE);
// A key was pressed. Look at the wParam above to see which key was pressed. The key
// codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
case EVT_KEY:
// Add your code here...
return(TRUE);
// If nothing fits up to this point then we'll just break out
default:
break;
}
return FALSE;

// this function is called when your application is starting up
boolean cameraapp_InitAppData(cameraapp* pMe)
{
// Get the device information for this handset.
// Reference all the data by looking at the pMe->DeviceInfo structure
// Check the API reference guide for all the handy device info you can get
pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
// Insert your code here for initializing or allocating resources...
pMe->m_sizePreview.cx = 176;
pMe->m_sizePreview.cy = 120;
pMe->m_pIDisplay = pMe->a.m_pIDisplay;
pMe->m_pICamera = NULL;
// if there have been no failures up to this point then return success
return TRUE;

// this function is called when your application is exiting
void cameraapp_FreeAppData(cameraapp* pMe)
{
// insert your code here for freeing any resources you have allocated...
// example to use for releasing each interface:
// if ( pMe->pIMenuCtl != NULL ) // check for NULL first
// {
// IMENUCTL_Release(pMe->pIMenuCtl) // release the interface
// pMe->pIMenuCtl = NULL; // set to NULL so no problems trying to free later
// }
//
}
static int CApp_StartCameraInPreviewMode(CApp * pme)
{
int nErr;
int nRet;
// Create ICamera instance.
nErr = ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_CAMERA, (void **)&pme->m_pICamera);
if (nErr) -> EFAILED
return nErr;
// Register callback notification function.
nRet = ICAMERA_RegisterNotify(pme->m_pICamera, CApp_CameraNotify, pme);
if (nErr)
return nErr;
//ICAMERA_SetDisplaySize(pme->m_pICamera, &pme->m_sizePreview);
nErr = ICAMERA_SetParm(pme->m_pICamera, CAM_PARM_PREVIEW_TYPE, CAM_PREVIEW_SNAPSHOT, 0);
if (nErr)
return nErr;
//ICAMERA_SetSize( pme->m_pICamera, &pme->m_sizeFrame);
nErr = ICAMERA_Preview(pme->m_pICamera);
if (nErr)
return nErr;
return SUCCESS;
}
static void CApp_CameraNotify(void * pUser, AEECameraNotify * pn)
{
CApp * pme = (CApp *)pUser;
if (!pme || !pn)
return;
switch (pn->nStatus)
{
case CAM_STATUS_START:
// Preview has begun...
break;
case 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(pme->m_pICamera, &pFrame))
return;
// Get the bitmap info...this can be saved in app global structure.
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
// Display the frame at (0, 0) location of the screen
IDISPLAY_BitBlt(pme->a.m_pIDisplay, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_DONE:
// ICAMERA_Stop() was called and preview operation stopped.
DBGPRINTF( "CAM_STATUS_DONE\n" );
break;
case CAM_STATUS_ABORT:
// Preview got aborted.
DBGPRINTF( "CAM_STATUS_ABORT\n" );
break;
}

I'm new to BREW and i'm working wth ICamera. Let me know what are the requirements to run a sample program using ICamera.
I did one sample coding using this is ICamera and i'm running that with the emulator LG VX8600. And i also modified the Mif file also.
All things are said to be right, but i don't have any WebCam. Is that WebCam is needed/not?
I'm getting the error EFAILED in Create Instance.
coding given below:
/*===========================================================================
FILE: cameraapp.c
===========================================================================*/
/*===============================================================================
INCLUDES AND VARIABLE DEFINITIONS
=============================================================================== */
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEStdlib.h"
#include "AEECamera.h" // Camera interface definitions
#include "AEEFile.h" // File interface definitions
#include "cameraapp.bid"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
// create an applet structure that's passed around. All variables in
// here will be able to be referenced as static.
typedef struct _cameraapp {
AEEApplet a ; // First element of this structure must be AEEApplet
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
// add your own variables here...
ICamera * m_pICamera;
IDisplay * m_pIDisplay;
AEESize m_sizeFrame,m_sizePreview;
} cameraapp,CApp;
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean cameraapp_HandleEvent(cameraapp* pMe,
AEEEvent eCode, uint16 wParam,
uint32 dwParam);
boolean cameraapp_InitAppData(cameraapp* pMe);
void cameraapp_FreeAppData(cameraapp* pMe);
static int CApp_StartCameraInPreviewMode(CApp * pMe);
static void CApp_CameraNotify(void * , AEECameraNotify *);
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
*ppObj = NULL;
if( ClsId == AEECLSID_CAMERAAPP )
{
// Create the applet and make room for the applet structure
if( AEEApplet_New(sizeof(cameraapp),
ClsId,
pIShell,
po,
(IApplet**)ppObj,
(AEEHANDLER)cameraapp_HandleEvent,
(PFNFREEAPPDATA)cameraapp_FreeAppData) ) // the FreeAppData function is called after sending EVT_APP_STOP to the HandleEvent function
{
//Initialize applet data, this is called before sending EVT_APP_START
// to the HandleEvent function
if(cameraapp_InitAppData((cameraapp*)*ppObj))
{
//Data initialized successfully
return(AEE_SUCCESS);
}
else
{
//Release the applet. This will free the memory allocated for the applet when
// AEEApplet_New was called.
IAPPLET_Release((IApplet*)*ppObj);
return EFAILED;
}
} // end AEEApplet_New
}
return(EFAILED);

/*===========================================================================
FUNCTION SampleAppWizard_HandleEvent
DESCRIPTION
This is the EventHandler for this app. All events to this app are handled in this
function. All APPs must supply an Event Handler.
PROTOTYPE:
boolean SampleAppWizard_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
PARAMETERS:
pi: Pointer to the AEEApplet structure. This structure contains information specific
to this applet. It was initialized during the AEEClsCreateInstance() function.
ecode: Specifies the Event sent to this applet
wParam, dwParam: Event specific data.
DEPENDENCIES
none
RETURN VALUE
TRUE: If the app has processed the event
FALSE: If the app did not process the event
SIDE EFFECTS
none
===========================================================================*/
static boolean cameraapp_HandleEvent(cameraapp* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, L"Sample Camera Appliocation", -1, 0,0, NULL, IDF_ALIGN_TOP|IDF_ALIGN_CENTER );
IDISPLAY_Update(pMe->a.m_pIDisplay);
CApp_StartCameraInPreviewMode(pMe);
return(TRUE);
// App is told it is exiting
case EVT_APP_STOP:
// Add your code here...
return(TRUE);
// App is being suspended
case EVT_APP_SUSPEND:
// Add your code here...
return(TRUE);
// App is being resumed
case EVT_APP_RESUME:
// Add your code here...
return(TRUE);
// An SMS message has arrived for this app. Message is in the dwParam above as (char *)
// sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
case EVT_APP_MESSAGE:
// Add your code here...
return(TRUE);
// A key was pressed. Look at the wParam above to see which key was pressed. The key
// codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
case EVT_KEY:
// Add your code here...
return(TRUE);
// If nothing fits up to this point then we'll just break out
default:
break;
}
return FALSE;

// this function is called when your application is starting up
boolean cameraapp_InitAppData(cameraapp* pMe)
{
// Get the device information for this handset.
// Reference all the data by looking at the pMe->DeviceInfo structure
// Check the API reference guide for all the handy device info you can get
pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
// Insert your code here for initializing or allocating resources...
pMe->m_sizePreview.cx = 176;
pMe->m_sizePreview.cy = 120;
pMe->m_pIDisplay = pMe->a.m_pIDisplay;
pMe->m_pICamera = NULL;
// if there have been no failures up to this point then return success
return TRUE;

// this function is called when your application is exiting
void cameraapp_FreeAppData(cameraapp* pMe)
{
// insert your code here for freeing any resources you have allocated...
// example to use for releasing each interface:
// if ( pMe->pIMenuCtl != NULL ) // check for NULL first
// {
// IMENUCTL_Release(pMe->pIMenuCtl) // release the interface
// pMe->pIMenuCtl = NULL; // set to NULL so no problems trying to free later
// }
//
}
static int CApp_StartCameraInPreviewMode(CApp * pme)
{
int nErr;
int nRet;
// Create ICamera instance.
nErr = ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_CAMERA, (void **)&pme->m_pICamera);
if (nErr) -> EFAILED
return nErr;
// Register callback notification function.
nRet = ICAMERA_RegisterNotify(pme->m_pICamera, CApp_CameraNotify, pme);
if (nErr)
return nErr;
//ICAMERA_SetDisplaySize(pme->m_pICamera, &pme->m_sizePreview);
nErr = ICAMERA_SetParm(pme->m_pICamera, CAM_PARM_PREVIEW_TYPE, CAM_PREVIEW_SNAPSHOT, 0);
if (nErr)
return nErr;
//ICAMERA_SetSize( pme->m_pICamera, &pme->m_sizeFrame);
nErr = ICAMERA_Preview(pme->m_pICamera);
if (nErr)
return nErr;
return SUCCESS;
}
static void CApp_CameraNotify(void * pUser, AEECameraNotify * pn)
{
CApp * pme = (CApp *)pUser;
if (!pme || !pn)
return;
switch (pn->nStatus)
{
case CAM_STATUS_START:
// Preview has begun...
break;
case 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(pme->m_pICamera, &pFrame))
return;
// Get the bitmap info...this can be saved in app global structure.
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
// Display the frame at (0, 0) location of the screen
IDISPLAY_BitBlt(pme->a.m_pIDisplay, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_DONE:
// ICAMERA_Stop() was called and preview operation stopped.
DBGPRINTF( "CAM_STATUS_DONE\n" );
break;
case CAM_STATUS_ABORT:
// Preview got aborted.
DBGPRINTF( "CAM_STATUS_ABORT\n" );
break;
}

hi
i'm also facing the same problem...as per i know mif should contain aeeclsid_camera in dependencies of mif of application...if u have solved this, then plz let me know which clsid u have used for camera.dll.....

hi
i'm also facing the same problem...as per i know mif should contain aeeclsid_camera in dependencies of mif of application...if u have solved this, then plz let me know which clsid u have used for camera.dll.....

I attached my Camera Application in this thread. For running this apllication we need to Check 1. The device supports Camera which is in the Data Sheet of the device. 2. Web Camera is Important. 3. Create the Mif file for your application in which goto Dependencies tab in which their is a title : External Class used by this Module in that list select CAMERA1 and press ADD save that.
This is coding for ICamera Api. IF any problem ask me.
FILE: cameraapp.c
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEStdlib.h"
#include "AEECamera.h" // Camera interface definitions
#include "AEEDisp.h " // Display interface definitions
#include "AEEFile.h" // File interface definitions
#include "cameraapp.bid"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
typedef struct _cameraapp {
AEEApplet a ; // First element of this structure must be AEEApplet
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
// add your own variables here...
ICamera * m_pICamera;
IDisplay * m_pIDisplay;
IBitmap * m_pIBitMap;
AEESize m_sizeFrame,m_sizePreview;
} cameraapp,CApp;
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean cameraapp_HandleEvent(cameraapp* pMe,
AEEEvent eCode, uint16 wParam,
uint32 dwParam);
boolean cameraapp_InitAppData(cameraapp* pMe);
void cameraapp_FreeAppData(cameraapp* pMe);
static int CApp_StartCameraInPreviewMode(CApp * pMe);
static void CApp_CameraNotify(void * , AEECameraNotify *);
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
*ppObj = NULL;
if( ClsId == AEECLSID_CAMERAAPP )
{
// Create the applet and make room for the applet structure
if( AEEApplet_New(sizeof(cameraapp),
ClsId,
pIShell,
po,
(IApplet**)ppObj,
(AEEHANDLER)cameraapp_HandleEvent,
(PFNFREEAPPDATA)cameraapp_FreeAppData) ) // the FreeAppData function is called after sending EVT_APP_STOP to the HandleEvent function
{
//Initialize applet data, this is called before sending EVT_APP_START
// to the HandleEvent function
if(cameraapp_InitAppData((cameraapp*)*ppObj))
{
//Data initialized successfully
return(AEE_SUCCESS);
}
else
{
//Release the applet. This will free the memory allocated for the applet when
// AEEApplet_New was called.
IAPPLET_Release((IApplet*)*ppObj);
return EFAILED;
}
} // end AEEApplet_New
}
return(EFAILED);

/*===========================================================================
FUNCTION SampleAppWizard_HandleEvent
DESCRIPTION
This is the EventHandler for this app. All events to this app are handled in this
function. All APPs must supply an Event Handler.
PROTOTYPE:
boolean SampleAppWizard_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
PARAMETERS:
pi: Pointer to the AEEApplet structure. This structure contains information specific
to this applet. It was initialized during the AEEClsCreateInstance() function.
ecode: Specifies the Event sent to this applet
wParam, dwParam: Event specific data.
DEPENDENCIES
none
RETURN VALUE
TRUE: If the app has processed the event
FALSE: If the app did not process the event
SIDE EFFECTS
none
===========================================================================*/
static boolean cameraapp_HandleEvent(cameraapp* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
/*IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, L"Sample Camera Appliocation", -1, 0,0, NULL, IDF_ALIGN_TOP|IDF_ALIGN_CENTER );
IDISPLAY_Update(pMe->a.m_pIDisplay);*/
CApp_StartCameraInPreviewMode(pMe);
return(TRUE);
// App is told it is exiting
case EVT_APP_STOP:
// Add your code here...
return(TRUE);
// App is being suspended
case EVT_APP_SUSPEND:
// Add your code here...
return(TRUE);
// App is being resumed
case EVT_APP_RESUME:
// Add your code here...
return(TRUE);
// An SMS message has arrived for this app. Message is in the dwParam above as (char *)
// sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
case EVT_APP_MESSAGE:
// Add your code here...
return(TRUE);
// A key was pressed. Look at the wParam above to see which key was pressed. The key
// codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
case EVT_KEY:
// Add your code here...
return(TRUE);
// If nothing fits up to this point then we'll just break out
default:
break;
}
return FALSE;

// this function is called when your application is starting up
boolean cameraapp_InitAppData(cameraapp* pMe)
{
// Get the device information for this handset.
// Reference all the data by looking at the pMe->DeviceInfo structure
// Check the API reference guide for all the handy device info you can get
pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
// Insert your code here for initializing or allocating resources...
pMe->m_sizePreview.cx = 120;
pMe->m_sizePreview.cy = 150;
pMe->m_pIDisplay = pMe->a.m_pIDisplay;
pMe->m_pICamera = NULL;
// if there have been no failures up to this point then return success
return TRUE;

// this function is called when your application is exiting
void cameraapp_FreeAppData(cameraapp* pMe)
{
// insert your code here for freeing any resources you have allocated...
// example to use for releasing each interface:
// if ( pMe->pIMenuCtl != NULL ) // check for NULL first
// {
// IMENUCTL_Release(pMe->pIMenuCtl) // release the interface
// pMe->pIMenuCtl = NULL; // set to NULL so no problems trying to free later
// }
//
}
static int CApp_StartCameraInPreviewMode(CApp * pme)
{
int nErr;
int nRet;
boolean bTrue;
IBitmap * pFrame;
AEEBitmapInfo bi;
// Create ICamera instance.
nErr = ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_CAMERA, (void **)&pme->m_pICamera);
if (nErr)
return nErr;
// Register callback notification function.
nRet = ICAMERA_RegisterNotify(pme->m_pICamera, CApp_CameraNotify, pme);
if (nErr)
return nErr;
nErr = ICAMERA_SetDisplaySize(pme->m_pICamera, &pme->m_sizePreview);
if(nErr)
return nErr;
/*nErr = ICAMERA_IsSupport(pme->m_pICamera, CAM_PARM_PREVIEW_TYPE, &bTrue);
if(bTrue)
return nErr;
nErr = ICAMERA_IsSupport(pme->m_pICamera, CAM_PREVIEW_SNAPSHOT, &bTrue);
if(!bTrue)
return nErr;*/
/*nErr = ICAMERA_SetParm(pme->m_pICamera, CAM_PARM_PREVIEW_TYPE, CAM_PREVIEW_SNAPSHOT, 0);
if (nErr)
return nErr;*/
pme->m_sizeFrame.cx = 130;
pme->m_sizeFrame.cy = 150;
ICAMERA_SetSize( pme->m_pICamera, &pme->m_sizeFrame);
nErr = ICAMERA_Preview(pme->m_pICamera);
if (nErr != SUCCESS)
return nErr;
return SUCCESS;
}
static void CApp_CameraNotify(void * pUser, AEECameraNotify * pn)
{
CApp * pme = (CApp *)pUser;
DBGPRINTF( "\n Inside Notify\n" );
if (!pme || !pn)
return;
switch (pn->nStatus)
{
case CAM_STATUS_START:
// Preview has begun...
DBGPRINTF( "\n Inside START\n" );
break;
case CAM_STATUS_FRAME:
{
IBitmap * pFrame;
AEEBitmapInfo bi;
//
// IMPORTANT NOTE: You need to do IBITMAP_Release(pFrame) after you're done with pFrame.
//
DBGPRINTF( "\n Inside Display\n" );
if (SUCCESS != ICAMERA_GetFrame(pme->m_pICamera, &pFrame))
return;
// Get the bitmap info...this can be saved in app global structure.
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
// Display the frame at (0, 0) location of the screen
IDISPLAY_BitBlt(pme->a.m_pIDisplay, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IDISPLAY_Update(pme->a.m_pIDisplay);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_DONE:
// ICAMERA_Stop() was called and preview operation stopped.
DBGPRINTF( "CAM_STATUS_DONE\n" );
break;
case CAM_STATUS_ABORT:
// Preview got aborted.
DBGPRINTF( "CAM_STATUS_ABORT\n" );
break;
}

I attached my Camera Application in this thread. For running this apllication we need to Check 1. The device supports Camera which is in the Data Sheet of the device. 2. Web Camera is Important. 3. Create the Mif file for your application in which goto Dependencies tab in which their is a title : External Class used by this Module in that list select CAMERA1 and press ADD save that.
This is coding for ICamera Api. IF any problem ask me.
FILE: cameraapp.c
#include "AEEModGen.h" // Module interface definitions
#include "AEEAppGen.h" // Applet interface definitions
#include "AEEShell.h" // Shell interface definitions
#include "AEEStdlib.h"
#include "AEECamera.h" // Camera interface definitions
#include "AEEDisp.h " // Display interface definitions
#include "AEEFile.h" // File interface definitions
#include "cameraapp.bid"
/*-------------------------------------------------------------------
Applet structure. All variables in here are reference via "pMe->"
-------------------------------------------------------------------*/
typedef struct _cameraapp {
AEEApplet a ; // First element of this structure must be AEEApplet
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information
// add your own variables here...
ICamera * m_pICamera;
IDisplay * m_pIDisplay;
IBitmap * m_pIBitMap;
AEESize m_sizeFrame,m_sizePreview;
} cameraapp,CApp;
/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
static boolean cameraapp_HandleEvent(cameraapp* pMe,
AEEEvent eCode, uint16 wParam,
uint32 dwParam);
boolean cameraapp_InitAppData(cameraapp* pMe);
void cameraapp_FreeAppData(cameraapp* pMe);
static int CApp_StartCameraInPreviewMode(CApp * pMe);
static void CApp_CameraNotify(void * , AEECameraNotify *);
/*===============================================================================
FUNCTION DEFINITIONS
=============================================================================== */
int AEEClsCreateInstance(AEECLSID ClsId, IShell *pIShell, IModule *po, void **ppObj)
{
*ppObj = NULL;
if( ClsId == AEECLSID_CAMERAAPP )
{
// Create the applet and make room for the applet structure
if( AEEApplet_New(sizeof(cameraapp),
ClsId,
pIShell,
po,
(IApplet**)ppObj,
(AEEHANDLER)cameraapp_HandleEvent,
(PFNFREEAPPDATA)cameraapp_FreeAppData) ) // the FreeAppData function is called after sending EVT_APP_STOP to the HandleEvent function
{
//Initialize applet data, this is called before sending EVT_APP_START
// to the HandleEvent function
if(cameraapp_InitAppData((cameraapp*)*ppObj))
{
//Data initialized successfully
return(AEE_SUCCESS);
}
else
{
//Release the applet. This will free the memory allocated for the applet when
// AEEApplet_New was called.
IAPPLET_Release((IApplet*)*ppObj);
return EFAILED;
}
} // end AEEApplet_New
}
return(EFAILED);

/*===========================================================================
FUNCTION SampleAppWizard_HandleEvent
DESCRIPTION
This is the EventHandler for this app. All events to this app are handled in this
function. All APPs must supply an Event Handler.
PROTOTYPE:
boolean SampleAppWizard_HandleEvent(IApplet * pi, AEEEvent eCode, uint16 wParam, uint32 dwParam)
PARAMETERS:
pi: Pointer to the AEEApplet structure. This structure contains information specific
to this applet. It was initialized during the AEEClsCreateInstance() function.
ecode: Specifies the Event sent to this applet
wParam, dwParam: Event specific data.
DEPENDENCIES
none
RETURN VALUE
TRUE: If the app has processed the event
FALSE: If the app did not process the event
SIDE EFFECTS
none
===========================================================================*/
static boolean cameraapp_HandleEvent(cameraapp* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
switch (eCode)
{
// App is told it is starting up
case EVT_APP_START:
// Add your code here...
/*IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);
IDISPLAY_DrawText(pMe->a.m_pIDisplay, AEE_FONT_BOLD, L"Sample Camera Appliocation", -1, 0,0, NULL, IDF_ALIGN_TOP|IDF_ALIGN_CENTER );
IDISPLAY_Update(pMe->a.m_pIDisplay);*/
CApp_StartCameraInPreviewMode(pMe);
return(TRUE);
// App is told it is exiting
case EVT_APP_STOP:
// Add your code here...
return(TRUE);
// App is being suspended
case EVT_APP_SUSPEND:
// Add your code here...
return(TRUE);
// App is being resumed
case EVT_APP_RESUME:
// Add your code here...
return(TRUE);
// An SMS message has arrived for this app. Message is in the dwParam above as (char *)
// sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
case EVT_APP_MESSAGE:
// Add your code here...
return(TRUE);
// A key was pressed. Look at the wParam above to see which key was pressed. The key
// codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
case EVT_KEY:
// Add your code here...
return(TRUE);
// If nothing fits up to this point then we'll just break out
default:
break;
}
return FALSE;

// this function is called when your application is starting up
boolean cameraapp_InitAppData(cameraapp* pMe)
{
// Get the device information for this handset.
// Reference all the data by looking at the pMe->DeviceInfo structure
// Check the API reference guide for all the handy device info you can get
pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
// Insert your code here for initializing or allocating resources...
pMe->m_sizePreview.cx = 120;
pMe->m_sizePreview.cy = 150;
pMe->m_pIDisplay = pMe->a.m_pIDisplay;
pMe->m_pICamera = NULL;
// if there have been no failures up to this point then return success
return TRUE;

// this function is called when your application is exiting
void cameraapp_FreeAppData(cameraapp* pMe)
{
// insert your code here for freeing any resources you have allocated...
// example to use for releasing each interface:
// if ( pMe->pIMenuCtl != NULL ) // check for NULL first
// {
// IMENUCTL_Release(pMe->pIMenuCtl) // release the interface
// pMe->pIMenuCtl = NULL; // set to NULL so no problems trying to free later
// }
//
}
static int CApp_StartCameraInPreviewMode(CApp * pme)
{
int nErr;
int nRet;
boolean bTrue;
IBitmap * pFrame;
AEEBitmapInfo bi;
// Create ICamera instance.
nErr = ISHELL_CreateInstance(pme->a.m_pIShell, AEECLSID_CAMERA, (void **)&pme->m_pICamera);
if (nErr)
return nErr;
// Register callback notification function.
nRet = ICAMERA_RegisterNotify(pme->m_pICamera, CApp_CameraNotify, pme);
if (nErr)
return nErr;
nErr = ICAMERA_SetDisplaySize(pme->m_pICamera, &pme->m_sizePreview);
if(nErr)
return nErr;
/*nErr = ICAMERA_IsSupport(pme->m_pICamera, CAM_PARM_PREVIEW_TYPE, &bTrue);
if(bTrue)
return nErr;
nErr = ICAMERA_IsSupport(pme->m_pICamera, CAM_PREVIEW_SNAPSHOT, &bTrue);
if(!bTrue)
return nErr;*/
/*nErr = ICAMERA_SetParm(pme->m_pICamera, CAM_PARM_PREVIEW_TYPE, CAM_PREVIEW_SNAPSHOT, 0);
if (nErr)
return nErr;*/
pme->m_sizeFrame.cx = 130;
pme->m_sizeFrame.cy = 150;
ICAMERA_SetSize( pme->m_pICamera, &pme->m_sizeFrame);
nErr = ICAMERA_Preview(pme->m_pICamera);
if (nErr != SUCCESS)
return nErr;
return SUCCESS;
}
static void CApp_CameraNotify(void * pUser, AEECameraNotify * pn)
{
CApp * pme = (CApp *)pUser;
DBGPRINTF( "\n Inside Notify\n" );
if (!pme || !pn)
return;
switch (pn->nStatus)
{
case CAM_STATUS_START:
// Preview has begun...
DBGPRINTF( "\n Inside START\n" );
break;
case CAM_STATUS_FRAME:
{
IBitmap * pFrame;
AEEBitmapInfo bi;
//
// IMPORTANT NOTE: You need to do IBITMAP_Release(pFrame) after you're done with pFrame.
//
DBGPRINTF( "\n Inside Display\n" );
if (SUCCESS != ICAMERA_GetFrame(pme->m_pICamera, &pFrame))
return;
// Get the bitmap info...this can be saved in app global structure.
IBITMAP_GetInfo(pFrame, &bi, sizeof(bi));
// Display the frame at (0, 0) location of the screen
IDISPLAY_BitBlt(pme->a.m_pIDisplay, 0, 0, bi.cx, bi.cy, pFrame, 0, 0, AEE_RO_COPY);
IDISPLAY_Update(pme->a.m_pIDisplay);
IBITMAP_Release(pFrame);
break;
}
case CAM_STATUS_DONE:
// ICAMERA_Stop() was called and preview operation stopped.
DBGPRINTF( "CAM_STATUS_DONE\n" );
break;
case CAM_STATUS_ABORT:
// Preview got aborted.
DBGPRINTF( "CAM_STATUS_ABORT\n" );
break;
}

ram19382 wrote:I attached my Camera Application in this thread. For running this apllication we need to Check 1. The device supports Camera which is in the Data Sheet of the device. 2. Web Camera is Important. 3. Create the Mif file for your application in which goto Dependencies tab in which their is a title : External Class used by this Module in that list select CAMERA1 and press ADD save that.
This is coding for ICamera Api. IF any problem ask me.
Hello all
I could not find any dependency list for External Class . Where I can find the CAMERA1 ? Is there any BID or mif file for CAMERA1 what they contains ? Thanks in advance .

ram19382 wrote:I attached my Camera Application in this thread. For running this apllication we need to Check 1. The device supports Camera which is in the Data Sheet of the device. 2. Web Camera is Important. 3. Create the Mif file for your application in which goto Dependencies tab in which their is a title : External Class used by this Module in that list select CAMERA1 and press ADD save that.
This is coding for ICamera Api. IF any problem ask me.
Hello all
I could not find any dependency list for External Class . Where I can find the CAMERA1 ? Is there any BID or mif file for CAMERA1 what they contains ? Thanks in advance .