Solved

Video Capture Callbacks

Posted on 1997-01-01
1
1,152 Views
Last Modified: 2012-06-27
I am working on the finishing touches of my first video capture, and C++,
program. I am using the AVICap class and want to modify the video input.

I have created a callback using the capSetCallbackOnVideoStream macro.
Everything works except I am having diffuculty accessing the actual pixel
data in the frame buffer. The buffer is passed to the callback function as
a LPVIDEOHDR structure. The lpData member of the structure contains the
address of the video buffer.

I always get confused using pointers in C. Is there a way that I can
convert the address in the lpData member to a (char huge *) type? I seen to
be converting the address of the member, and not the address stored in the
member.

Any help would be greatly appreciated! Thanks in advance.

Steve
SDB@ix.netcom.com
0
Comment
Question by:SDB
1 Comment
 

Accepted Solution

by:
jppiper earned 150 total points
ID: 1162191
Answering the specific question:

The lpData member is defined as a LPBYTE, and a LPBYTE *is* a 'char * huge' or at least a 'char * far' (defined in windef.h) which is just as good.

Answering surrounding questions:

Accessing data through pointers
-------------------------------

LPVIDEOHDR lpHdr;

lpHdr->lpData[0]   // first byte of video buffer
lpHdr->lpData[1]   // second byte of video buffer
...
lpHdr->lpData[lpHdr->dwBufferLength - 1] // last byte of video buffer

What's going on?
----------------

When you dereference your pointer to the video hdr in the callback, do the other fields seems reasonable (reasonable buffer length, time captured increases, your value in dwUser is what you expect)?

If all of this is fine, post some code and I'll see if I can spot whats happening.

Regards,
Phillip
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now