forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Chotto Cam accessing
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sashimi



Joined: 16 Nov 2006
Posts: 9

PostPosted: Mon Nov 27, 2006 7:03 am    Post subject: Chotto Cam accessing Reply with quote

Hi everyone,
I am pretty new to psp homebrew programming (although I am not new to programming in itself).
A week ago, I at last recieved this tiny USB Chotto Camera for PSP straight from Japan. I have been waiting for ages for this camera to be released, as my main interest in psp homebrew is videocam-related (tracking, augmented reality, and so on...).
BUT, before I get round to all these interested things, first of all, I need to be able to access/read this damn USB device.
I've been searching the forums and haven't found anything about the camera itself, and very little information about accessing the usb port...

I know the commercial Chotto shot Edit UMD require usbcam.prx and usbmic.prx to access the device, so maybe using calls to the usbcam.prx could be a way (instead of merely reprogramming a camera driver), but this prx would require to know what, where and how to access these calls... and I unfortunately don't have the faintest idea how to that.

Anyone here have any idea? clue?

Thx very much in advance.

Yours sincerily,
sashimi

ps: if this topic is best in the software development section, then please let it be.
Back to top
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Mon Nov 27, 2006 5:23 pm    Post subject: Reply with quote

The usbcam.prx/usbmic.prx have got an exhaustive API set to control the camera, but how to use them is yet unknown. You should look into how that "Chotto shot Edit" thingy works :)
Back to top
View user's profile Send private message
sashimi



Joined: 16 Nov 2006
Posts: 9

PostPosted: Mon Nov 27, 2006 7:31 pm    Post subject: Reply with quote

I thought about that, but how am I supposed to "look into that" ? :°]
Back to top
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Sat Dec 02, 2006 2:26 am    Post subject: Reply with quote

Okay, I looked a little into camera_plugin.prx from FW3.01 and BOOT.BIN from Chotto Edit, and there is a nice set of APIs to call for the camera to work :)
There are two modes for picture input, which require different API sets:
- still picture
- video

Furthermore there are APIs to get the sound with the integrated microphone.
As I don't have a Chotto Cam, it is impossible for me to test out what I disassemble...
So... How does it work? Well, first you have to initialize the camera. This is done very trivially, as one does not need to do much: just load the usb driver modules and start them. :) Assuming usbacc.prx and usbcam.prx are loaded by your app, these are the steps you need to do to enable the camera: (add error checking and other stuff on ret != 0)
Code:

sceUsbStart("USBBusDriver", 0, 0);
sceUsbStart("USBAccBaseDriver", 0, 0);
sceUsbStart("USBCamDriver", 0, 0);
sceUsbStart("USBCamMicDriver", 0, 0);

At the end of your app you will also need to stop the drivers, so just take the above calls and replace sceUsbStart by sceUsbStop...

Now the camera should be initialized, which is quite good.
I haven't yet looked in detail into the video part, because it takes some setup for codecs etc, but I think this is the way it works for the still pictures:
1) allocate memory buffer of something like 2097152 bytes (what it does in the camera_plugin.prx). It allocates it in a weird way, by using 64 byte clusters(?)
2) Then, call the function for getting the image with the buffer address as the parameter and buffer size divided by 64 as the second one...
3) Finally, wait for the image input to be finished with the waitinputend function. Add the error checking as usual.... (/me waaay too lazy to do that)
Code:

//sceUsbCamStillInput
//(second param to confirm...)
int sceUsbCam_FB0A6C5D(void* buffer, int buffer_64k_size);
//sceUsbCamStillWaitInputEnd
int sceUsbCam_7563AFA1(void);


These functions should be imported with the stubs generated by the various tools provided in the pspsdk (psplink --stubs :P)...

Now, a last "Post Mortem"... There are only preliminary finds in the ORDER of the functions to call, but there might be some more initialization necessary earlier on in the application. I'll try to track down the still image capture from the module_start, in order to get the inits right.

About the movies and sound, I haven't figures all of the things out but this is the set of functions to call, in some definite order and arguments which i didn't figure out yet:
Code:

