예제 #1
0
static int _v4w_start(V4wState *s, void *arg)
{
    int i;
    s->frame_count=-1;

    i = v4w_open_videodevice(s);

    if (s->rotregvalue==0) {
        //RemoveGraphFromRot(s->rotregvalue);
        if (s->m_pNullRenderer!=NULL)
            s->m_pGraph->RemoveFilter(s->m_pNullRenderer);
        if (s->m_pIDXFilter!=NULL)
            s->m_pGraph->RemoveFilter(s->m_pIDXFilter);
        if (s->m_pDeviceFilter!=NULL)
            s->m_pGraph->RemoveFilter(s->m_pDeviceFilter);
        s->m_pBuilder=NULL;
        s->m_pControl=NULL;
        s->m_pIDXFilter=NULL;
        if (s->m_pDXFilter!=NULL)
            s->m_pDXFilter->Release();
        s->m_pDXFilter=NULL;
        s->m_pGraph=NULL;
        s->m_pNullRenderer=NULL;
        s->m_pDeviceFilter=NULL;
        CoUninitialize();
        s_callback = NULL;
        flushq(&s->rq,0);
        ms_message("v4w: graph not started (err=%i)", i);
        s->rotregvalue=0;
        s->pix_fmt = MS_YUV420P;
    }
    return i;
}
예제 #2
0
static int try_format(V4wState *s, int format, MSVideoSize *vsize)
{
	int i = v4w_open_videodevice(s, format, vsize);
	if (i==-14)
	{
		if (s->m_pNullRenderer!=NULL)
			s->m_pGraph->RemoveFilter(s->m_pNullRenderer);
		if (s->m_pIDXFilter!=NULL)
			s->m_pGraph->RemoveFilter(s->m_pIDXFilter);
		if (s->m_pDeviceFilter!=NULL)
			s->m_pGraph->RemoveFilter(s->m_pDeviceFilter);
		s->m_pBuilder=NULL;
		s->m_pControl=NULL;
		s->m_pIDXFilter=NULL;
		if (s->m_pDXFilter!=NULL)
			s->m_pDXFilter->Release();
		s->m_pDXFilter=NULL;
		s->m_pGraph=NULL;
		s->m_pNullRenderer=NULL;
		s->m_pDeviceFilter=NULL;
		CoUninitialize();
	}
	return i;
}