سؤال

I have trouble using the filewriter filter. I am not sure on how to set the outputfile. It has a interface IFileSinkFilte with a method SetFileName. The problem i have is that i don't know how to set the AM_MEDIA_TYPE structure it uses. It looks as following:

typedef struct _MediaType {
  GUID     majortype;
  GUID     subtype;
  BOOL     bFixedSizeSamples;
  BOOL     bTemporalCompression;
  ULONG    lSampleSize;
  GUID     formattype;
  IUnknown *pUnk;
  ULONG    cbFormat;
  BYTE     *pbFormat;
} AM_MEDIA_TYPE;

How do I know the sample size?

What is a format bloock?

How do i get its length?

هل كانت مفيدة؟

المحلول

You don't need to set the MediaType, just set it NULL.

Or you can set a partial MediaType. So '0' everything and then set only majortype and subtype. (e.g. MEDIATYPE_Stream and MEDIASUBTYPE_NULL)

نصائح أخرى

  1. Use GraphEdit from Windows SDK, or similar tool like GraphStudioNext
  2. Build file capturing topologies interactively to get idea of File Writer use scenarios, see Capturing Video to an AVI File for explanations
  3. Review media types in graphs from item 2 above and then build similar graphs programmatically
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top