Solved

Video Capture Callbacks

Posted on 1997-01-01
1
1,137 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

744 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

12 Experts available now in Live!

Get 1:1 Help Now