Click here to Skip to main content
15,905,144 members
Home / Discussions / C#
   

C#

 
QuestionRe: MultiThreading, went back to basics.. Pin
led mike26-Nov-08 8:33
led mike26-Nov-08 8:33 
AnswerRe: MultiThreading, went back to basics.. Pin
EliottA26-Nov-08 8:35
EliottA26-Nov-08 8:35 
AnswerRe: MultiThreading, went back to basics.. Pin
Dan Neely26-Nov-08 8:47
Dan Neely26-Nov-08 8:47 
AnswerRe: MultiThreading, went back to basics.. Pin
Luc Pattyn26-Nov-08 10:02
sitebuilderLuc Pattyn26-Nov-08 10:02 
GeneralRe: MultiThreading, went back to basics.. Pin
EliottA26-Nov-08 10:10
EliottA26-Nov-08 10:10 
GeneralRe: MultiThreading, went back to basics.. Pin
Luc Pattyn26-Nov-08 10:38
sitebuilderLuc Pattyn26-Nov-08 10:38 
AnswerRe: MultiThreading, went back to basics.. Pin
jas0n2326-Nov-08 18:07
jas0n2326-Nov-08 18:07 
QuestionVMR9 issue [modified] Pin
GrizzlyDoug26-Nov-08 7:09
GrizzlyDoug26-Nov-08 7:09 
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);

SetAllocatorPresenter();

mediaCtrl = (IMediaControl) graphBuilder;
mediaEvt = (IMediaEventEx) graphBuilder;

hr = dvdGraph.GetDvdInterface( typeof( IVideoWindow ).GUID, out comobj );
DsError.ThrowExceptionForHR( hr );

videoWin = (IVideoWindow) comobj;
comobj = null;

GetFrameStepInterface();
return true;
}
catch( Exception ee )
{
MessageBox.Show( this, "Could not get interfaces\r\n" + ee.Message, "DVDPlayer.NET", MessageBoxButtons.OK, MessageBoxIcon.Stop );
CloseInterfaces();
return false;
}
finally
{
if( comobj != null )
{
Marshal.ReleaseComObject( comobj );
comobj = null;
}
}

I was able to get part of this problem figured out. To configure the filter, it has to be done before rendering the video with the call to RenderDvdVideoVolume(). My next problem I have run into is setting up the AllocatorPresenter. The call to GetDvdInterface() with the IVMRSurfaceAllocatorNotify9 interface is returning a message that states "No such interface supported". I need to determine a way to get around this. Any help would be greatly appreciated.

Thanks in advance.

GrizMan

modified on Tuesday, December 2, 2008 10:54 AM

AnswerRe: VMR9 issue Pin
MBrooker7-Mar-09 6:23
MBrooker7-Mar-09 6:23 
QuestionTry...Catch block Pin
EliottA26-Nov-08 6:54
EliottA26-Nov-08 6:54 
AnswerRe: Try...Catch block Pin
PIEBALDconsult26-Nov-08 7:29
mvePIEBALDconsult26-Nov-08 7:29 
AnswerRe: Try...Catch block Pin
Gideon Engelberth26-Nov-08 7:33
Gideon Engelberth26-Nov-08 7:33 
AnswerRe: Try...Catch block Pin
Paul Conrad26-Nov-08 9:23
professionalPaul Conrad26-Nov-08 9:23 
GeneralRe: Try...Catch block [modified] Pin
Luc Pattyn26-Nov-08 10:31
sitebuilderLuc Pattyn26-Nov-08 10:31 
QuestionSearching for URL's in... Pin
jas0n2326-Nov-08 6:19
jas0n2326-Nov-08 6:19 
AnswerRe: Searching for URL's in... Pin
Christian Graus26-Nov-08 7:44
protectorChristian Graus26-Nov-08 7:44 
QuestionRe: Searching for URL's in... Pin
jas0n2326-Nov-08 16:32
jas0n2326-Nov-08 16:32 
QuestionLinq - Inserting into IDENTITY column. Pin
Exception Duck26-Nov-08 5:52
Exception Duck26-Nov-08 5:52 
QuestionHTTPContext for Remote object. (i didn't find Remoting forum) Pin
Member 232448326-Nov-08 5:47
Member 232448326-Nov-08 5:47 
QuestionConfigurationSettings Pin
madhu.nzd26-Nov-08 4:21
madhu.nzd26-Nov-08 4:21 
QuestionAssertions Pin
CodingYoshi26-Nov-08 4:05
CodingYoshi26-Nov-08 4:05 
AnswerRe: Assertions Pin
User 665826-Nov-08 5:32
User 665826-Nov-08 5:32 
Questionneed help translating one certain line of code from c++ to c# Pin
mSh198526-Nov-08 3:24
mSh198526-Nov-08 3:24 
AnswerRe: need help translating one certain line of code from c++ to c# Pin
HosamAly26-Nov-08 3:39
HosamAly26-Nov-08 3:39 
GeneralRe: need help translating one certain line of code from c++ to c# Pin
mSh198526-Nov-08 4:10
mSh198526-Nov-08 4:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.