> Thanks for your reply.
> Here is you asked for.
>
> // What is the size of the WM_MEDIA_TYPE structure ?
> hr = mediaProps->GetMediaType(NULL, &cbMediaType);
>
> WM_MEDIA_TYPE* mediaType = (WM_MEDIA_TYPE*) new BYTE[cbMediaType];
>
> // We obtain the actual media type.
> hr = mediaProps->GetMediaType(mediaType, &cbMediaType);
>
> WMVIDEOINFOHEADER *dataVideo = (WMVIDEOINFOHEADER*)(mediaType->pbFormat);
>
> unsigned int Width = GetSystemMetrics(SM_CXSCREEN);
> unsigned int Height = GetSystemMetrics(SM_CYSCREEN);
> unsigned int Fps = 3
> unsigned int BitCount = 8
>
> WMVIDEOINFOHEADER {
>
> BITMAPINFOHEADER bmiHeader {
>
> DWORD biSize = sizeof(BITMAPINFOHEADER)
> LONG biWidth = Width
> LONG biHeight = Height
> WORD biPlanes = 1
> WORD biBitCount = BitCount
> DWORD biCompression = mmioFOURCC('E', 'Y', 'E', 'Z')
> DWORD biSizeImage = Width * Height
> LONG biXPelsPerMeter = 0
> LONG biYPelsPerMeter = 0
> DWORD biClrUsed = 0
> DWORD biClrImportant = 0
> }
>
> RECT rcSource = {0, 0, dataVideo->bmiHeader.biWidth,
> dataVideo->bmiHeader.biHeight};
> RECT rcTarget = {0, 0, dataVideo->bmiHeader.biWidth,
> dataVideo->bmiHeader.biHeight};
> DWORD dwBitRate = 1 // I use VBR.
> DWORD dwBitErrorRate = 0
> LONGLONG AvgTimePerFrame = ((QWORD)1) * 10000 * 1000 / Fps;
>
> }
>
> // We clear the WM_MEDIA_TYPE structure.
> memset(mediaType, 0, sizeof(WM_MEDIA_TYPE));
>
> // We build our GUID variable.
> GUID myguid;
>
> myguid = WMMEDIASUBTYPE_Base;
> myguid.Data1 = (DWORD)mmioFOURCC('E','Y','E','Z');
>
> mediaType->majortype = WMMEDIATYPE_Video;
> mediaType->subtype = myguid;
> mediaType->formattype = WMFORMAT_VideoInfo;
>
> mediaType->pbFormat = (BYTE*)dataVideo;
> mediaType->cbFormat = sizeof(WMVIDEOINFOHEADER);
>
>
>
>
>
> "Alessandro Angeli" wrote:
>
> > From: "Damiox"
> >
> > > If I change from 8bpp to 16bpp, this behaviour
> > > disappears (I meant, there is no an "Extra Data Size"
> > > field). I think that this 1024 extra bytes are related to
> > > the palette, but why do I have to add information of a
> > > palette? I don't know what palette it will be used :/,
> > > this information changes for each image that I create and
> > > that I introduce into the ASF files.
> > >
> > > So, where do I need to reserve these bytes? and what is
> > > the reason to do that?
> >
> > That depends on what you specifying in the BITMAPINFOHEADER.
> > Are you storing pre-compressed data? What are the exact
> > contents of the input and profile WM_MEDIA_TYPE's, including
> > the pbFormat block?
> >
> >
> >
> > --
> > // Alessandro Angeli
> > // MVP :: DirectShow / MediaFoundation
> > // mvpnews at riseoftheants dot com
> > //
http://www.riseoftheants.com/mmx/faq.htm > >
> >
> >