curl-library
Re: bitmap buffer (c++)
Date: 13 Nov 2008 14:34:40 -0000
Many thanx for your answers.
My application take this buffer from an axis IP camera and then put it in an IplImage, Opencv image format.
here it's the code to do it:
....
....
error=curl_easy_perform(curl_handle);
if (error!=CURLE_OK){
printf("\nProblemi di connessione con la telecamera.\n");
curl_easy_cleanup(curl_handle);
flag=true;
}
else{
if (flag){
printf("Connesso.\n");
flag=false;
}
char* buffer=(char*) chunk.memory;
buffer += sizeof(BITMAPINFOHEADER);
IplImage* temp=cvCreateImage( cvSize(larghezzavideo,altezzavideo), IPL_DEPTH_8U, 3);
memcpy(temp->imageData,buffer,temp->imageSize);<----HERE THERE IS A CRASH
curl_easy_cleanup(curl_handle);
if(chunk.memory){
free(chunk.memory);
}
....
.....
As you can see the crash arrives when the memcpy tryes to copy data in the iplimage.
The stream is always a bad quality one, with a low frame rate.
When i run one of this application it works fine.
When i run two applications one crashes sometimes.
When i run three applications one crashes often.
No way to make 4 of them run....
I think it's a problem of the buffer.
do you agree??
I'm using curl 7.19.0 on Windows XP.
Thank you for your help
best Regards
manu
----------------------------------------------------------------------------
Vuoi essere presente online?
Vuoi dare voce alla tua attivita`?
Acquista un dominio su domini.interfree.it.
A partire da 18,59 euro
----------------------------------------------------------------------------
Received on 2008-11-13