~mfisch/brasero/update-to-3.8.0

« back to all changes in this revision

Viewing changes to libbrasero-burn/brasero-caps-session.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2010-07-04 15:14:24 UTC
  • mfrom: (1.3.7 upstream)
  • mto: (1.4.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: james.westby@ubuntu.com-20100704151424-yg69h5sc55xgjp6h
Tags: 2.30.2-1
* New upstream release.
  - Fixes incorrectly reported size by passing correct arguments to
    g_signal_emit(). Closes: #568606
  - Fixes tracker search support. Closes: #465238
* debian/patches/90_relibtoolize.patch
  - Refresh for new upstream release.
* Switch to source formate 3.0 (quilt)
  - Add debian/source/format.
  - Drop Build-Depends on quilt.
  - Remove /usr/share/cdbs/1/rules/patchsys-quilt.mk from debian/rules.
* Bump-Standards-Version to 3.9.0
  - Use architecture wildcard kfreebsd-any for the libcam-dev Build-Depends.
  - Use Breaks instead of Conflicts as recommended by the new policy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
565
565
{
566
566
        GSList *iter;
567
567
 
568
 
        BRASERO_BURN_LOG_WITH_TYPE (&caps->type, BRASERO_PLUGIN_IO_NONE, "(Has %i links) Found link", g_slist_length (caps->links));
 
568
        BRASERO_BURN_LOG_WITH_TYPE (&caps->type, BRASERO_PLUGIN_IO_NONE, "Found link (with %i links):", g_slist_length (caps->links));
569
569
 
570
570
        /* Here we only make sure we have at least one link working. For a link
571
571
         * to be followed it must first:
587
587
 
588
588
                if (!link->caps)
589
589
                        continue;
590
 
 
 
590
                
591
591
                /* check that the link has some active plugin */
592
592
                if (!brasero_caps_link_active (link, ctx->ignore_plugin_errors))
593
593
                        continue;
594
594
 
595
595
                /* since this link contains recorders, check that at least one
596
596
                 * of them can handle the record flags */
597
 
                if (ctx->check_session_flags
598
 
                &&  brasero_track_type_get_has_medium (&caps->type)
599
 
                && !brasero_caps_link_check_record_flags (link, ctx->ignore_plugin_errors, ctx->session_flags, ctx->media))
600
 
                        continue;
 
597
                if (ctx->check_session_flags && brasero_track_type_get_has_medium (&caps->type)) {
 
598
                        if (!brasero_caps_link_check_record_flags (link, ctx->ignore_plugin_errors, ctx->session_flags, ctx->media))
 
599
                                continue;
 
600
 
 
601
                        if (brasero_caps_link_check_recorder_flags_for_input (link, ctx->session_flags) != BRASERO_BURN_OK)
 
602
                                continue;
 
603
                }
601
604
 
602
605
                /* first see if that's the perfect fit:
603
606
                 * - it must have the same caps (type + subtype)
1358
1361
        return BRASERO_IMAGE_FORMAT_NONE;
1359
1362
}
1360
1363
 
 
1364
static BraseroBurnResult
 
1365
brasero_caps_set_flags_from_recorder_input (BraseroTrackType *input,
 
1366
                                            BraseroBurnFlag *supported,
 
1367
                                            BraseroBurnFlag *compulsory)
 
1368
{
 
1369
        if (brasero_track_type_get_has_image (input)) {
 
1370
                BraseroImageFormat format;
 
1371
 
 
1372
                format = brasero_track_type_get_image_format (input);
 
1373
                if (format == BRASERO_IMAGE_FORMAT_CUE
 
1374
                ||  format == BRASERO_IMAGE_FORMAT_CDRDAO) {
 
1375
                        if ((*supported) & BRASERO_BURN_FLAG_DAO)
 
1376
                                (*compulsory) |= BRASERO_BURN_FLAG_DAO;
 
1377
                        else
 
1378
                                return BRASERO_BURN_NOT_SUPPORTED;
 
1379
                }
 
1380
                else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
 
1381
                        /* RAW write mode should (must) only be used in this case */
 
1382
                        if ((*supported) & BRASERO_BURN_FLAG_RAW) {
 
1383
                                (*supported) &= ~BRASERO_BURN_FLAG_DAO;
 
1384
                                (*compulsory) &= ~BRASERO_BURN_FLAG_DAO;
 
1385
                                (*compulsory) |= BRASERO_BURN_FLAG_RAW;
 
1386
                        }
 
1387
                        else
 
1388
                                return BRASERO_BURN_NOT_SUPPORTED;
 
1389
                }
 
1390
                else
 
1391
                        (*supported) &= ~BRASERO_BURN_FLAG_RAW;
 
1392
        }
 
1393
        
 
1394
        return BRASERO_BURN_OK;
 
1395
}
 
1396
 
