Click here to Skip to main content
14,391,319 members

C / C++ / MFC

 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin23-Jul-15 15:57
professionalAlbert Holguin23-Jul-15 15:57 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 20:28
MemberAbdullah A._Mohamed23-Jul-15 20:28 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin24-Jul-15 5:11
professionalAlbert Holguin24-Jul-15 5:11 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 21:47
mveCPallini23-Jul-15 21:47 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin24-Jul-15 5:10
professionalAlbert Holguin24-Jul-15 5:10 
QuestionC or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A. Mohamed22-Jul-15 20:28
MemberAbdullah A. Mohamed22-Jul-15 20:28 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Jeremy Falcon27-Jul-15 6:11
professionalJeremy Falcon27-Jul-15 6:11 
QuestionReading uncompressed AVI file frame by frame into raw memory buffer? Pin
Kiran Satish22-Jul-15 20:08
MemberKiran Satish22-Jul-15 20: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-
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 22:38
professionalDaniel Pfeffer22-Jul-15 22:38 
GeneralRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Kiran Satish23-Jul-15 7:12
MemberKiran Satish23-Jul-15 7:12 
GeneralRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Daniel Pfeffer23-Jul-15 7:41
professionalDaniel Pfeffer23-Jul-15 7:41 
GeneralRe: Reading uncompressed AVI file frame by frame into raw memory buffer? Pin
Kiran Satish23-Jul-15 15:42
MemberKiran Satish23-Jul-15 15:42 
AnswerAssigning data to int array using pointers Pin
Vaclav_22-Jul-15 15:13
MemberVaclav_22-Jul-15 15:13 
GeneralRe: Assigning data to int array using pointers Pin
Richard Andrew x6422-Jul-15 16:30
professionalRichard Andrew x6422-Jul-15 16:30 
GeneralRe: Assigning data to int array using pointers Pin
Vaclav_23-Jul-15 4:45
MemberVaclav_23-Jul-15 4:45 
GeneralRe: Assigning data to int array using pointers Pin
Richard MacCutchan22-Jul-15 22:33
mveRichard MacCutchan22-Jul-15 22:33 
GeneralRe: Assigning data to int array using pointers Pin
Vaclav_23-Jul-15 5:38
MemberVaclav_23-Jul-15 5:38 
GeneralRe: Assigning data to int array using pointers Pin
Richard Andrew x6423-Jul-15 6:17
professionalRichard Andrew x6423-Jul-15 6:17 
GeneralRe: Assigning data to int array using pointers Pin
Vaclav_23-Jul-15 7:37
MemberVaclav_23-Jul-15 7:37 
GeneralRe: Assigning data to int array using pointers Pin
Arthur V. Ratz13-Aug-15 20:41
mvaArthur V. Ratz13-Aug-15 20:41 
Questionhow to use d following sha1 zip file Pin
Member 1185569722-Jul-15 8:07
MemberMember 1185569722-Jul-15 8:07 
AnswerRe: how to use d following sha1 zip file Pin
jeron122-Jul-15 8:58
Memberjeron122-Jul-15 8:58 
Question[SOLVED] VC++ 2013 Ultimate IDE is very slow Pin
AmbiguousName22-Jul-15 2:12
MemberAmbiguousName22-Jul-15 2:12 
AnswerRe: VC++ 2013 Ultimate IDE is very slow Pin
CPallini22-Jul-15 2:40
mveCPallini22-Jul-15 2:40 
AnswerRe: VC++ 2013 Ultimate IDE is very slow Pin
Richard MacCutchan22-Jul-15 3:01
mveRichard MacCutchan22-Jul-15 3: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.