sceUsbCam_CFE9E999 //microphone codec and buffer init.
sceUsbCam_2E930264 //video codec and buffer init.
sceUsbCam_1D686870 //int sceUsbCamSetEvLevel(int EvLevel);
sceUsbCam_574A8C3F //sceUsbCamStartVideo
sceUsbCam_82A64030 //sceUsbCamStartMic
sceUsbCam_4C34F553 //sceUsbCamGetLensDirection
sceUsbCam_D293A100 //sceUsbCamRegisterLensRotationCallback
sceUsbCam_C484901F //sceUsbCamSetZoom
sceUsbCam_3DC0088E //sceUsbCamReadMic
sceUsbCam_99D86281 //sceUsbCamReadVideoFrame
sceUsbCam_B048A67D //sceUsbCamWaitReadMicEnd
sceUsbCam_F90B2293 //sceUsbCamWaitReadVideoFrameEnd
sceUsbCam_41EE8797 //sceUsbCamUnregisterLensRotationCallback
sceUsbCam_6CF32CB9 //sceUsbCamStopVideo
sceUsbCam_5145868A //sceUsbCamStopMic


Sorry for the imprecise info, but I'd just need a bit more time and a little confirmation/infirmation about the still image capture before going on :)

Cheers,

Adrahil
Back to top
View user's profile Send private message
sashimi



Joined: 16 Nov 2006
Posts: 9

PostPosted: Sat Dec 02, 2006 10:27 am    Post subject: Reply with quote

Hi!
I am definitively thrilled to find someone working on it (at last :) ).
I have got plenty of work meanwhile, I won't be able to take a dip into this for a little while, but if ever you want me to test some code, I'd be very happy to help, as I have got the chotto cam.
I'll be waiting for some news from you :p

Thank you very much for your work!

faithfully,
sashimi
Back to top
View user's profile Send private message
sashimi



Joined: 16 Nov 2006
Posts: 9

PostPosted: Sat Mar 10, 2007 6:05 am    Post subject: Reply with quote

Up!

Is there any news about camera programming?

Thx in advance.
Back to top
View user's profile Send private message
califrag



Joined: 04 Apr 2007
Posts: 30

PostPosted: Wed Apr 18, 2007 6:25 pm    Post subject: Reply with quote

*BUMP*
I was looking into the camera api calls myself and found this nifty bit of information. HTH. please let me know if you make any progress with this and I will post my findings as well..

http://moonlight.lan.st/2.80/kd/usbcam.html
Back to top
View user's profile Send private message
sashimi



Joined: 16 Nov 2006
Posts: 9

PostPosted: Sun May 20, 2007 4:57 am    Post subject: Reply with quote

*bump again*
Any update about accessing the chotto cam ?
I feel very frustrated about the lack of interest about the camera, coz a bunch of projects I have in mind involve video input :/

Please, could anyone with reverse engineering skills out there take a look at 3.40 usbcam.prx and usbacc.prx?

Thx very much in advance!

Cheers
Back to top
View user's profile Send private message
everlasting



Joined: 19 Mar 2007
Posts: 41

PostPosted: Sun May 20, 2007 10:38 am    Post subject: Reply with quote

I´m very interested in accessing the camera but i have no idea how to treat or decrypt a prx. If anyone could help me to find a tutorial or tools for making it, i would be grateful. I´ve got 3.40 firmware so I would be looking at the prx of this firmware.
Back to top
View user's profile Send private message
gambiting



Joined: 17 Aug 2006
Posts: 154

PostPosted: Fri Jun 01, 2007 1:51 am    Post subject: Reply with quote

Hi! My camera arrived today,and I would like to see how to program it.Anyone would be able to help and show me how should I include that prx in my program and how should my makefile look like to compile it correctly?Thanks
Back to top
View user's profile Send private message
Cubane



Joined: 26 Jun 2007
Posts: 5

PostPosted: Tue Jun 26, 2007 9:47 pm    Post subject: Reply with quote

