~ubuntu-branches/debian/wheezy/brasero/wheezy

« back to all changes in this revision

Viewing changes to libbrasero-media/scsi-read-cd.c

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Pedro Fragoso, Luca Bruno, Josselin Mouette, Emilio Pozuelo Monfort
  • Date: 2009-06-24 18:59:46 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624185946-iyxkgf3gjptir5y3
Tags: 2.26.2-1
[ Pedro Fragoso ]
* Add myself to Maintainer field
  - Thanks Ondřej Surý
* New upstream version (Closes: #528945)
  - Split package into brasero, libbrasero-media0 and libbrasero-dev
  - Add Replaces to libbrasero-media0
  - Bump libgtk to 2.14.0
  - Remove libnotify Build-dep
  - Add Build-dep libnautilus-extension-dev (>= 2.22.2)
    and install it.
  - Add Build-dep to libsm-dev
  - Add Build-dep on intltool
* Install omf files to prevent crash on Help
* Move gstreamer0.10-plugins-bad to Suggests, and add
  dvdauthor and vcdimager
* Recommends gvfs (Closes: #491827)
* Pass --disable-scrollkeeper in DEB_CONFIGURE_EXTRA_FLAGS
* debian/patches/007-fix-gnome-doc-utils-path.patch:
  - Removed, not needed anymore
* debian/patches/008-fix-volume-identifier-crash.patch:
  - Removed, merged upstream
* debian/patches/011_nautilus_menu_move.patch:
 - Move CD/DVD Creator Menu to Acessories, taken from Ubuntu

[ Luca Bruno ]
* debian/control.in:
  - Add Build-Depend gtk-doc-tools 1.9.
* debian/patches/006-fix-libdvdcss.patch:
  - Removed as applied upstream.

[ Josselin Mouette ]
* New upstream release.
* Update build-dependencies.
* Move the translations and data to a new brasero-common package.
* Rewrite the descriptions.
* Add -dev depends to the development package.
* Remove inappropriate recommends in the library package.
* Let’s not forget dvd+rw-tools so that we can write DVDs too.
* Rework dependencies accordingly.
* Put the nautilus extension in brasero.
* Conflict against nautilus-cd-burner to avoid having two burning 
  extensions.
* Include clean-la.mk and gnome-version.mk; build-depend on 
  gnome-pkg-tools 0.7.
* Don’t run dh_makeshlibs on brasero and libbrasero-plugins.
* 011_nautilus_menu_move.patch: add NoDisplay=true, this icon is 
  duplicating existing functionality (brasero icon in sound&video 
  menu, and nautilus autorun).
* Update list of copyright holders.

[ Emilio Pozuelo Monfort ]
* debian/copyright: updated.

[ Josselin Mouette ]
* copyright: improve indentation, and point to versioned LGPL.
* 090_relibtoolize.patch: add a relibtoolization patch to avoid the 
  rpath crap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 
2
/*
 
3
 * Libbrasero-media
 
4
 * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr>
 
5
 *
 
6
 * Libbrasero-media is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * The Libbrasero-media authors hereby grant permission for non-GPL compatible
 
12
 * GStreamer plugins to be used and distributed together with GStreamer
 
13
 * and Libbrasero-media. This permission is above and beyond the permissions granted
 
14
 * by the GPL license by which Libbrasero-media is covered. If you modify this code
 
15
 * you may extend this exception to your version of the code, but you are not
 
16
 * obligated to do so. If you do not wish to do so, delete this exception
 
17
 * statement from your version.
 
18
 * 
 
19
 * Libbrasero-media is distributed in the hope that it will be useful,
 
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
22
 * GNU Library General Public License for more details.
 
23
 * 
 
24
 * You should have received a copy of the GNU General Public License
 
25
 * along with this program; if not, write to:
 
26
 *      The Free Software Foundation, Inc.,
 
27
 *      51 Franklin Street, Fifth Floor
 
28
 *      Boston, MA  02110-1301, USA.
 
29
 */
 
30
 
 
31
#ifdef HAVE_CONFIG_H
 
32
#  include <config.h>
 
33
#endif
 
34
 
 
35
#include <glib.h>
 
36
 
 
37
#include "scsi-error.h"
 
38
#include "scsi-utils.h"
 
39
#include "scsi-base.h"
 
40
#include "scsi-command.h"
 
41
#include "scsi-opcodes.h"
 
42
#include "scsi-read-cd.h"
 
43
 
 
44
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 
45
 
 
46
struct _BraseroReadCDCDB {
 
47
        uchar opcode;
 
48
 
 
49
        uchar rel_add           :1;
 
50
        uchar reserved1         :1;
 
51
        uchar sec_type          :3;
 
52
        uchar reserved0         :3;
 
53
 
 
54
        uchar start_lba         [4];
 
55
        uchar len               [3];
 
56
 
 
57
        uchar reserved2         :1;
 
58
        uchar error             :2;
 
59
        uchar edc               :1;
 
60
        uchar user_data         :1;
 
61
        uchar header            :2;
 
62
        uchar sync              :1;
 
63
 
 
64
        uchar subchannel        :3;
 
65
        uchar reserved3         :5;
 
66
 
 
67
        uchar ctl;
 
68
};
 
69
 
 
70
#else
 
71
 
 
72
struct _BraseroReadCDCDB {
 
73
        uchar opcode;
 
74
 
 
75
        uchar reserved0         :3;
 
76
        uchar sec_type          :3;
 
77
        uchar reserved1         :1;
 
78
        uchar rel_add           :1;
 
79
 
 
80
        uchar start_lba         [4];
 
81
        uchar len               [3];
 
82
 
 
83
        uchar sync              :1;
 
84
        uchar header            :2;
 
85
        uchar user_data         :1;
 
86
        uchar edc               :1;
 
87
        uchar error             :2;
 
88
        uchar reserved2         :1;
 
89
 
 
90
        uchar reserved3         :5;
 
91
        uchar subchannel        :3;
 
92
 
 
93
        uchar ctl;
 
94
};
 
95
 
 
96
#endif
 
97
 
 
98
typedef struct _BraseroReadCDCDB BraseroReadCDCDB;
 
99
 
 
100
BRASERO_SCSI_COMMAND_DEFINE (BraseroReadCDCDB,
 
101
                             READ_CD,
 
102
                             BRASERO_SCSI_READ);
 
103
 
 
104
BraseroScsiResult
 
105
brasero_mmc1_read_block (BraseroDeviceHandle *handle,
 
106
                         gboolean user_data,
 
107
                         BraseroScsiBlockType type,
 
108
                         BraseroScsiBlockHeader header,
 
109
                         BraseroScsiBlockSubChannel channel,
 
110
                         int start,
 
111
                         int size,
 
112
                         unsigned char *buffer,
 
113
                         int buffer_len,
 
114
                         BraseroScsiErrCode *error)
 
115
{
 
116
        BraseroReadCDCDB *cdb;
 
117
        BraseroScsiResult res;
 
118
 
 
119
        cdb = brasero_scsi_command_new (&info, handle);
 
120
        BRASERO_SET_32 (cdb->start_lba, start);
 
121
 
 
122
        /* NOTE: if we just want to test if block is readable len can be 0 */
 
123
        BRASERO_SET_24 (cdb->len, size);
 
124
 
 
125
        /* reladr should be O */
 
126
        /* no sync field included */
 
127
        cdb->sync = 0;
 
128
 
 
129
        /* sector type */
 
130
        cdb->sec_type = type;
 
131
 
 
132
        /* header ?*/
 
133
        cdb->header = header;
 
134
 
 
135
        /* returns user data ?*/
 
136
        cdb->user_data = user_data;
 
137
 
 
138
        /* no EDC */
 
139
        /* no error/C2 error */
 
140
 
 
141
        /* subchannel */
 
142
        cdb->subchannel = channel;
 
143
 
 
144
        if (buffer)
 
145
                memset (buffer, 0, buffer_len);
 
146
 
 
147
        res = brasero_scsi_command_issue_sync (cdb,
 
148
                                               buffer,
 
149
                                               buffer_len,
 
150
                                               error);
 
151
        brasero_scsi_command_free (cdb);
 
152
        return res;
 
153
}