Article View: borland.public.cppbuilder.nativeapi
Article #1984Re: Multi-Thread HDC and Video Display
From: Robert G. Hoover
Date: Thu, 24 May 2007 17:29
Date: Thu, 24 May 2007 17:29
57 lines
2785 bytes
2785 bytes
Hi all, My problems with these new DualCore machines continue... can I get a little more clarification on these functions? DrawDibDraw(HDRAWDIB hDD, HDC hDC, int left, int top...); SetDIBitsToDevice(HDC hDC, int left, int top...) StretchDIBitsToDevice(HDC hDC, int left, int top, int width, int height...) Which of these are thread safe? DrawDibDraw only? Does DrawDibDraw write "directly" to video memory rather than regular memory? Is there a difference on these modern PCs? If StretchDIBitsToDevice is not thread-safe, is there an equivalent? Which would be best used for video streaming? Are there other options? Please forgive my ignorance. I've been writing video streaming apps for nearly 15 years. Apparently, I've been writing them wrong. ;) Much appreciative, Rob Joe C. Hecht wrote: >> SendDIBitsToDevice(ShellForm->Handle)? I use GetDC to get the DC of the window > > Not trying to veer off track, but simply trying to provide a little advice. > > If you mean SetDiBitsToDevice(), I would really recommend using StretchDIBits(). > > I say this as a guy who writes Windows graphic drivers, and can testify that: > > 1) Of the calls in a driver that work with DIBs, most (internally) are stubbed out to > eventually call a single output function in the driver (usually modeled for StretchDIBits()), > so if speed is an issue, this is usually the fastest call. > > 2) The internals for the call that comes though when you call SetDiBitsToDevice() > is so complex and so lacking in documentation, that some drivers get it wrong, > so there is a possibility for a lot of "flaky code". The support code is a nighmare. > > Of course, the above only applies to monolithic graphic drivers. > > Joe
Technical Details
Message-ID:
<4655cb92@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45f57403@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,411b13b57e2ea81a X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 24 May 2007 13:29:45 -0400 From: "Robert G. Hoover" <not.a.real.address@anywhere.sorry> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Multi-Thread HDC and Video Display References: <45f57403@newsgroups.borland.com> In-Reply-To: <45f57403@newsgroups.borland.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000743-3, 05/24/2007), Outbound message X-Antivirus-Status: Not-Tested NNTP-Posting-Host: 67.142.36.34 Message-ID: <4655cb92@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1180027794 67.142.36.34 (24 May 2007 10:29:54 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail