コード例 #1
0
ファイル: dvbstream.cpp プロジェクト: iegor/kdesktop
bool DvbStream::startBroadcast( QPtrList<ChannelDesc> *list, Ts2Rtp *rtp )
{
	int i, j;
	bool stop=false, newout;
	DVBout *o=0;
	int no=0;
	ChannelDesc *chan=list->at(0);
	QPtrList<ChannelDesc> broadcastList;
	broadcastList.setAutoDelete( true );

	if ( !isTuned() ) {
		for ( i=0; i<MAXTUNETRY; i++ ) {
			if ( tuneDvb( chan ) ) {
				i = -1;
				break;
			}
			else
				usleep(100000);
		}
		if ( i<0 )
			stop = true;
		else
			return false;
	}

	for ( i=0; i<(int)list->count(); i++ ) {
		newout = false;
		o = 0;
		for ( j=0; j<(int)out.count(); j++ ) {
			if ( out.at(j)->channel.name==list->at(i)->name )
				o = out.at(j);
		}

		if ( !o ) {
			o = new DVBout( *list->at(i), dvbDevice->adapter, dvbDevice->tuner, plug );
			connect( o, SIGNAL(endRecord(DVBout*,RecTimer*,bool)), this, SLOT(recordEnded(DVBout*,RecTimer*,bool)) );
			connect( o, SIGNAL(playDvb()), this, SLOT(receivePlayDvb()) );
			connect( o, SIGNAL(shifting(bool)), this, SLOT(receiveShifting(bool)) );
			out.append( o );
			if ( !setPids( o ) ) {
				removePids( o );
				removeOut( o );
				o = 0;
			}
			else
				newout = true;
		}

		if ( o ) {
			if ( !o->goBroadcast( rtp ) ) {
				if ( newout ) {
					removePids( o );
					removeOut( o );
				}
			}
			else {
				broadcastList.append( new ChannelDesc( *list->at(i) ) );
				no++;
				if ( list->at(i)->fta && cam )
					cam->startService( list->at(i) );
			}
		}
	}
コード例 #2
0
ファイル: PerfPmuTarget.cpp プロジェクト: CSRedRat/CodeXL
HRESULT PerfPmuTarget::setCpus(size_t nbr, int* cpus)
{
    return setPids(0, NULL, nbr, cpus, true);
}