Output Pin Custom Allocator
- From: "SmartSentry" <SmartSentry@xxxxxxxxxxxxxxxxx>
- Date: Sun, 19 Feb 2006 20:50:59 GMT
Hi Guys
I'm looking for a sanity check on an idea: I'm currently using 2 inputs on
a VMR9 to mix (1) a live capture stream with (2) a dynamic bitmap to present
realtime metric information associated with the live scene. This involves
providing a dedicated output pin on a filter with a custom CMemAllocator.
The bitmap for the metric information is currently created using GDI
(CreateDibSection and CreateCompatibleDC) ...
m_hBmp = CreateDIBSection(NULL, &m_MetricBmi,DIB_RGB_COLORS, (void**)
&m_pDibBits, NULL, 0);
HDC hdc = GetDC( NULL );
m_hSrcDC = CreateCompatibleDC(hdc);
ReleaseDC( NULL, hdc );
hOld = SelectObject(m_hSrcDC,m_hBmp);
As each sample is delivered from the Metric Output pin, the metric
information is written into the DC/Bitmap, then copied into the buffer of
the MediaSample using memcpy. I'm toying with different ideas to streamline
this.
I've considered cutting out the middle man (ie memcpy step) by Deriving a
CMediaSample class which maintains a single buffer interlocked to
m_pDibBits, in other words, any call to GetPointer would return the
m_pDibBits pointer. I guess it would require some effort to manage the
sample buffer, but have the advantage of writing directly into the sample
buffer.
1. Is this in principle too dangerous?
2. Are there any easier ways to to achieve it?
Regards
Mike Gardner
SmartSentry
Skype: Mike.Gardner
.
- Follow-Ups:
- Re: Output Pin Custom Allocator
- From: Thore Karlsen [DShow MVP]
- Re: Output Pin Custom Allocator
- Prev by Date: Re: Is it just me, or is the platform SDK very incomplete on DirectShow?
- Next by Date: solution found?
- Previous by thread: Is it just me, or is the platform SDK very incomplete on DirectShow?
- Next by thread: Re: Output Pin Custom Allocator
- Index(es):
Relevant Pages
|
Loading