Note that there are some explanatory texts on larger screens.

plurals
  1. POCanon sdk internal error at edsDownload
    primarykey
    data
    text
    <p>I have internal error at the EdsDownload. I'am using EOS 1100D without sdcard. The Canon sample code (CameraContorol) can download image. Used SDK: 2.13 and 2.12 (i have same problem with both). Please help me.<br> Note: the "picture000x.jpg" size is 0 after the run (because the EdsCreateFileStream call).</p> <p><b>My code output</b>:<br> Device name: Canon EOS 1100D.<br> GET PICTURE:<br> 'Call' handleObjectEvent.<br> Event: kEdsStateEvent_JobStatusChanged,<br> Event code: 770<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Internal error at EdsDownload.<br> stream != NULL<br> Download h.ended.<br> Press key to quit.<br></p> <p><b>My code</b>:</p> <pre><code>bool getPictureEnabled = false, hasCamera = false; EdsCameraRef camera; EdsImageRef picture; volatile EdsUInt32 bufferSize; EdsError DownloadImage(EdsDirectoryItemRef directoryItem); </code></pre> <p>handleSateEvent:<br></p> <pre><code>EdsError EDSCALLBACK handleSateEvent(EdsStateEvent event, EdsUInt32 parameter, EdsVoid * context) { switch(event) { case kEdsStateEvent_CaptureError: printf("Event: kEdsStateEvent_CaptureError,\n"); throw "Camera capture error."; case kEdsStateEvent_JobStatusChanged: printf("Event: kEdsStateEvent_JobStatusChanged,\n"); break; default: break; } printf("Event code: %d.\n", (int)event); return EDS_ERR_OK; } </code></pre> <p>handleObjectEvent:</p> <pre><code>EdsError EDSCALLBACK handleObjectEvent(EdsObjectEvent event, EdsBaseRef object, EdsVoid * context) { if(event == kEdsObjectEvent_DirItemCreated || event == kEdsObjectEvent_DirItemRequestTransfer || event == kEdsObjectEvent_DirItemRequestTransferDT) { if(!getPictureEnabled) { printf("object event handler: FALSE alert\n"); if(object) EdsRelease(object); return EDS_ERR_OK; } //EdsRetain(object); DownloadImage(object); } if(object) EdsRelease(object); return EDS_ERR_OK; } </code></pre> <p>main function:</p> <pre><code>int main(int parC, char *pars[]) { int processCounter = 0; EdsCameraListRef eclr; EdsError edsError = EdsInitializeSDK(); if(edsError) { printf("I can't initialize the Eds sdk.\n"); goto stop; } processCounter = 1; edsError = EdsGetCameraList(&amp;eclr); if(edsError) { printf("I can't get the camera list.\n"); goto stop; } processCounter = 2; EdsUInt32 camCount; edsError = EdsGetChildCount(eclr, &amp;camCount); if(edsError) { printf("I can't read the camera count.\n"); goto stop; } hasCamera = camCount &gt; 0; if(!hasCamera) { printf("There is no camera in the list.\n"); goto stop; } edsError = EdsGetChildAtIndex(eclr, 0, &amp;camera); if(edsError) { printf("I can't get the camera.\n"); goto stop; } edsError = EdsSetCameraStateEventHandler(camera, kEdsStateEvent_All, handleSateEvent, NULL); if(edsError) printf("Error at EdsSetCameraStateEventHandler.\n"); edsError = EdsSetObjectEventHandler(camera, kEdsObjectEvent_All, handleObjectEvent, NULL); if(edsError) { printf("Error at EdsSetObjectEventHandler.\n"); goto stop; } edsError = EdsOpenSession(camera); if(edsError) { printf("I can't open the session.\n"); goto stop; } processCounter = 3; EdsDeviceInfo outDeviceInfo; edsError = EdsGetDeviceInfo(camera, &amp;outDeviceInfo); if(edsError) printf("I can't get device info.\n"); else printf("Device name: %s.\n", (char *) outDeviceInfo.szDeviceDescription); EdsUInt32 saveTo = kEdsSaveTo_Host; edsError = EdsSetPropertyData(camera, kEdsPropID_SaveTo, 0, sizeof(EdsUInt32) , &amp;saveTo); if(edsError != EDS_ERR_OK) printf("Error at EdsSetPropertyData -&gt; kEdsSaveTo.\n"); EdsCapacity capacity = {0x7FFFFFFF, 0x1000, 1}; edsError = EdsSetCapacity(camera, capacity); if(edsError != EDS_ERR_OK) printf("Error at EdsSetPropertyData -&gt; kEdsSaveTo.\n"); printf("GET PICTURE:\n"); getPictureEnabled = true; edsError = EdsSendCommand(camera, kEdsCameraCommand_TakePicture , 0); if(edsError) printf("ERROR: Take picture.\n"); else { //handleObjectEvent "call": printf("'Call' handleObjectEvent.\n"); edsError = EdsCloseSession(camera); if(edsError) printf("I can't close the session 1.\n"); edsError = EdsOpenSession(camera); if(edsError) printf("I can't open the session 2.\n"); } stop: printf("Press key to quit...\n"); getchar(); switch (processCounter) { case 3: edsError = EdsCloseSession(camera); if(edsError) printf("I can't close the session 2.\n"); case 2: edsError = EdsRelease(eclr); if(edsError) printf("I can't release eds cam. list.\n"); case 1: EdsTerminateSDK(); default: break; } return 0; } </code></pre> <p>DownloadImage function:</p> <pre><code>EdsError DownloadImage(EdsDirectoryItemRef directoryItem) { CoInitializeEx(NULL, COINIT_APARTMENTTHREADED ); //i tried without this, and don't screen change EdsError err; EdsStreamRef stream = NULL; EdsDirectoryItemInfo dirItemInfo; err = EdsGetDirectoryItemInfo(directoryItem, &amp;dirItemInfo); if(err == EDS_ERR_OK) { err = EdsCreateFileStream(dirItemInfo.szFileName, kEdsFileCreateDisposition_CreateAlways, kEdsAccess_ReadWrite, &amp;stream); if(err != EDS_ERR_OK) printf("ERROR: EdsCreateFileStream.\n"); bufferSize = dirItemInfo.size; //EdsSetProgressCallback(stream, ProgressFunc, kEdsProgressOption_Periodically, NULL); } else printf("ERROR 1\n"); //err = EdsSendStatusCommand(camera, kEdsCameraStatusCommand_UILock, 0); //i tried with this, and don't screen change //err = EdsSendStatusCommand(camera, kEdsCameraStatusCommand_EnterDirectTransfer, 0); //i tried with this, and don't screen change if(err) { printf("ERROR: transfer lock.\n"); }//*/ //if(err == EDS_ERR_OK) //do //{ err = EdsDownload(directoryItem, dirItemInfo.size, stream); //HERE IS THE PROBLEM: EDS_ERR_INTERNAL_ERROR! (after that row: err = 2) //} //while(err != EDS_ERR_OK);//*/ if(err == EDS_ERR_INTERNAL_ERROR) printf("\n\t\tInternal error at EdsDownload.\n"); //if(err == EDS_ERR_OK) { err = EdsDownloadComplete(directoryItem); } // Release stream if( stream != NULL) { EdsCreateImageRef(stream, &amp;picture); EdsRelease(stream); stream = NULL; printf(" stream != NULL\n"); } //err = EdsSendStatusCommand(camera, kEdsCameraStatusCommand_ExitDirectTransfer, 0); //i tried with this, and don't screen change //err = EdsSendStatusCommand(camera, kEdsCameraStatusCommand_UIUnLock, 0); //i tried with this, and don't screen change if(err) { printf("ERROR: transfer lock.\n"); return NULL; }//*/ printf("Download ended.\n"); CoUninitialize(); //i tried without this, and don't screen change return err; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload