Exemplo n.º 1
0
HRESULT CVideoCapture::ConnnectTo(LPCWSTR lpszCapture)
{
	HRESULT hr = S_OK;
	
	// Capture
	
	CComPtr<IBaseFilter> pCapture;
	CreateFilter( lpszCapture, L"Video Capture", &pCapture );
	
	// Compressor
	
	CComPtr<IBaseFilter> pCompressor;
	CreateFilter( CLSID_H263Encoder, L"H.263 Encoder", &pCompressor );
	
	// Renderer
	
	CRtpSenderFilter* pSender = new CRtpSenderFilter(NULL, &hr);
	
	VIDEOINFOHEADER vih;
	ZeroMemory( &vih, sizeof( vih ) );
	vih.bmiHeader.biCompression	= MAKEFOURCC('H','2','6','3');
	pSender->SetupMediaType( &vih );
	
	CComPtr<IBaseFilter> pRenderer;
	pSender->QueryInterface( IID_IBaseFilter, (void**)&pRenderer );
	InstallFilter( pRenderer, L"Video Sender" );
	
	// RenderStream
	
	if ( SUCCEEDED(hr) ) hr =
	m_pCapGraphBuilder->RenderStream( &PIN_CATEGORY_CAPTURE,
		&MEDIATYPE_Video, pCapture, pCompressor, pRenderer );
	
	Run(); return hr;
}
Exemplo n.º 2
0
void OGRGMELayer::SetSpatialFilter( OGRGeometry *poGeomIn)
{
    if (poGeomIn == NULL) {
        osIntersects.clear();
        OGRLayer::SetSpatialFilter( poGeomIn );
        return;
    }
    switch( poGeomIn->getGeometryType() )
    {
      case wkbPolygon:
        WindPolygonCCW((OGRPolygon *) poGeomIn);
      case wkbPoint:
      case wkbLineString:
        if( poGeomIn == NULL ) {
          osIntersects = "";
        }
        else {
            char * pszWkt;
            poGeomIn->exportToWkt(&pszWkt);
            char * pszEscaped = CPLEscapeString(pszWkt, -1, CPLES_URL);
            osIntersects = CPLString(pszEscaped);
            CPLFree(pszEscaped);
            CPLFree(pszWkt);
        }
        ResetReading();
        break;
      default:
        m_iGeomFieldFilter = 0;
        if( InstallFilter( poGeomIn ) )
            ResetReading();
        break;
    }
}
Exemplo n.º 3
0
void OGRPGResultLayer::SetSpatialFilter( int iGeomField, OGRGeometry * poGeomIn )

{
    if( iGeomField < 0 || iGeomField >= GetLayerDefn()->GetGeomFieldCount() ||
        GetLayerDefn()->GetGeomFieldDefn(iGeomField)->GetType() == wkbNone )
    {
        if( iGeomField != 0 )
        {
            CPLError(CE_Failure, CPLE_AppDefined,
                     "Invalid geometry field index : %d", iGeomField);
        }
        return;
    }
    m_iGeomFieldFilter = iGeomField;

    OGRPGGeomFieldDefn* poGeomFieldDefn =
        poFeatureDefn->myGetGeomFieldDefn(m_iGeomFieldFilter);
    if( InstallFilter( poGeomIn ) )
    {
        if ( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOMETRY ||
             poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
        {
            if( m_poFilterGeom != NULL)
            {
                char szBox3D_1[128];
                char szBox3D_2[128];
                OGREnvelope  sEnvelope;

                m_poFilterGeom->getEnvelope( &sEnvelope );
                if( poGeomFieldDefn->ePostgisType == GEOM_TYPE_GEOGRAPHY )
                {
                    if( sEnvelope.MinX < -180.0 )
                        sEnvelope.MinX = -180.0;
                    if( sEnvelope.MinY < -90.0 )
                        sEnvelope.MinY = -90.0;
                    if( sEnvelope.MaxX > 180.0 )
                        sEnvelope.MaxX = 180.0;
                    if( sEnvelope.MaxY > 90.0 )
                        sEnvelope.MaxY = 90.0;
                }
                CPLsnprintf(szBox3D_1, sizeof(szBox3D_1), "%.18g %.18g", sEnvelope.MinX, sEnvelope.MinY);
                CPLsnprintf(szBox3D_2, sizeof(szBox3D_2), "%.18g %.18g", sEnvelope.MaxX, sEnvelope.MaxY);
                osWHERE.Printf("WHERE %s && %s('BOX3D(%s, %s)'::box3d,%d) ",
                               OGRPGEscapeColumnName(poGeomFieldDefn->GetNameRef()).c_str(),
                               (poDS->sPostGISVersion.nMajor >= 2) ? "ST_SetSRID" : "SetSRID",
                               szBox3D_1, szBox3D_2, poGeomFieldDefn->nSRSId );
            }
            else
            {
                osWHERE = "";
            }

            BuildFullQueryStatement();
        }

        ResetReading();
    }

}
Exemplo n.º 4
0
void OGRIngresTableLayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    if( !InstallFilter( poGeomIn ) )
        return;

    BuildWhere();

    ResetReading();
}
Exemplo n.º 5
0
void OGRSQLiteTableLayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    if( InstallFilter( poGeomIn ) )
    {
        BuildWhere();

        ResetReading();
    }
}
Exemplo n.º 6
0
void OGROGDILayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    if( !InstallFilter( poGeomIn ) )
        return;

    ResetReading();

    m_nTotalShapeCount = -1;
}
Exemplo n.º 7
0
void OGRWarpedLayer::SetSpatialFilter( int iGeomField, OGRGeometry *poGeom )
{
    if( iGeomField < 0 || iGeomField >= GetLayerDefn()->GetGeomFieldCount() )
    {
        CPLError(CE_Failure, CPLE_AppDefined,
                    "Invalid geometry field index : %d", iGeomField);
        return;
    }

    m_iGeomFieldFilter = iGeomField;
    if( InstallFilter( poGeom ) )
        ResetReading();

    if( m_iGeomFieldFilter == m_iGeomField )
    {
        if( poGeom == NULL || m_poReversedCT == NULL )
        {
            m_poDecoratedLayer->SetSpatialFilter(m_iGeomFieldFilter,
                                                NULL);
        }
        else
        {
            OGREnvelope sEnvelope;
            poGeom->getEnvelope(&sEnvelope);
            if( CPLIsInf(sEnvelope.MinX) && CPLIsInf(sEnvelope.MinY) &&
                CPLIsInf(sEnvelope.MaxX) && CPLIsInf(sEnvelope.MaxY) )
            {
                m_poDecoratedLayer->SetSpatialFilterRect(m_iGeomFieldFilter,
                                                        sEnvelope.MinX,
                                                        sEnvelope.MinY,
                                                        sEnvelope.MaxX,
                                                        sEnvelope.MaxY);
            }
            else if( ReprojectEnvelope(&sEnvelope, m_poReversedCT) )
            {
                m_poDecoratedLayer->SetSpatialFilterRect(m_iGeomFieldFilter,
                                                        sEnvelope.MinX,
                                                        sEnvelope.MinY,
                                                        sEnvelope.MaxX,
                                                        sEnvelope.MaxY);
            }
            else
            {
                m_poDecoratedLayer->SetSpatialFilter(m_iGeomFieldFilter,
                                                    NULL);
            }
        }
    }
    else
    {
        m_poDecoratedLayer->SetSpatialFilter(m_iGeomFieldFilter,
                                             poGeom);
    }
}
Exemplo n.º 8
0
HRESULT CGraphRender::InstallCapture(REFCLSID clsidDevClass, LPCWSTR lpszName)
{
	Stop();
	HRESULT hr = S_OK;
	
	// Capture
	
	CComPtr<IBaseFilter> pCapture;
	GetNextDevice( clsidDevClass, &pCapture );
	
	return InstallFilter( pCapture, lpszName );
}
Exemplo n.º 9
0
void OGRSQLiteSelectLayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    bAllowResetReadingEvenIfIndexAtZero = TRUE;

    if( InstallFilter( poGeomIn ) )
    {
        bSpatialFilterInSQL = RebuildSQLWithSpatialClause();

        ResetReading();
    }
}
Exemplo n.º 10
0
void OGRGFTTableLayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    GetLayerDefn();

    if( InstallFilter( poGeomIn ) )
    {
        BuildWhere();

        ResetReading();
    }
}
Exemplo n.º 11
0
void OGRPLScenesLayer::SetSpatialFilter(  OGRGeometry *poGeomIn )
{
    nFeatureCount = -1;
    poGeoJSONLayer = NULL;

    if( poGeomIn )
    {
        OGREnvelope sEnvelope;
        poGeomIn->getEnvelope(&sEnvelope);
        if( sEnvelope.MinX == sEnvelope.MaxX && sEnvelope.MinY == sEnvelope.MaxY )
        {
            OGRPoint p(sEnvelope.MinX, sEnvelope.MinY);
            InstallFilter(&p);
        }
        else
            InstallFilter( poGeomIn );
    }
    else
        InstallFilter( poGeomIn );

    ResetReading();
}
Exemplo n.º 12
0
/* ----------------------------------------------------------------------------
MidiShare setup
---------------------------------------------------------------------------- */
Boolean SetUpMidi(void)
{
  if ( !MidiShare() ) {
                printf("MidiShare is not installed\n");
                return false;
  }
  myRefNum = MidiOpen(AppliName);
  if ( myRefNum == MIDIerrSpace ) {
                printf("Too much MidiShare client applications\n");
                return false;
  }
  MidiSetRcvAlarm(myRefNum,ReceiveEvents);
  InstallFilter();
  MidiConnect (myRefNum, 0, true);
  MidiConnect (0, myRefNum, true);
  return true;
}
Exemplo n.º 13
0
/* ------------------------------------------------------------------------- */
int InitMidi()
{
if ( !MidiShare())
{
sprintf (string_Last_Order,"MidiShare not available\n");
}
InitTblLibEv();
myRefNum = MidiOpen(AppliName);
if (myRefNum < 0) {sprintf(string_Last_Order,"MidiOpen failed!");}

MidiSetRcvAlarm(myRefNum,ReceiveEvents);
MidiConnect(0, myRefNum, true);//in
MidiConnect(myRefNum,0,true);//out
myFilter = MidiNewFilter();
InstallFilter( myRefNum,myFilter ); //filtrage

return(0);
}
Exemplo n.º 14
0
HRESULT CGraphRender::InstallRender(CBaseFilter* pBaseFilter, LPCWSTR lpszName, IBaseFilter** ppFilter)
{
	Stop();
	HRESULT hr = S_OK;
	
	// Renderer
	
	CComPtr<IBaseFilter> pRenderer;
	if ( ! ppFilter ) ppFilter = &pRenderer;
	
	pBaseFilter->QueryInterface( IID_IBaseFilter, (void**)&pRenderer );
	pRenderer->QueryInterface( IID_IBaseFilter, (void**)ppFilter);
	
	hr = InstallFilter( pRenderer, lpszName );
	if ( FAILED(hr) ) return hr;
	
	return S_OK;
}
Exemplo n.º 15
0
void OGRUnionLayer::SetSpatialFilter( int iGeomField, OGRGeometry *poGeom )
{
    if( iGeomField < 0 || iGeomField >= GetLayerDefn()->GetGeomFieldCount() )
    {
        if( poGeom != NULL )
        {
            CPLError(CE_Failure, CPLE_AppDefined,
                        "Invalid geometry field index : %d", iGeomField);
            return;
        }
    }

    m_iGeomFieldFilter = iGeomField;
    if( InstallFilter( poGeom ) )
        ResetReading();

    if( iCurLayer >= 0 && iCurLayer < nSrcLayers)
    {
        SetSpatialFilterToSourceLayer(papoSrcLayers[iCurLayer]);
    }
}
Exemplo n.º 16
0
void OGRDGNLayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    if( !InstallFilter(poGeomIn) )
        return;

    if( m_poFilterGeom != NULL )
    {
        DGNSetSpatialFilter( hDGN, 
                             m_sFilterEnvelope.MinX, 
                             m_sFilterEnvelope.MinY, 
                             m_sFilterEnvelope.MaxX, 
                             m_sFilterEnvelope.MaxY );
    }
    else
    {
        DGNSetSpatialFilter( hDGN, 0.0, 0.0, 0.0, 0.0 );
    }

    ResetReading();
}
Exemplo n.º 17
0
void OGRCARTODBTableLayer::SetSpatialFilter( int iGeomField, OGRGeometry * poGeomIn )

