Solved

Video Capture Callbacks

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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

770 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