Solved

Video Capture Callbacks

Posted on 1997-01-01
1
1,167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

  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 …
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 viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.
Suggested Courses

622 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