I thought I might bump this topic up a little as well since there seems to be a bit of interest here.

I just got one of the cameras last week and I am pretty keen to get it working for us homebrew devs. Unfortunately I have no experience reverse engineering any of the Sony prxes or with the assembly language needed to do so.

I have written up a program that is basically the start of adrahil's analysis.

ie
- load usbacc.prx & usbcam.prx
- start all the drivers USBBusDriver, USBAccBaseDriver, USBCamDriver & USBCamMicDriver

Once all that is done if I call sceUsbActivate(PSP_USBCAM_PID); the light comes on on the camera. The usb state from sceUsbGetState() is 0x211 when activated and 0x111 when deactivated

I'll give the sceUsbCamStillInput a go next and see if anything happens. I am not too sure where to go after that. Investigate usbcam.prx and try to figure out the API a bit further or investigate camera_plugin.prx and try and figure out how they are using the API. Camera_plugin.prx is a much larger program and from what I have checked out so far uses multiple threads to capture frames in the background so is probably a little more difficult for someone starting out with reverse engineering to get started on.

I'll keep you posted with my progress.

Edit* Forgot to mention with the GPS program source floating around there is an API call sceUsbGpsOpen() if anyone knows of a similar call needed for the camera please let me know.
Back to top
View user's profile Send private message
gambiting



Joined: 17 Aug 2006
Posts: 154

PostPosted: Tue Jun 26, 2007 10:47 pm    Post subject: Reply with quote

Hi! That's great that you figured it out,but could you give us source code?Or at last instruct us how to do it?Please,tell us,as I would like to try it out too,but as mentioned earlier I don't know how.
Back to top
View user's profile Send private message
Cubane



Joined: 26 Jun 2007
Posts: 5

PostPosted: Tue Jun 26, 2007 11:02 pm    Post subject: Reply with quote

There isn't much to the code. I have removed all the normal callbacks set up code and so forth. There is instructions on how to extract the prx files here [url]http://en.wikibooks.org/wiki/Map_This!#Extracting_usbacc.prx_and_usbgps.prx[/url]
just extract the usbcam.prx instead

Code:


// Define the module info section
PSP_MODULE_INFO("ARPSP", 0, 1, 1);

#define PSP_USBCAM_PID            0x282
unsigned int usbState = 0;

// Main function for our app
int main(int argc, char *argv[])
{
   SceCtrlData pad;

   pspDebugScreenInit();

   sceCtrlSetSamplingCycle(0);
   sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
   
   // set up usb system
   SceUID usbModule = 0;
   SceUID camModule = 0;
   usbModule = pspSdkLoadStartModule("usbacc.prx", PSP_MEMORY_PARTITION_KERNEL);
   camModule = pspSdkLoadStartModule("usbcam.prx", PSP_MEMORY_PARTITION_KERNEL);
   
   int usbBusRes = sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
   int usbBaseRes = sceUsbStart("USBAccBaseDriver", 0, 0);
   int usbCamRes = sceUsbStart("USBCamDriver", 0, 0);
   int usbCamMicRes = sceUsbStart("USBCamMicDriver", 0, 0);
   int usbResult = 0;
   
   while ( gameDone == 0 )
   {
      pspDebugScreenSetXY(0, 2);

         sceCtrlReadBufferPositive(&pad, 1);

      printf("usbModule = 0x%x \n", usbModule);
      printf("camModule = 0x%x \n", camModule);
      printf("result bus = %d \n", usbBusRes);
      printf("result base = %d \n", usbBaseRes);
      printf("result camera = %d \n", usbCamRes);
      printf("result mic = %d \n", usbCamMicRes);
      printf("result usb = %d \n", usbResult);
      printf("USB State = 0x%x %s \n", usbState, (usbState & PSP_USB_ACTIVATED) ? "[activated]    " : "[deactivated]");

      if ( pad.Buttons != 0 )
      {
         // Start / Stop Cam if CROSS
         if (pad.Buttons & PSP_CTRL_CROSS)
         {
            if (usbState & PSP_USB_ACTIVATED)
               usbResult = sceUsbDeactivate(PSP_USBCAM_PID);
            else
               usbResult = sceUsbActivate(PSP_USBCAM_PID);
            
//            sceUsbWaitCancel();
            
            // Get state of the USB
            usbState = sceUsbGetState();
         }
      }
   }
   
   // USB Deactivate
   sceUsbDeactivate(PSP_USBCAM_PID);
//   sceUsbWaitCancel();
   
   usbCamMicRes = sceUsbStop("USBCamMicDriver", 0, 0);
   usbCamRes = sceUsbStop("USBCamDriver",0,0);
   usbBaseRes = sceUsbStop("USBAccBaseDriver",0,0);
   usbBusRes = sceUsbStop(PSP_USBBUS_DRIVERNAME,0,0);
   
   sceKernelExitGame();
   return 0;
}
Back to top
View user's profile Send private message
gambiting