1361
1397
static BraseroPluginIOFlag
1362
1398
brasero_caps_get_flags (BraseroCaps *caps,
1363
1399
                        gboolean ignore_plugin_errors,
1392
1428
 
1393
1429
                if (brasero_track_type_get_has_medium (&caps->type)) {
1394
1430
                        BraseroBurnFlag tmp;
 
1431
                        BraseroBurnResult result;
1395
1432
 
1396
1433
                        brasero_caps_link_get_record_flags (link,
1397
1434
                                                            ignore_plugin_errors,
1405
1442
                        tmp = session_flags & BRASERO_PLUGIN_BURN_FLAG_MASK;
1406
1443
                        if ((tmp & rec_supported) != tmp)
1407
1444
                                continue;
 
1445
 
 
1446
                        /* This is the recording plugin, check its input as
 
1447
                         * some flags depend on it. */
 
1448
                        result = brasero_caps_set_flags_from_recorder_input (&link->caps->type,
 
1449
                                                                             &rec_supported,
 
1450
                                                                             &rec_compulsory);
 
1451
                        if (result != BRASERO_BURN_OK)
 
1452
                                continue;
1408
1453
                }
1409
1454
 
1410
1455
                if (brasero_track_type_get_has_data (&link->caps->type)) {
1460
1505
                if (io_flags == BRASERO_PLUGIN_IO_NONE)
1461
1506
                        continue;
1462
1507
 
 
1508
                (*compulsory) &= rec_compulsory;
1463
1509
                retval |= (io_flags & flags);
1464
 
                (*compulsory) &= rec_compulsory;
1465
1510
                (*supported) |= data_supported|rec_supported;
1466
1511
        }
1467
1512
 
1579
1624
                return BRASERO_BURN_NOT_SUPPORTED;
1580
1625
        }
1581
1626
 
1582
 
        if (brasero_track_type_get_has_image (input)) {
1583
 
                BraseroImageFormat format;
 
1627
        /* NOTE: DO NOT TEST the input image here. What should be tested is the
 
1628
         * type of the input right before the burner plugin. See:
 
1629
         * brasero_burn_caps_set_flags_from_recorder_input())
 
1630
         * For example in the following situation: AUDIO => CUE => BURNER the
 
1631
         * DAO flag would not be set otherwise. */
1584
1632
 
1585
 
                format = brasero_track_type_get_image_format (input);
1586
 
                if (format == BRASERO_IMAGE_FORMAT_CUE
1587
 
                ||  format == BRASERO_IMAGE_FORMAT_CDRDAO) {
1588
 
                        if (supported_flags & BRASERO_BURN_FLAG_DAO)
1589
 
                                compulsory_flags |= BRASERO_BURN_FLAG_DAO;
1590
 
                        else
1591
 
                                return BRASERO_BURN_NOT_SUPPORTED;
1592
 
                }
1593
 
                else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
1594
 
                        /* RAW write mode should (must) only be used in this case */
1595
 
                        if (supported_flags & BRASERO_BURN_FLAG_RAW) {
1596
 
                                supported_flags &= ~BRASERO_BURN_FLAG_DAO;
1597
 
                                compulsory_flags &= ~BRASERO_BURN_FLAG_DAO;
1598
 
                                compulsory_flags |= BRASERO_BURN_FLAG_RAW;
1599
 
                        }
1600
 
                        else
1601
 
                                return BRASERO_BURN_NOT_SUPPORTED;
1602
 
                }
1603
 
                else
1604
 
                        supported_flags &= ~BRASERO_BURN_FLAG_RAW;
1605
 
        }
1606
 
        else if (brasero_track_type_get_has_stream (input)) {
 
1633
        if (brasero_track_type_get_has_stream (input)) {
1607
1634
                BraseroStreamFormat format;
1608
1635
 
1609
1636
                format = brasero_track_type_get_stream_format (input);
1610
 
                if (!(format & BRASERO_METADATA_INFO)
1611
 
                &&   BRASERO_STREAM_FORMAT_VIDEO (format)) {
 
1637
                if (format & BRASERO_METADATA_INFO) {
1612
1638
                        /* In this case, DAO is compulsory if we want to write CD-TEXT */
1613
1639
                        if (supported_flags & BRASERO_BURN_FLAG_DAO)
1614
1640
                                compulsory_flags |= BRASERO_BURN_FLAG_DAO;
1622
1648
                compulsory_flags &= ~BRASERO_BURN_FLAG_RAW;
1623
1649
                supported_flags &= ~BRASERO_BURN_FLAG_RAW;
1624
1650
        }
1625
 
 
 
1651
        
1626
1652
        if (io_flags & BRASERO_PLUGIN_IO_ACCEPT_PIPE) {
1627
1653
                supported_flags |= BRASERO_BURN_FLAG_NO_TMP_FILES;
1628
1654
 
1965
1991
         * until the disc is inserted which it is not at the
1966
1992
         * moment */
1967
1993
        (*supported_ret) |= (BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE|
1968
 
                                         BRASERO_BURN_FLAG_FAST_BLANK);
 
1994
                             BRASERO_BURN_FLAG_FAST_BLANK);
1969
1995
 
1970
1996
        if (brasero_track_type_get_medium_type (&input) & BRASERO_MEDIUM_HAS_AUDIO) {
1971
1997
                /* This is a special case for audio discs.