Changeset c7c447ce6ff25ceb722bfa60184e4eaa0c02708f
- Timestamp:
- 06/09/07 19:59:36
(1 year ago)
- Author:
- Jean-Baptiste Kempf <jb@videolan.org>
- git-committer:
- Jean-Baptiste Kempf <jb@videolan.org> 1189101576 +0000
- git-parent:
[f77ac5c87be84dcf2a19c4324b59e12ccba6b9f7]
- git-author:
- Jean-Baptiste Kempf <jb@videolan.org> 1189101576 +0000
- Message:
Qt4 - Optimization of mrl generator. Only needed things are generated.
patch by Jean-François Massol
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf29d7df |
rc7c447c |
|
| 90 | 90 | |
|---|
| 91 | 91 | // /* Connect everything to the updateMRL function */ |
|---|
| 92 | | #define CB( x ) CONNECT( ui.x, clicked( bool ), this, updateMRL() ); |
|---|
| | 92 | #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() ); |
|---|
| 93 | 93 | #define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() ); |
|---|
| 94 | 94 | #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() ); |
|---|
| … | … | |
| 130 | 130 | } |
|---|
| 131 | 131 | |
|---|
| | 132 | QString SoutDialog::getMrl() |
|---|
| | 133 | { |
|---|
| | 134 | return this->mrl; |
|---|
| | 135 | } |
|---|
| | 136 | |
|---|
| 132 | 137 | void SoutDialog::fileBrowse() |
|---|
| 133 | 138 | { |
|---|
| … | … | |
| 257 | 262 | sout_gui_descr_t sout; |
|---|
| 258 | 263 | memset( &sout, 0, sizeof( sout_gui_descr_t ) ); |
|---|
| | 264 | int counter = 0; |
|---|
| 259 | 265 | |
|---|
| 260 | 266 | sout.b_local = ui.localOutput->isChecked(); |
|---|
| … | … | |
| 282 | 288 | sout.psz_name = strdup( qtu( ui.sapName->text() ) ); |
|---|
| 283 | 289 | |
|---|
| | 290 | #define COUNT() \ |
|---|
| | 291 | { \ |
|---|
| | 292 | if ( sout.b_local ) \ |
|---|
| | 293 | counter += 1; \ |
|---|
| | 294 | if ( sout.b_file ) \ |
|---|
| | 295 | counter += 1; \ |
|---|
| | 296 | if ( sout.b_http ) \ |
|---|
| | 297 | counter += 1; \ |
|---|
| | 298 | if ( sout.b_mms ) \ |
|---|
| | 299 | counter += 1; \ |
|---|
| | 300 | if ( sout.b_udp ) \ |
|---|
| | 301 | counter += 1; \ |
|---|
| | 302 | } |
|---|
| | 303 | |
|---|
| | 304 | COUNT() |
|---|
| | 305 | |
|---|
| 284 | 306 | #define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt ); |
|---|
| 285 | 307 | SMUX( PSMux, "ps" ); |
|---|
| … | … | |
| 341 | 363 | #define ISMORE() if ( more ) mrl.append( "," ); |
|---|
| 342 | 364 | |
|---|
| 343 | | if ( trans ) |
|---|
| 344 | | { |
|---|
| 345 | | mrl.append( ":duplicate{" ); |
|---|
| 346 | | } |
|---|
| 347 | | else |
|---|
| | 365 | #define ATLEASTONE() \ |
|---|
| | 366 | if ( counter > 1 ) \ |
|---|
| | 367 | { \ |
|---|
| | 368 | mrl.append( "dst=" ); \ |
|---|
| | 369 | } |
|---|
| | 370 | |
|---|
| | 371 | if ( trans ) |
|---|
| | 372 | { |
|---|
| | 373 | mrl.append( ":" ); |
|---|
| | 374 | } |
|---|
| | 375 | else |
|---|
| 348 | 376 | { |
|---|
| 349 | 377 | mrl = ":sout=#"; |
|---|
| 350 | 378 | } |
|---|
| 351 | 379 | |
|---|
| | 380 | if ( counter > 1 ) |
|---|
| | 381 | { |
|---|
| | 382 | mrl.append( "duplicate{" ); |
|---|
| | 383 | } |
|---|
| | 384 | |
|---|
| 352 | 385 | if ( sout.b_local ) |
|---|
| 353 | 386 | { |
|---|
| 354 | 387 | ISMORE(); |
|---|
| 355 | | mrl.append( "dst=display" ); |
|---|
| | 388 | ATLEASTONE() |
|---|
| | 389 | mrl.append( "display" ); |
|---|
| 356 | 390 | more = true; |
|---|
| 357 | 391 | } |
|---|
| … | … | |
| 360 | 394 | { |
|---|
| 361 | 395 | ISMORE(); |
|---|
| 362 | | mrl.append( "dst=std{access=file,mux=" ); |
|---|
| | 396 | ATLEASTONE() |
|---|
| | 397 | mrl.append( "std{access=file,mux=" ); |
|---|
| 363 | 398 | mrl.append( sout.psz_mux ); |
|---|
| 364 | 399 | mrl.append( ",dst=" ); |
|---|
| … | … | |
| 371 | 406 | { |
|---|
| 372 | 407 | ISMORE(); |
|---|
| 373 | | mrl.append( "dst=std{access=http,mux=" ); |
|---|
| | 408 | ATLEASTONE() |
|---|
| | 409 | mrl.append( "std{access=http,mux=" ); |
|---|
| 374 | 410 | mrl.append( sout.psz_mux ); |
|---|
| 375 | 411 | mrl.append( ",dst=" ); |
|---|
| … | … | |
| 384 | 420 | { |
|---|
| 385 | 421 | ISMORE(); |
|---|
| 386 | | mrl.append( "dst=std{access=mmsh,mux=" ); |
|---|
| | 422 | ATLEASTONE() |
|---|
| | 423 | mrl.append( "std{access=mmsh,mux=" ); |
|---|
| 387 | 424 | mrl.append( sout.psz_mux ); |
|---|
| 388 | 425 | mrl.append( ",dst=" ); |
|---|
| … | … | |
| 397 | 434 | { |
|---|
| 398 | 435 | ISMORE(); |
|---|
| 399 | | mrl.append( "dst=std{access=udp,mux=" ); |
|---|
| | 436 | ATLEASTONE() |
|---|
| | 437 | mrl.append( "std{access=udp,mux=" ); |
|---|
| 400 | 438 | mrl.append( sout.psz_mux ); |
|---|
| 401 | 439 | mrl.append( ",dst=" ); |
|---|
| … | … | |
| 417 | 455 | } |
|---|
| 418 | 456 | |
|---|
| 419 | | if ( trans ) |
|---|
| | 457 | if ( counter > 1 ) |
|---|
| 420 | 458 | { |
|---|
| 421 | 459 | mrl.append( "}" ); |
|---|
| r21dd718 |
rc7c447c |
|
| 44 | 44 | virtual ~SoutDialog() {} |
|---|
| 45 | 45 | |
|---|
| | 46 | QString getMrl(); |
|---|
| 46 | 47 | QString mrl; |
|---|
| 47 | 48 | //sout_gui_descr_t *sout; |
|---|
| re4bbf1c |
rc7c447c |
|
| 401 | 401 | int i_len = strlen( qtu(s->mrl) ) + 10; |
|---|
| 402 | 402 | char *psz_option = (char*)malloc(i_len); |
|---|
| 403 | | snprintf( psz_option, i_len - 1, ":sout=%s", qtu(s->mrl)); |
|---|
| | 403 | snprintf( psz_option, i_len - 1, "%s", qtu(s->mrl)); |
|---|
| 404 | 404 | |
|---|
| 405 | 405 | playlist_AddExt( THEPL, qtu( mrl ), "Streaming", |
|---|