x86 vs任何CPU和DirectShow? [英] x86 vs ANY CPU and DirectShow??

查看:106
本文介绍了x86 vs任何CPU和DirectShow?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了很多问题,发布了一些使用DirectShow从硬件视频板捕获视频的软件。  我已经尝试了三种不同的商业.Net库,在我的开发机器上,它们在我的测试机器上工作正常,
有时捕获会在数小时后锁定,而在客户机上,它们几乎立即锁定或者它们有浪费视频。

I have been running into lots of issues releasing some software which uses DirectShow for capturing video from a hardware video board.  I have tried three different commercial .Net libraries and on my development machine they work fine, on my test machines, sometimes the capture locks up after hours, and on client machines, they lock up almost immediately or they have choppy video.

今天我尝试使用DirectShow.NET(Source Forge)编写一些捕获软件并使用其中一个演示程序。

Well today I tried out writing some capture software using DirectShow.NET (Source forge) and used one of their demo programs.

它运行正常,所以我决定尝试将部分内容移植到我的应用程序中。  所以我在Visual Studio 2010 C#中创建了一个新的Windows窗体应用程序并运行它。  它表现不正常,除非我调整窗口大小,否则不显示任何视频,然后当调整大小停止时
将停止。  有时它根本不会启动视频。

It was working fine, so I decided to try and port parts of it to my application.  So I created a new Windows Form app in Visual Studio 2010 C#, and ran it.  It behaved erratically, wouldn't show any video unless I resized the window, and then it would stop when the resizing stopped.  Sometimes it wouldn't start the video at all.

所以我搜索所有代码并找到除表单之外的任何其他内容。  然后我查看了构建部分,我看到我的开发机器设置为x86版本,而演示应用程序设置为任何CPU。

So I search throughout all of the code and could find anything different except for the form.  But then I looked in the build section and I saw that my development machine was set for x86 release whereas the demo app was set for ANY CPU.

所以我改变了它。  现在它运行得很好。  给出了什么?  我的开发机器是64位,我用之前的捕获代码执行的所有应用程序都是针对x86的。

So I changed it.  Now it is running perfectly.  What gives?  My development machine is 64 bit and all apps I have been doing with the previous capture code were for x86.

这可能是一直存在的问题吗?  为什么会有这么大的差异?

Could this be the issue all along?  Why would there be such a big difference?

感谢您对此有任何见解。

Thanks for any insight in this.




推荐答案

为AnyCPU设置的.NET应用程序将在Windows x64系统上作为"x64 native"应用程序运行。这对于纯托管代码非常适用,假设您只调用标准.NET库,这些库在受支持的平台上都可以作为
32位和本机64位组件。

A .NET application set for AnyCPU will run as a 'x64 native' application on a Windows x64 system. This works perfectly fine for pure managed code assuming you are only calling standard .NET libraries which are all available on the supported platforms as both 32-bit and native 64-bit components.

但是,如果您的.NET应用程序依赖于某些已安装/可用于32位的组件,但不能以64位方式使用,那么这些组件将"丢失"并且您的应用程序将失败。解决此问题有两种选择:

However, if your .NET application relies on some component that is installed/available for 32-bit, but is not available as 64-bit then those components will be 'missing' and your app will fail. There are two choices for resolving this:

(1)确保您使用的所有组件的64位版本都安装在系统上

(1) ensure that the 64-bit version of all components you use are installed on the system

- 或 -

(2)如果它们仅作为32位提供,则必须明确强制您的应用程序始终作为32位进程运行,即使在x64计算机上通过/ platform :x86。

(2) if they are only available as 32-bit, you must explicitly force your application to always run as a 32-bit process even on a x64 machine via /platform:x86.

DirectShow.NET支持x64,但前提是您已将该版本的程序集部署到目标计算机。

DirectShow.NET does support x64, but only if you have deployed that version of the assemblies to the target machine.

请参阅< a href ="http://msdn.microsoft.com/en-us/library/ms241064(v=vs.110).aspx">
http://msdn.microsoft.com/en-us/ library / ms241064(v = vs.110).aspx


这篇关于x86 vs任何CPU和DirectShow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