Joined: 17 Aug 2006
Posts: 154

PostPosted: Tue Jun 26, 2007 11:09 pm    Post subject: Reply with quote

That's great,I will certainly play with it,but I can't do it this week,as now I'm getting my motherboard replaced ;-( But I'm sure that is a move forward and it will lead us to something.Good work!
Back to top
View user's profile Send private message
Cubane



Joined: 26 Jun 2007
Posts: 5

PostPosted: Fri Jun 29, 2007 8:57 pm    Post subject: Reply with quote

I have tried calling those 2 function calls sceUsbCamStillInput and sceUsbCamStillWaitInputEnd. However if I include them in my program it just hangs and will eventually the PSP will turn off. I suspect there is something wrong with my stubs file.

I tried calling sceUsbCamSetupStill passing 0 as the parameter. It returns an error code (0x80243902) if I call it whether the usb device is activated or not. Since this doesn't make the PSP hang there must be something working with my stubs.

I am a bit stuck now as I would like to make sure my stubs and header are ok before going on. I'll past the contents of those files below. I am using the prx files from DA 3.40 OE firmware if it helps.

sceUsbCam.S
Code:

   .set noreorder

#include "pspstub.s"

   STUB_START   "sceUsbCam",0x00090000,0x00360005
   STUB_FUNC   0x03ED7A82,sceUsbCamSetupMic
   STUB_FUNC   0x08AEE98A,sceUsbCamSetMicGain
   STUB_FUNC   0x09C26C7E,sceUsbCamSetContrast
   STUB_FUNC   0x0A41A298,sceUsbCam_0A41A298
   STUB_FUNC   0x11A1F128,sceUsbCamGetAutoImageReverseState
   STUB_FUNC   0x17F7B2FB,sceUsbCamSetupVideo
   STUB_FUNC   0x1A46CFE7,sceUsbCamStillPollInputEnd
   STUB_FUNC   0x1D686870,sceUsbCamSetEvLevel
   STUB_FUNC   0x1E958148,sceUsbCam_1E958148
   STUB_FUNC   0x2BCD50C0,sceUsbCamGetEvLevel
   STUB_FUNC   0x2E930264,sceUsbCam_2E930264
   STUB_FUNC   0x36636925,sceUsbCamReadMicBlocking
   STUB_FUNC   0x383E9FA8,sceUsbCamGetSaturation
   STUB_FUNC   0x3DC0088E,sceUsbCamReadMic
   STUB_FUNC   0x3F0CF289,sceUsbCamSetupStill
   STUB_FUNC   0x41E73E95,sceUsbCamPollReadVideoFrameEnd
   STUB_FUNC   0x41EE8797,sceUsbCamUnregisterLensRotationCallback
   STUB_FUNC   0x4C34F553,sceUsbCamGetLensDirection
   STUB_FUNC   0x4F3D84D5,sceUsbCamSetBrightness
   STUB_FUNC   0x5145868A,sceUsbCamStopMic
   STUB_FUNC   0x574A8C3F,sceUsbCamStartVideo
   STUB_FUNC   0x5778B452,sceUsbCamGetMicDataLength
   STUB_FUNC   0x61BE5CAC,sceUsbCamStillInputBlocking
   STUB_FUNC   0x622F83CC,sceUsbCamSetSharpness
   STUB_FUNC   0x6784E6A8,sceUsbCam_6784E6A8
   STUB_FUNC   0x6CF32CB9,sceUsbCamStopVideo
   STUB_FUNC   0x6E205974,sceUsbCamSetSaturation
   STUB_FUNC   0x70F522C5,sceUsbCamGetBrightness
   STUB_FUNC   0x7563AFA1,sceUsbCamStillWaitInputEnd
   STUB_FUNC   0x7DAC0C71,sceUsbCamReadVideoFrameBlocking
   STUB_FUNC   0x82A64030,sceUsbCamStartMic
   STUB_FUNC   0x951BEDF5,sceUsbCamSetReverseMode
   STUB_FUNC   0x95F8901E,sceUsbCam_95F8901E
   STUB_FUNC   0x994471E0,sceUsbCamGetImageEffectMode
   STUB_FUNC   0x99D86281,sceUsbCamReadVideoFrame
   STUB_FUNC   0x9E8AAF8D,sceUsbCamGetZoom
   STUB_FUNC   0xA063A957,sceUsbCamGetContrast
   STUB_FUNC   0xA720937C,sceUsbCamStillCancelInput
   STUB_FUNC   0xAA7D94BA,sceUsbCam_AA7D94BA
   STUB_FUNC   0xB048A67D,sceUsbCamWaitReadMicEnd
   STUB_FUNC   0xC484901F,sceUsbCamSetZoom
   STUB_FUNC   0xC72ED6D3,sceUsbCam_C72ED6D3
   STUB_FUNC   0xCFE9E999,sceUsbCam_CFE9E999
   STUB_FUNC   0xD293A100,sceUsbCamRegisterLensRotationCallback
   STUB_FUNC   0xD4876173,sceUsbCamSetImageEffectMode
   STUB_FUNC   0xD5279339,sceUsbCamGetReverseMode
   STUB_FUNC   0xD865997B,sceUsbCam_D865997B
   STUB_FUNC   0xDF9D0C92,sceUsbCamGetReadVideoFrameSize
   STUB_FUNC   0xE5959C36,sceUsbCamStillGetInputLength
   STUB_FUNC   0xF8847F60,sceUsbCamPollReadMicEnd
   STUB_FUNC   0xF90B2293,sceUsbCamWaitReadVideoFrameEnd
   STUB_FUNC   0xF93C4669,sceUsbCamAutoImageReverseSW
   STUB_FUNC   0xFB0A6C5D,sceUsbCamStillInput
   STUB_FUNC   0xFDB68C23,sceUsbCamGetSharpness
   STUB_END