{
    if( iGeomField < 0 || iGeomField >= GetLayerDefn()->GetGeomFieldCount() ||
        GetLayerDefn()->GetGeomFieldDefn(iGeomField)->GetType() == wkbNone )
    {
        if( iGeomField != 0 )
        {
            CPLError(CE_Failure, CPLE_AppDefined,
                     "Invalid geometry field index : %d", iGeomField);
        }
        return;
    }
    m_iGeomFieldFilter = iGeomField;

    if( InstallFilter( poGeomIn ) )
    {
        BuildWhere();

        ResetReading();
    }
}
Exemplo n.º 18
0
/* ------------------------------------------------------------------------- */
Boolean SetUpMidi(void)
{
	char buff[32], *name;

	InitTblLibEv();
	
	if ( !MidiShare()) {
		printf ("MidiShare not available\n");
		return false;
	}

	myRefNum = MidiOpen(AppliName);
	if ( myRefNum == MIDIerrSpace ){
		printf ( "Too much MidiShare client applications\n");
		return false;
	}
	
	MidiSetRcvAlarm(myRefNum,ReceiveEvents);
	MidiConnect( 0, myRefNum, true);
	myFilter = MidiNewFilter();
	InstallFilter( myRefNum, myFilter);
	return true;
}
Exemplo n.º 19
0
void test21 ()
{
        long    n;
        
        printf("\n\n<TEST 21> record and playback a sequence\n");
        DebugStr ("--> use g or G to start recording\n");

        ourSequence = MidiNewSeq();
    	ourFilter = MidiNewFilter();
        InstallFilter(ourRefNum,ourFilter);
        MidiFlushEvs(ourRefNum);
        MidiSetRcvAlarm(ourRefNum, record);
        MidiConnect(0, ourRefNum, true);
        MidiConnect(ourRefNum, 0, true);
        
        printf("Now play on the Midi keyboard, every thing is recorded\n");
        DebugStr ("--> use g or G to stop recording\n");

        MidiConnect(0, ourRefNum, false);
        MidiSetRcvAlarm(ourRefNum, 0);
        
        printf (" %ld events where recorded\n", size(ourSequence));

        DebugStr ("--> use g or G to play back the sequence\n");

        stopFlag = 0;
        if (FirstEv(ourSequence)) {
                MidiCall(play, MidiGetTime(), ourRefNum, (long) FirstEv(ourSequence), 0, 0);
        }
        
        printf("Now playing the sequence\n");
        DebugStr ("--> use g or G to stop play back and go to the next test\n");
        
        stopFlag = 1;
        MidiFreeSeq(ourSequence);
}
Exemplo n.º 20
0
HRESULT CVideoRenderer::Connnect()
{
	HRESULT hr = S_OK;
	
	// Capture
	
	CRtpReceiverFilter* pReceiver = new CRtpReceiverFilter(NULL, &hr);
	
	VIDEOINFOHEADER vih;
	ZeroMemory( &vih, sizeof( vih ) );
	vih.bmiHeader.biCompression	= MAKEFOURCC('H','2','6','3');
	pReceiver->SetupMediaType( &vih );
	
	CComPtr<IBaseFilter> pCapture;
	pReceiver->QueryInterface( IID_IBaseFilter, (void**)&pCapture );
	InstallFilter( pCapture, L"Video Receiver" );
	
	// RenderStream
	
	CComPtr<IBaseFilter> pSmartTee;
	CreateFilter( CLSID_SmartTee, L"Smart Tee", &pSmartTee );
	
	return ConnectFilter( pCapture, pSmartTee );
}
Exemplo n.º 21
0
MassImport::MassImport(QWidget *parent, CWmClient *wm)
    : QDialog(parent)
{
    ppl6::CString Tmp;
    ui.setupUi(this);
    this->wm=wm;
    searchWindow=NULL;
    currentTrackListItem=NULL;
    position=oldposition=0;
    TrackList=NULL;

    ui.treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
    ui.treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
    QString Style="QTreeView::item {\n"
                  "border-right: 1px solid #b9b9b9;\n"
                  "border-bottom: 1px solid #b9b9b9;\n"
                  "}\n"
                  "QTreeView::item:selected {\n"
                  //"border-top: 1px solid #80c080;\n"
                  //"border-bottom: 1px solid #80c080;\n"
                  "background: #000070;\n"
                  "color: rgb(255, 255, 255);\n"
                  "}\n"
                  "";
    ui.treeWidget->setStyleSheet(Style);

    TCVersion.Title=tr("Version");
    TCVersion.Init(this,wm,ui.versionId,ui.version,&wm->VersionStore);
    TCVersion.SetNextWidget(ui.versionApplyButton);

    TCGenre.Title=tr("Genre");
    TCGenre.Init(this,wm,ui.genreId,ui.genre,&wm->GenreStore);
    TCGenre.SetNextWidget(ui.genreApplyButton);

    TCLabel.Title=tr("Label");
    TCLabel.Init(this,wm,ui.labelId,ui.labelName,&wm->LabelStore);
    TCLabel.SetNextWidget(ui.labelApplyButton);

    TCRecordSource.Title=tr("Record Source");
    TCRecordSource.Init(this,wm,ui.recordSourceId,ui.recordSource,&wm->RecordSourceStore);
    TCRecordSource.SetNextWidget(ui.recordingSourceApplyButton);

    TCRecordDevice.Title=tr("Record Device");
    TCRecordDevice.Init(this,wm,ui.recordDeviceId,ui.recordDevice,&wm->RecordDeviceStore);
    TCRecordDevice.SetNextWidget(ui.recordDeviceApplyButton);


    QDate Date=QDate::currentDate();
    Tmp=Date.toString("yyyyMMdd");
    ui.releaseDate->setDate(Date);
    ui.recordDate->setDate(Date);



    InstallFilter(ui.versionId,6);
    InstallFilter(ui.version,7);
    InstallFilter(ui.genreId,8);
    InstallFilter(ui.genre,9);
    InstallFilter(ui.labelId,15);
    InstallFilter(ui.labelName,16);
    InstallFilter(ui.recordSourceId,17);
    InstallFilter(ui.recordSource,18);
    //InstallFilter(ui.recordDeviceId,19);
    //InstallFilter(ui.recordDevice,20);



}
Exemplo n.º 22
0
void OGRLayer::SetSpatialFilter( OGRGeometry * poGeomIn )

{
    if( InstallFilter( poGeomIn ) )
        ResetReading();
}