This project is read-only.

Deployment

Aug 31, 2009 at 4:55 PM
Edited Sep 1, 2009 at 7:14 PM

If I deploy an application that used VideoRendererElement, will the end-user have to do the "register DShowMediaBridge.ax with regsvr32" thing?  That would not be cool...

Is there a way I could include the DShowMediaBridge.ax file in my project and register it in code so that it happens automatically when the end-users run my application?

Sep 3, 2009 at 5:03 PM
This seems to work:

                Assembly assembly = Assembly.GetExecutingAssembly();
                Stream stream = assembly.GetManifestResourceStream("MyApp.Resources.DShowMediaBridge.ax"); // or whatever
                BinaryReader br = new BinaryReader(stream);
                string destPath = AppDomain.CurrentDomain.BaseDirectory + "\\DShowMediaBridge.ax";
                FileStream fs = new FileStream(destPath, FileMode.Create);
                BinaryWriter bw = new BinaryWriter(fs);
                byte[] ba = new byte[stream.Length];
                stream.Read(ba, 0, ba.Length);
                bw.Write(ba);
                br.Close();
                bw.Close();
                fs.Close();
                stream.Close();
                Process.Start("regsvr32.exe", "/s " + "DShowMediaBridge.ax"); // register dll silently'
Basically, I add the .ax file as a resource in my project with a build action of "Embedded Resource." The above code pulls it out of the assembly at run-time, writes it to disk, and then registers it with regsvr32.
I run this "on-load" and it seems to be working.

Anybody know what to do about the "tearing" effects and the line of "noise" along the bottom of the video? Is anybody else seeing that?