示例#1
0
void SoutDialog::updateMRL()
{
    QString qs_mux = ui.profileSelect->getMux();

    SoutMrl smrl( ":sout=#" );
    if( !ui.profileSelect->getTranscode().isEmpty() && ui.transcodeBox->isChecked() )
    {
        smrl.begin( ui.profileSelect->getTranscode() );
        smrl.end();
    }

    bool multi = false;

    if( ui.destTab->count() >= 3 ||
        ( ui.destTab->count() == 2 && ui.localOutput->isChecked() ) )
        multi = true;

    if( multi )
        smrl.begin( "duplicate" );

    for( int i = 1; i < ui.destTab->count(); i++ )
    {
        VirtualDestBox *vdb = qobject_cast<VirtualDestBox *>(ui.destTab->widget( i ));
        if( !vdb )
            continue;

        QString tempMRL = vdb->getMRL( qs_mux, ui.ttl->value(),
                                       ui.sap->isChecked(),
                                       ui.sapName->text(),
                                       ui.sapGroup->text() );
        if( tempMRL.isEmpty() ) continue;

        if( multi )
            smrl.option( "dst", tempMRL );
        else
        {
            smrl.begin( tempMRL);
            smrl.end();
        }
    }
    if( ui.localOutput->isChecked() )
    {
        if( multi )
            smrl.option( "dst", "display" );
        else
        {
            smrl.begin( "display" );
            smrl.end();
        }
    }

    if ( multi ) smrl.end();

    mrl = smrl.getMrl();

    if( ui.soutAll->isChecked() ) mrl.append( " :sout-all" );
    mrl.append( " :sout-keep" );

    ui.mrlEdit->setPlainText( mrl );
}
示例#2
0
void SoutDialog::updateMRL()
{
    QString qs_mux = ui.profileSelect->getMux();

    SoutMrl smrl( ":sout=#" );
    if( !ui.profileSelect->getTranscode().isEmpty() && ui.transcodeBox->isChecked() )
    {
        smrl.begin( ui.profileSelect->getTranscode() );
        smrl.end();
    }

    bool multi = false;

    if( ui.destTab->count() >= 3 ||
        ( ui.destTab->count() == 2 && ui.localOutput->isChecked() ) )
        multi = true;

    if( multi )
        smrl.begin( "duplicate" );

    for( int i = 1; i < ui.destTab->count(); i++ )
    {
        VirtualDestBox *vdb = qobject_cast<VirtualDestBox *>(ui.destTab->widget( i ));
        if( !vdb )
            continue;

        QString tempMRL = vdb->getMRL( qs_mux );
        if( tempMRL.isEmpty() ) continue;

        if( multi )
            smrl.option( "dst", tempMRL );
        else
        {
            smrl.begin( tempMRL);
            smrl.end();
        }
    }
    if( ui.localOutput->isChecked() )
    {
        if( multi )
            smrl.option( "dst", "display" );
        else
        {
            smrl.begin( "display" );
            smrl.end();
        }
    }

    if ( multi ) smrl.end();

    mrl = smrl.getMrl();

    if( ui.sap->isChecked() )
    {
        QString group = ui.sapGroup->text();
        QString name = ui.sapName->text();

        /* FIXME: This sucks. We should really return a QStringList instead of
         * (mis)quoting, concatainating and split input item paramters. */
        name = name.replace( " ", " " );
        group = group.replace( " ", " " );

        /* We need to add options for both standard and rtp targets */
        /* This is inelegant but simple and functional */
        mrl.append( qfu( " :sout-rtp-sap" ) );
        mrl.append( qfu( " :sout-rtp-name=" ) + name );
        mrl.append( qfu( " :sout-standard-sap" ) );
        mrl.append( qfu( " :sout-standard-name=" ) + name );
        mrl.append( qfu( " :sout-standard-group=" ) + group );
    }
    else
    {
        mrl.append( qfu( " :no-sout-rtp-sap" ) );
        mrl.append( qfu( " :no-sout-standard-sap" ) );
    }

    if( ui.soutAll->isChecked() ) mrl.append( " :sout-all" );

    mrl.append( qfu( " :ttl=" ) + QString::number( ui.ttl->value() ) );
    mrl.append( " :sout-keep" );

    ui.mrlEdit->setPlainText( mrl );
}