Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Video Capture Callbacks

Posted on 1997-01-01
1
Medium Priority
?
1,169 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 300 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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.

730 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