Ejemplo n.º 1
0
int LibusbDevice::ReleaseAllInterfacesForCurrentConfig() const
{
  int config_num;
  const int get_config_ret = libusb_get_configuration(m_handle, &config_num);
  if (get_config_ret < 0)
    return get_config_ret;
  return ReleaseAllInterfaces(config_num);
}
Ejemplo n.º 2
0
// Function name	: CVMR9Graph::ResetGraph
// Description	    : reset the graph - clean interfaces
// Return type		: BOOL 
BOOL CVMR9Graph::ResetGraph()
{
	// STOP the graph
	if (m_pMediaControl != NULL) {
		m_pMediaControl->Stop();
	}

	try {
		ReleaseAllInterfaces();
	} catch(...) {
		ReportError("Can't reset graph, we have serious bugs...", E_FAIL);
		return FALSE;
	}

	return TRUE;
}
Ejemplo n.º 3
0
// Function name	: CVMR9Graph::BuildFilterGraph
// Description	    : construct the filter graph
// Return type		: BOOL 
BOOL CVMR9Graph::BuildFilterGraph(bool withSound)
{
	HRESULT hr;

	ReleaseAllInterfaces();
	RemoveFromRot();
	
	// BUILD the filter graph
	hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IUnknown, (void**) &m_pGraphUnknown);
	if (FAILED(hr)) {
		ReportError("Could not build the graph", hr);
		return FALSE;
	}
	// QUERY the filter graph interfaces
	hr = m_pGraphUnknown->QueryInterface(IID_IGraphBuilder, (void**) &m_pGraphBuilder);
	hr = m_pGraphUnknown->QueryInterface(IID_IFilterGraph, (void**) &m_pFilterGraph);
	hr = m_pGraphUnknown->QueryInterface(IID_IFilterGraph2, (void**) &m_pFilterGraph2);
	hr = m_pGraphUnknown->QueryInterface(IID_IMediaControl, (void**) & m_pMediaControl);
  hr = m_pGraphUnknown->QueryInterface(IID_IMediaSeeking, (void**) & m_pMediaSeeking);
	//hr = m_pGraphUnknown->QueryInterface(IID_IMediaEvent, (void**) &m_pMediaEvent);
	//hr = m_pGraphUnknown->QueryInterface(IID_IMediaEventEx, (void**) &m_pMediaEventEx);

/*	// SET the graph state window callback
	if (m_pMediaEventEx != NULL) {
		m_pMediaEventEx->SetNotifyWindow((OAHWND)m_hMediaWindow, WM_MEDIA_NOTIF, NULL);
    //m_pMediaEventEx->SetNotifyWindow(NULL, NULL, NULL);
	}*/

  if (withSound)
	  BuildSoundRenderer();

// Don't known what's wrong... but RenderEx crash when playing whith graphedit build 021204 ...
  //do we need this??
	//AddToRot(m_pGraphUnknown);

	return BuildVMR();
}
Ejemplo n.º 4
0
// Function name	: CVMR9Graph::~CVMR9Graph
// Description	    : destructor
// Return type		: 
CVMR9Graph::~CVMR9Graph()
{
	ReleaseAllInterfaces();
  long newProc = GetWindowLong(m_hMediaWindow, GWL_WNDPROC);
}