Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin23-Jul-15 14:57
professionalAlbert Holguin23-Jul-15 14:57 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 19:28
Abdullah A._Mohamed23-Jul-15 19:28 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin24-Jul-15 4:11
professionalAlbert Holguin24-Jul-15 4:11 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 20:47
mveCPallini23-Jul-15 20:47 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin24-Jul-15 4:10
professionalAlbert Holguin24-Jul-15 4:10 
QuestionC or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A. Mohamed22-Jul-15 19:28
Abdullah A. Mohamed22-Jul-15 19:28 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Jeremy Falcon27-Jul-15 5:11
professionalJeremy Falcon27-Jul-15 5:11 
QuestionReading uncompressed AVI file frame by frame into raw memory buffer? Pin
Kiran Satish22-Jul-15 19:08
Kiran Satish22-Jul-15 19:08 
As the title states, I am having problems reading uncompressed avi files in MFC. It works fine on some files and reads different data on some avi files.

Here is the code-
C++
pStream = g_GetAviStream(_T("D:\\Lab_Programs\\Matlab\\output.avi"), &frames, &fWidth, &fHeight, &iFirstFrame, &nPlanes, &fBufSize);
fWidthOffs = fWidth%4;
tempBuff = new BYTE[fWidth*fHeight*nPlanes];
ZeroMemory(tempBuff, sizeof(BYTE)*fWidth*fHeight*nPlanes);

pFrame = AVIStreamGetFrameOpen(pStream, NULL);

bytBuff   = new BYTE[fBufSize];//fWidth*fHeight*nPlanes];

// read video stream to video buffer
for (i = 0; i < frames; i ++)
{
	// the returned is a packed DIB frame
	imgTemp = (BYTE*) AVIStreamGetFrame(pFrame, i);

	RtlMoveMemory(&bih.biSize, imgTemp, sizeof(BITMAPINFOHEADER));

	//now get the bitmap bits and get rid of the header information and retrieve the real image 
	RtlMoveMemory(bytBuff, imgTemp+sizeof(BITMAPINFOHEADER)+sizeof(RGBQUAD)*256, bih.biSizeImage);
	ind = i*fWidth*fHeight*nPlanes;
	for (j = 0; j < fHeight; j ++) {	
		idxd1 = j*nStimVideoNX;
		idxs = (fHeight-1-j) * (fWidth * nPlanes + fWidthOffs);
		for (k = 0; k < fWidth/*nStimVideoNX*/; k ++) {
	datain = bytBuff[idxs + k*nPlanes];
	tempBuff[idxd1+k] = datain;
							
		}
	}
}


After doing this, I am writing tempBuff to a text file to view the contents in maltab and imshow it. If you play the video, you will see two black squares inside the frame, but when I check the text file for frame 3, I only see one black square. Here is the link[^] for a sample file that I am trying to read.
PKNT

AnswerRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Daniel Pfeffer22-Jul-15 21:38
professionalDaniel Pfeffer22-Jul-15 21:38 
GeneralRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Kiran Satish23-Jul-15 6:12
Kiran Satish23-Jul-15 6:12 
GeneralRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Daniel Pfeffer23-Jul-15 6:41
professionalDaniel Pfeffer23-Jul-15 6:41 
GeneralRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Kiran Satish23-Jul-15 14:42
Kiran Satish23-Jul-15 14:42 
AnswerAssigning data to int array using pointers Pin
Vaclav_22-Jul-15 14:13
Vaclav_22-Jul-15 14:13 
GeneralRe: Assigning data to int array using pointers Pin
Richard Andrew x6422-Jul-15 15:30
professionalRichard Andrew x6422-Jul-15 15:30 
GeneralRe: Assigning data to int array using pointers Pin
Vaclav_23-Jul-15 3:45
Vaclav_23-Jul-15 3:45 
GeneralRe: Assigning data to int array using pointers Pin
Richard MacCutchan22-Jul-15 21:33
mveRichard MacCutchan22-Jul-15 21:33 
GeneralRe: Assigning data to int array using pointers Pin
Vaclav_23-Jul-15 4:38
Vaclav_23-Jul-15 4:38 
GeneralRe: Assigning data to int array using pointers Pin
Richard Andrew x6423-Jul-15 5:17
professionalRichard Andrew x6423-Jul-15 5:17 
GeneralRe: Assigning data to int array using pointers Pin
Vaclav_23-Jul-15 6:37
Vaclav_23-Jul-15 6:37 
GeneralRe: Assigning data to int array using pointers Pin
Arthur V. Ratz13-Aug-15 19:41
professionalArthur V. Ratz13-Aug-15 19:41 
Questionhow to use d following sha1 zip file Pin
Member 1185569722-Jul-15 7:07
Member 1185569722-Jul-15 7:07 
AnswerRe: how to use d following sha1 zip file Pin
jeron122-Jul-15 7:58
jeron122-Jul-15 7:58 
Question[SOLVED] VC++ 2013 Ultimate IDE is very slow Pin
AmbiguousName22-Jul-15 1:12
AmbiguousName22-Jul-15 1:12 
AnswerRe: VC++ 2013 Ultimate IDE is very slow Pin
CPallini22-Jul-15 1:40
mveCPallini22-Jul-15 1:40 
AnswerRe: VC++ 2013 Ultimate IDE is very slow Pin
Richard MacCutchan22-Jul-15 2:01
mveRichard MacCutchan22-Jul-15 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.