pspUsbCam.h
Code:

#ifndef __PSPUSBCAM_H__
#define __PSPUSBCAM_H__

#ifdef __cplusplus
extern "C" {
#endif

#define PSP_USBCAM_PID            0x282
#define PSP_USBCAM_DRIVERNAME      "USBCamDriver"
#define PSP_USBCAMMIC_DRIVERNAME   "USBCamMicDriver"

   // Unknown
   int sceUsbCamSetupStill(u32 a0);
   
   // from forums
   int sceUsbCamStillInput(void* buffer, int buffer_64k_size);
   int sceUsbCamStillWaitInputEnd(void);

#ifdef __cplusplus
}
#endif

#endif


If anyone can see anything wrong with them please let me know and save me ripping my hair out.
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Sun Jul 08, 2007 9:36 pm    Post subject: Reply with quote

Some new nids:

0x0A41A298 = sceUsbCamSetupStillEx
0xCFE9E999 = sceUsbCamSetupVideoEx

These functions are used by the camera_plugin.prx. I'm about to finish an example soon on how to use the camera to display video and take photos.
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Sun Jul 08, 2007 10:47 pm    Post subject: Reply with quote

There it is.
This sample outputs video from the camera to the screen, and saves a 1024x768 still image to /PSP/PHOTO whenever R is pressed. (i don't know why camera_plugin missed this resolution in the options).

http://www.megaupload.com/?d=3H7AL01K

I've tried to imitate what i saw in camera_plugin.prx. Anyways, that module used sceUsbCamSetupStillEx and sceUsbCamSetupVideoEx which still have a lot of parameters that i have not deduced (some of them maybe related to camera lens position?), so i prefered to use the simpler functions sceUsbCamSetupStill and sceUsbCamSetupVideo.

Note: the sample has been tested only under 3.40 OE (running in the 3.40 kernel), but i guess it should work in others OE, in devhook 2.71+ and HEN 2.71+ too.
Back to top
View user's profile Send private message
Mihawk



Joined: 03 Apr 2007
Posts: 29

PostPosted: Mon Jul 09, 2007 2:46 am    Post subject: Reply with quote

Very nice. I just bought that camera at ebay because of this :)

