Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Format for bitmap Samples for image streams

3 views
Skip to first unread message

anuj

unread,
Nov 2, 2009, 2:09:18 AM11/2/09
to
i am trying to write a bunch of raw bitmaps into a wmv file. I seem to
have configured the profile etc... correctly picking CreateImageStream
form gen_profilelib sample. But when i try to add the sample it
returns NS_E_INVALID_DATA.

DWORD effectiveSize = size + sizeof(WMT_VIDEOIMAGE_SAMPLE2);
BYTE * dst = this->AllocateBuffer(effectiveSize);

WMT_VIDEOIMAGE_SAMPLE2 sample = {0};
sample.dwMagic = WMT_VIDEOIMAGE_MAGIC_NUMBER_2;
sample.dwStructSize = sizeof(WMT_VIDEOIMAGE_SAMPLE2);
sample.dwControlFlags =
WMT_VIDEOIMAGE_SAMPLE_INPUT_FRAME ;


err = memcpy_s(dst, dstSize, &sample, sizeof
(WMT_VIDEOIMAGE_SAMPLE2));
err = memcpy_s(dst + sizeof(WMT_VIDEOIMAGE_SAMPLE2), size,
srcBuffer, size);

hr = this->sampleBuffer->SetLength(effectiveSize);

hr = m_pWriter->WriteSample( wStreamNum, cnsSampleTime, dwFlags,
this->sampleBuffer);


srcBuffer is the raw bits of the bitmaps with 3 bytes per pixel.
is the WMT_VIDEOIMAGE_SAMPLE2 structure set correctly?
Do we need to append some kind of bitmap header to the raw data ?

0 new messages