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
