Some issues with LiveView

EDSDK 2.7 content

Some issues with LiveView

Postby der_pedda » Mon Feb 08, 2010 3:32 pm



Hello everyone,

I am trying to integrate a LiveView-feature in one of my application but I am having a little trouble.

First of all, I would like to just save the current live view picture on user request. I am using the following code:

Code: Select all
   
EdsError err = EDS_ERR_OK;
EdsStreamRef stream = NULL;
EdsEvfImageRef evfImage = NULL;

err = EdsCreateMemoryStream( 0, &stream);
printf("CanonCamera\t: Creating LiveView-Memorystream %d\n",err);

if(err == EDS_ERR_OK) {
   err = EdsCreateEvfImageRef(stream, &evfImage);
}

printf("CanonCamera\t: Creating LiveView-ImageRef %d\n",err);
if(err == EDS_ERR_OK) {
   err = EdsDownloadEvfImage(camera, evfImage);
}
printf("CanonCamera\t: Downloading LiveView-Image %d\n",err);
   
EdsStreamRef jpgStream;
err = EdsCreateFileStream( "liveview.jpg",kEdsFileCreateDisposition_CreateAlways,   kEdsAccess_ReadWrite, &jpgStream);

printf("CanonCamera\t: Creating LiveView Filestream %d\n",err);

EdsSaveImageSetting save;
save.JPEGQuality = 10;

err = EdsSaveImage(evfImage, kEdsTargetImageType_Jpeg, save, jpgStream);
printf("CanonCamera\t: Saving LiveView-Image %d\n",err);


Until I call EdsSaveImage, everything works fine, but then I get "EDS_ERR_INVALID_HANDLE" and I am not sure what I am doing wrong. I read the other threads about handling the image, but couldn't find an answer ...

Another thing that doesn't work is turning live off. I basically used Sample 10 from the manual and have the following code for turning LiveView off:
Code: Select all
EdsUInt32 device;
err = EdsGetPropertyData(camera, kEdsPropID_Evf_OutputDevice,0, sizeof(device), &device );

if(err == EDS_ERR_OK) {
   device = kEdsEvfOutputDevice_TFT;
   err = EdsSetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , sizeof(device), &device);
}
printf("CanonCamera\t: Trying to end LiveView-Mode %d\n",err);


I do not receive any error code, but the camera only exits LiveView when I turn it off ...

I am also interested in how I can set the LiveView paramters like ISO-value (using Mark 5D II) which was announced with some firmware update. Do I just use the same command as for taking regular pictures?

Thanks in advance, Peter


der_pedda
 
Posts: 13
Joined: Thu May 28, 2009 9:20 am

Re: Some issues with LiveView

Postby pick » Mon Feb 08, 2010 4:56 pm

der_pedda wrote:Until I call EdsSaveImage, everything works fine, but then I get "EDS_ERR_INVALID_HANDLE" and I am not sure what I am doing wrong. I read the other threads about handling the image, but couldn't find an answer ...

I tried to do the same thing. EdsSaveImage requires a type of EdsImageRef, whereas you're passing it a type of EdsEvfImageRef. Since the live-view image (as contained in the 'stream') is just a normal JPEG, I ended up just writing all the code to directly save it from the stream...

der_pedda wrote:Another thing that doesn't work is turning live off. I basically used Sample 10 from the manual and have the following code for turning LiveView off:

Don't ask me why, but I turn off liveview by passing '0' as the output device. Eg:
Code: Select all
device = 0;
err = EdsSetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , sizeof(device), &device);   

It seems to work....
der_pedda wrote:I am also interested in how I can set the LiveView paramters like ISO-value (using Mark 5D II) which was announced with some firmware update. Do I just use the same command as for taking regular pictures?

No idea....never looked into it. I don't know if liveview's exposure is designed to be controlled manually since it's supposed to just be an aid for taking a shot. Movies, on the other hand, can be...
pick
Canon SDK Expert
 
Posts: 61
Joined: Mon Jan 19, 2009 6:45 pm


Return to Canon EDSDK 2.7

Who is online

Users browsing this forum: No registered users and 1 guest

cron