Thanks very much for the sample! :D
Back to top
View user's profile Send private message
werty



Joined: 09 Jul 2007
Posts: 2

PostPosted: Mon Jul 09, 2007 10:28 am    Post subject: Reply with quote

kururin nice work
ı testing goodwork
wait new proje :D you
Back to top
View user's profile Send private message
Cubane



Joined: 26 Jun 2007
Posts: 5

PostPosted: Mon Jul 09, 2007 6:55 pm    Post subject: Reply with quote

Awesome work kururin.

Add another nid to that list

0x2E930264 -> sceUsbCamSetupMicEx
Back to top
View user's profile Send private message
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Tue Jul 10, 2007 3:40 am    Post subject: Reply with quote

That's it, I want one (I guess the Go! Cam is the exact same thing?) :)

But I can't find it in the stores in Zurich... Any idea where to order one cheaply to Switzerland? Or should I just order a Chotto Cam from playasia?

Yeah slightly OT, sorry about that...
_________________
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Tue Jul 10, 2007 3:59 am    Post subject: Reply with quote

ector wrote:
That's it, I want one (I guess the Go! Cam is the exact same thing?) :)

But I can't find it in the stores in Zurich... Any idea where to order one cheaply to Switzerland? Or should I just order a Chotto Cam from playasia?

Yeah slightly OT, sorry about that...


Yeah the Go Cam is same thing. I guess it will be cheaper to get it from an european shop, since it was released in europe a couple of months ago.
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Tue Jul 10, 2007 5:46 am    Post subject: Reply with quote

Two new samples.

First one is a correction of the previous one. Video was correct, but when you took photos, the image was reversed from left to right if the camera looked to you, and reversed from up-down and left-right when looking to the other side. It seems that the sceUsbCamAutoImageReverseSW(1) only affects video, and not still images, so i had to check the lens direction manually and set the reverseflags field of the SetupStill structure properly.

Second one is an example of audio recording from the camera mic. It records wav pcm files to /PSP/MUSIC.

http://www.megaupload.com/?d=666JJNHU

Changes to the includes: added documentation of the mic functions, added the lens callback functions documentation.
Changes to the libs: added the nid sceUsbCamSetupMicEx, and added the library pspusbcam_driver for those that want to use the camera in a kernel prx.

Now, only the following functions are missing from documentation:

- sceUsbCam_1E958148: it is referenced by camera_plugin.prx, but the function that uses it is never called (there is neither jal to it, nor a pointer to it). The code sets first parameter to 0xC0000003, and the second parameter seems a pointer to an integer that receives something.

- sceUsbCam_6784E6A8, sceUsbCam_95F8901E, sceUsbCam_AA7D94BA, sceUsbCam_C72ED6D3 and sceUsbCam_D865997B. They are neither used nor referenced by camera_plugin.
Back to top
View user's profile Send private message
guyver2



Joined: 10 Jul 2007
Posts: 5

PostPosted: Tue Jul 10, 2007 6:54 am    Post subject: Reply with quote

Hi,

Very nice job !

I'm very interested in what you do, but I have an error while running your first sample.

Error 0x80243005 starting usbacc driver.

