Re2: How to format a IMediaSample?

Maarten Lankhorst m.b.lankhorst at gmail.com
Wed Apr 13 16:05:41 CDT 2005


Robert Shearman wrote:

> Maarten Lankhorst wrote:
>
>> I'm having troubles sending a media sample over the graph,
>> I'm wondering wether that is because of the receiving filter or my 
>> own fault.
>>
>> the thing I'm trying to send is a uncompressed 24 bit image, the 
>> bitmap info header data of it is pretty much as this:
>>
>> mediatype: BI_RGB24
>> Width: 320
>> Height: 240
>> Bitcount: 24
>> Size of the image in bytes: 230400
>> compression: BI_RGB
>>
>> so my questions about it are:
>> - What should I do with the ALLOCATOR_PROPERTIES
>
>
>
> props.cbAlign - do you have any alignment requirements? if not, set to 1.
> props.cbPrefix - do you have any private data you want to include 
> before the sample? if not, set to 0.
> props.cbBuffer - maximum size of the buffer (recommended is 0x20000 or 
> 64kb)
> props.cBuffers - how many samples will you be processing at once?

I allocated 4 buffers of 64kB now to hold the sample, it's probably more 
friendly then 1 buffer of 230kB

>
>> - What do I have to put in IMediaSample SetActualDataLength
>
>
>
> The value corresponding to "Size of the image in bytes."
>
Had that, turned out it wasn't the reason I got an invalid error

>> - How can I fill the pointer returned by IMediaSample GetPointer so 
>> that the sample gets accepted?
>
>
> The media sample contains no format information so it shouldn't be 
> rejected. Just memcpy the bytes.
>
> Rob
>
I tried using the graph edit tool from Graph Edit, connected my 
outputpin to videorenderer's input pin I got this:
trace:quartz:VideoRenderer_SendSampleData 0x77ca8108 0x7cfd0000 131072
trace:quartz:IPinImpl_ConnectionMediaType 
(0x77ca8268/0x77ca8268)->(0x77a9f8f8)
trace:quartz:VideoRenderer_SendSampleData biSize = 298763094
trace:quartz:VideoRenderer_SendSampleData biWidth = -1442840129
trace:quartz:VideoRenderer_SendSampleData biHeigth = 1515803904
trace:quartz:VideoRenderer_SendSampleData biPlanes = 64268
trace:quartz:VideoRenderer_SendSampleData biBitCount = 30633
trace:quartz:VideoRenderer_SendSampleData biCompression = "X\x00\x00\x00"...
trace:quartz:VideoRenderer_SendSampleData biSizeImage = 2009760832

Somehow my media format got messed up, I'll look at the source, figure 
out what I did wrong then return working on this happily, I bet it's the 
same reason msn returned E_FAIL :)

*Takes another deep look into his probably messed up code, does this 
mean I have to rewrite it earlier then I thought? O_O*



More information about the wine-devel mailing list