Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9155341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:34:34+00:00 2026-06-17T12:34:34+00:00

I am able to copy a VideoInfoHeader which is part AMMediaType with the following

  • 0

I am able to copy a VideoInfoHeader which is part AMMediaType with the following lines:

AMMediaType mediaType = new AMMediaType();
VideoInfoHeader videoInfo = new VideoInfoHeader();
(pSampleGrabber as ISampleGrabber).GetConnectedMediaType(mediaType);
videoInfo = (VideoInfoHeader)Marshal.PtrToStructure(mediaType.formatPtr, typeof(VideoInfoHeader));

that I got from SampleGrabber Parameter is Incorrect and other ressources on the internet. However I am not able to copy the whole AMMediaType-Structure. The pointer to the VideoInfoHeader is lost.

So I was wondering if there exists a helper function that
copies an AMMediaType to a different location in memory, looks for pointers like VideoInfoHeader and copies the content of the VideoInfoHeader and other referenced data to a new location (including pointing formatPtr to the right location).

I am using this in the following scenario:
I retrieve all possible IPin mediatypes of a video input device and show the AMMediaTypes in a Windows.Forms – Combobox. When I read the SelectedObject from the Combobox, the pointer to the VideoInfoHeader is zero. This is where it fails to connect using my selected pin configuration when constructing the filtergraph.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:34:34+00:00Added an answer on June 17, 2026 at 12:34 pm

    The AMMediaType aka AM_MEDIA_TYPE structure consists of regular members and additionally allocated piece of memory pointed to by formatPtr. The latter is a byte array with a meaning dependent on format type. Both structure and slave memory block are typically using specific COM allocator.

    Duplicating the structure is copying its members and duplicating the byte array behind formatPtr. The structure also includes pUnk member supposed to be COM interface, however it is typically null. It is valid for it to be non-null, but I cannot remember a single case over years when it was actually used, in particular with video and audio media types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whenever I try the following in my python interpreter. I am able to copy
I'm able to copy the following .htm file to my sony ericsson C510 and
I am able to copy a file in node.js using the following: var readStream
I need to be able to copy the current webpage into a new popup
I have the following code, I want a user to be able to copy
I need to be able to copy a file that exists on the target
Thanks in advance for your help experts. I want to be able to copy
I'm trying to compress any given string to a shorter version, copy paste-able compressed
I want to be able to click the button and have it copy this:
In asp.net, I am able to login using forms authentication as usual, copy our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.