Play video from Memory Stream
|
11-28-2014, 10:03 PM
Post: #7
|
|||
|
|||
RE: Play video from Memory Stream
Thanks, been involved trying other options and so far no joy.. I'll play with this over the next week or so and see if I can come up with anything.
Just to wrap this up, I ended up not using Video Lab at all. For anyone else that may be looking for Live View with the Cannon ESDK with C++ Builder here is the code I ended up with. This is only the function that gets and displays the image, most everything else needed is outlined in the SDK docs. Have to thank Remy Lebeau for his help on the Builder Developers Journal form heading me in the proper direction. //--------------------------------------------------------------------------- void TCameraCtrl::DownloadLiveView(void) { EdsError err = EDS_ERR_OK; EdsEvfImageRef image = NULL; EdsStreamRef stream = NULL; unsigned char *data = NULL; unsigned long size = 0; int Trys; err = EdsCreateMemoryStream(0, &stream); while(IsLiveViewOn) { Application->ProcessMessages(); err = EdsCreateEvfImageRef(stream, &image); if(err == EDS_ERR_OK){ // Download the liveview data for(Trys = 10; Trys > 0; Trys--){ err = EdsDownloadEvfImage (EosCamera, image); if(err == EDS_ERR_OBJECT_NOTREADY) Sleep(250); else break; } } err = EdsGetPointer(stream, (EdsVoid**)&data); err = EdsGetLength(stream, &size); if(err == EDS_ERR_OK){ if(image != NULL) EdsRelease(image); TMemoryStream* ImageStream = new TMemoryStream; TJPEGImage *jpg = new TJPEGImage(); ImageStream->WriteBuffer(data, size); ImageStream->Position = 0; jpg->LoadFromStream(ImageStream); Image1->Picture->Assign(jpg); delete ImageStream; delete jpg; } } if (stream != NULL) { EdsRelease(stream); stream = NULL; } if (image != NULL) { EdsRelease(image); image = NULL; } data = NULL; EndLiveView(); } //--------------------------------------------------------------------------- |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Play video from Memory Stream - BReeves - 11-18-2014, 12:32 AM
RE: Play video from Memory Stream - Dave - 11-18-2014, 10:31 AM
RE: Play video from Memory Stream - BReeves - 11-18-2014, 08:32 PM
RE: Play video from Memory Stream - Dave - 11-18-2014, 09:33 PM
RE: Play video from Memory Stream - BReeves - 11-19-2014, 10:18 PM
RE: Play video from Memory Stream - Dave - 11-20-2014, 01:00 AM
RE: Play video from Memory Stream - BReeves - 11-28-2014 10:03 PM
|
User(s) browsing this thread: 2 Guest(s)