my psp is a TA-082 with a CF (3.40 OE-A)

Did I made something wrong ?

(excuse my english I'm french)

--------------------------------------------------------------
EDIT
--------------------------------------------------------------
I'm sorry, I just put your sample in the wrong directory (Game150 instead of Game340) I'm so stupid...
_________________
Psp prog
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
guyver2



Joined: 10 Jul 2007
Posts: 5

PostPosted: Tue Jul 10, 2007 8:52 am    Post subject: Reply with quote

I managed to put a mask in foreground but I just can't take pictures... :(


here is the code I modified.
http://sexy-banane.mine.nu/~vrac/depot/vrac/usbcamsample_mask.zip

you can easyli change the mask. Black part of the foreground image become invisible.


Enjoy

Edit one more mask just for fun

_________________
Psp prog


Last edited by guyver2 on Tue Jul 10, 2007 9:28 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
werty



Joined: 09 Jul 2007
Posts: 2

PostPosted: Tue Jul 10, 2007 9:19 am    Post subject: Reply with quote

Two new samples.
test good work sound nice
psp 1024*768 video rec?
wait..... :D psp go!cam MSN :D injected :D
Back to top
View user's profile Send private message
Cubane



Joined: 26 Jun 2007
Posts: 5

PostPosted: Tue Jul 10, 2007 10:12 am    Post subject: Reply with quote

kururin wrote:
Two new samples.


- sceUsbCam_1E958148: it is referenced by camera_plugin.prx, but the function that uses it is never called (there is neither jal to it, nor a pointer to it). The code sets first parameter to 0xC0000003, and the second parameter seems a pointer to an integer that receives something.



If you look at the disassembly of the usbcam.prx sceUsbCam_1E958148 gets called by all the Get/Set functions internally
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Tue Jul 10, 2007 10:39 am    Post subject: Reply with quote

Cubane wrote:
kururin wrote:
Two new samples.


- sceUsbCam_1E958148: it is referenced by camera_plugin.prx, but the function that uses it is never called (there is neither jal to it, nor a pointer to it). The code sets first parameter to 0xC0000003, and the second parameter seems a pointer to an integer that receives something.



If you look at the disassembly of the usbcam.prx sceUsbCam_1E958148 gets called by all the Get/Set functions internally


Looked to it now. It seems it follows the following pattern:

0x80000002 -> getcontrast
0x00000002 -> setcontrast
0x80000003 -> getsaturation
0x00000003 -> setsaturation
, etc

I tested that 0xc0000003 code of camera_plugin when the saturation was 125, and it returned 807 in the pointer, who knows what it means. Tested later when saturation was 11, and same, so it probably doesn't depend of saturation value.
Back to top
View user's profile Send private message
mypspdev



Joined: 11 Jul 2007
Posts: 178

PostPosted: Wed Jul 11, 2007 10:57 pm    Post subject: video and audio streaming from chottocam to voip... Reply with quote

It's a plesure to start my posting just from what I'd like to find.... Code to capture images and audio from chottocam...thanks to all contributes, clear and very well working, even if at "proof of concept" stage...

I am going deeply within Skype Public APIs in order to understand if in some way it is possible to use them for calls and video calls.
These APIs are under Windows.

May be in some way the chottocam and wifi psp power together some Voip protocol APIs will integrate a Voip System firstly for chatting, than for voicecalls, finally for video calls.

I'm not a monster of programming, better an integrator of parts.... I hope to have support and being lucky....
Back to top
View user's profile Send private message
mypspdev



Joined: 11 Jul 2007
Posts: 178

PostPosted: Fri Jul 27, 2007 5:48 am    Post subject: Reply with quote

Thanks to all! the source is well working with Cam!

Please has anyone suggestions or help to convert jpeg "buffer" image captured from Go!Cam to a bmp image?

I'd like to use the captured frame with Nanodesktop or better with OpenCV Recognition library: a bmp should work even to be internally converted to IplImage (proprietary format of OpenCV).

Any conversion source code from jpeg to bitmap?

Thanks a lot!
c
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group