This is more of a Video question. I hope someone out there can help me out, and if so, I really appreciate it. I am trying to modify the DVD Player sample for DirectShow to use VMR9 with the allocator and presenter. I setup code to RenderDvdVideoVolume with the VMR9Only flag and I added code to FindFilterByName for the Video Mixing Renderer 9 from the filtergraph. I get the filter and it is not null. Then I want to configure the filter, so I get the IVMRFilterConfig9 interface by casting my filter to that interface as done in quite a few of the examples. By the way, this is being done on a machine with Windows Vista. Next, when I use the config interface to configure the VMR9 filter, I run into problems. If I try to set the rendering mode or the number of streams I get an exception that tells me "The operation could not be performed because the filter is in the wrong state." I have looked all over for solutions to this, but I have not had any luck. Below is a snippet of my code and the VMR9 filter is declared outside of this snippet as a private IBaseFilter. int hr; AMDvdRenderStatus status; object comobj = null; try { dvdGraph = (IDvdGraphBuilder)new DvdGraphBuilder(); //filter = (IBaseFilter)new VideoMixingRenderer9(); //hr = dvdGraph.RenderDvdVideoVolume( null, AMDvdGraphFlags.None, out status ); hr = dvdGraph.RenderDvdVideoVolume(null, AMDvdGraphFlags.VMR9Only, out status); DsError.ThrowExceptionForHR( hr ); hr = dvdGraph.GetDvdInterface( typeof( IDvdInfo2 ).GUID, out comobj ); DsError.ThrowExceptionForHR( hr ); dvdInfo = (IDvdInfo2) comobj; comobj = null; hr = dvdGraph.GetDvdInterface( typeof( IDvdControl2 ).GUID, out comobj ); DsError.ThrowExceptionForHR( hr ); dvdCtrl = (IDvdControl2) comobj; comobj = null; hr = dvdGraph.GetFiltergraph( out graphBuilder ); DsError.ThrowExceptionForHR( hr ); hr = graphBuilder.FindFilterByName("Video Mixing Renderer 9", out filter); DsError.ThrowExceptionForHR(hr); if (filter == null) { MessageBox.Show("Need to add the VMR9 Filter"); } IVMRFilterConfig9 filterConfig = (IVMRFilterConfig9)filter; //********** // This is where I run into the exception //********** //hr = filterConfig.SetRenderingMode(VMR9Mode.Renderless); hr = filterConfig.SetRenderingMode(VMR9Mode.Windowed); DsError.ThrowExceptionForHR(hr); hr = filterConfig.SetNumberOfStreams(1); DsError.ThrowExceptionForHR(hr); SetAl
GrizzlyDoug
Posts
-
VMR9 issue [modified] -
Map USB Port to DirectSound DeviceHere is a further update on what I have done: I have a question about ParentIdPrefix. I am down at the device level for USB devices and I found the DriverKeyName by first setting up a SP_DEVINFO_DATA da = new SP_DEVINFO_DATA() structure and then calling SetupDiEnumDeviceInfo(h,i,ref da) and then using SetupDiGetDeviceRegistryProperty with SPDRP_DRIVER. Now I want to access the ParentIdPrefix at that level and compare it to the ParentIdPrefix I extract from the Interfaces ID string provided by DirectSound. In my code in which I have used the example from USBView to get to the USB Device level. I tried to get the ParentIdPrefix by using CM_Get_Parent with the da.DevInst value I have. The value I received (3042) does not represent the ParentIdPrefix value (string) (7&f4e88d5&0) I can see in the registry. I would like to get the value I see in the registry. Do you know how I would go about this? Thanks in advance for your help.
GrizMan
-
Map USB Port to DirectSound DeviceI am having a problem with mapping the USB Port of a USB Device to it's coresponding DirectSound Device. I am doing this in order to associate a specific USB Port with a specific DirectSound Device in order to get the FriendlyName for the DirectSound Device to associate with an audio control. I need to have specific knowledge of the USB Port in order to make sure the endpoint audio device is going to the correct user. I'm working in VS 2005.NET C# and hope this is possible. I've taken a look at the C# version of USBView, which gets you down to the USB Device, and I have also looked at DirectSoundEnumerator, which I can use to search the Interface string for the "USB" substring in order to select the DirectSound USB Audio Devices. From what I can see so far, there is no matching information coming from either side in order to map these two together. Does anyone have any way of doing this? Thanks in advance for any help, which is greatly appreciated.
GrizMan
-
Audio Device Enumeration to uniquely identify a USB audio deviceI found another way to approach it. It's a bit of a hack, but for now to get the Interface ID using C# from my application, I can modify the DirectSoundEnumerator C++ application to remove the GUI and get rid of the dialog. Once that is done, I can run the C++ application as a process in C# and have it write the Description and Interface ID data to a file. I can then read the data from the file to get the Interface ID associated with the device and map that to the unique devices I access in my application. Like I said, it's kind of a hack, but until I find a better way to do it with C#, it will get the job done. I'm going to call this a general message type and not the answer yet because it is a hack and maybe there is a better way to do this.
GrizMan
-
Audio Device Enumeration to uniquely identify a USB audio deviceRecently I've looked at several examples to find a way to uniquely identify a USB audio device, such as a Logitech Headset or Microphone. I looked at a DirectShow and DirectX.DirectSound example in C# called DirectXCapture_demo and I also looked at an example in C++ called DirectSoundEnumerator. The project that I am working on is in C#. In the DirectSoundEnumerator example I noticed under the interface column that the string or interface displayed starts out with USB as opposed to HD Audio. I am trying to find a generic way to make this determination, because we may have different USB devices, even though we are using Logitech devices right now. I also looked at a third example called DirectSoundDemo. In the DirectSoundDemo I can access just about all the same fields that I can in the DirectSoundEnumerator example except the data displayed in the Interface column. Does anyone know a way in C# to access the data in the Interface column of the DirectSoundEnumerator example? Also, is that the best way to uniquely identify a USB Audio Device as opposed to a HD Audio Device on your integrated sound card? Any help would be greatly appreciated and thanks in advance.
GrizMan
-
A fine display of Australian Chivalry.That location has some great scenery, but there are some slim pickens there.
GrizMan
-
Windows Media Player CLSID for CD or DVDI'm building a filtergraph and I'm sort of new at this. I want to build a filter graph that takes input from a Windows Media Player to capture the audio, whether I'm playing music or a video. I read about a filter with the class id of CLSID_WMPCD and I tried to access it from Direct Show on my PC, but wasn't able to. I Googled it and it wasn't anywhere to be found. Does anyone know anything about it, and is there possibly a CLSID_WMPDVD? Thanks for any help anyone can provide.
GrizMan
-
Adding WM_VSCROLL to message handler for slider control in VS 2005 with C++ and MFCIn trying to add WM_VSCROLL to message handler for slider control in VS 2005 with C++ and MFC, I ran into problem that the slider only supports 4 NMXXXXXXXXX messages or events. What wizards and tabs/menu selections do I choose to get to a place where I can add the WM_VSCROLL message handler to handle messages for the slider so I can get access to it's current value. This is probably an easy thing to do, but it seems like it has gotten more difficult since access to all the messages has been limited, leaving only a very small subset.
GrizMan
-
Filter GraphsTo All: I'm a newbie at filter graphs and I've been working on building a filter graph to convert/play a .mp3 file to a .wav format and play the music. In my filter graph I have an infinite pin tee filter, which is splitting the output to go to three output devices ( 2 sets of headphones and a set of speakers ). I built the filter graph in GraphEdit and it works fine. It splits the output to the 3 output devices. Now I've taken on the challenge of building this filter graph programmatically and I'm running into some difficulties. When I put my filter graph on the ROT to examine it in GraphEdit, either it's not visible when I try to get the remote graph or I get an error, "Object reference not set to an instance of an object." That's one part that would be useful for debugging. I also read that the physical connections that I created programmatically for the pins may be changed when I render the file, which causes the above error. The second part is that I may be building my filter graph incorrectly (most likely). Like I said, I'm a newbie at this. The code I have started with, came from a project I found on the net, and then I made quite a few modifications to get where I am now. My code doesn't seem to split the outputs to the different output devices. I only get the music to one headset, and nothing to the others. I'm not sure if it's how I'm finding and connecting my pins, or just how I'm building the filtergraph, which is causing me the problems. I read something on one of the forums last night about building the filter graph the way you would put it together in GraphEdit, so I changed my code to connect pins as I added filters. It still is giving me problems with not splitting the outputs to the devices. There is one more issue. This is being developed on a Vista machine in C#, but I went to the compatibility tab in the properties for the executable and set it to a Compatibility mode of "Windows XP (Service Pack 2)". Did I say that I do have it working in GraphEdit, with the splitting of the outputs? I have added the code below. If anyone has any suggestions or can help me, I would greatly appreciate it. Thanks in advance. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using System.Runtime.InteropServices; using DirectShowLib; public class M2Mkv : Form { private Button button1; private RadioButton MkvRadioButton; private RadioButton WmvRadioButton; privat