1
/* libasf - An Advanced Systems Format media file parser
2
* Copyright (C) 2006-2007 Juho Vähä-Herttua
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
asf_byteio_getWLE(uint8_t *data)
28
for (i=1, ret=0; i>=0; i--) {
37
asf_byteio_getDWLE(uint8_t *data)
42
for (i=3, ret=0; i>=0; i--) {
51
asf_byteio_getQWLE(uint8_t *data)
56
for (i=7, ret=0; i>=0; i--) {
65
asf_byteio_getGUID(guid_t *guid, uint8_t *data)
67
guid->v1 = asf_byteio_getDWLE(data);
68
guid->v2 = asf_byteio_getWLE(data + 4);
69
guid->v3 = asf_byteio_getWLE(data + 6);
70
memcpy(guid->v4, data + 8, 8);
74
asf_byteio_get_string(uint16_t *string, uint16_t strlen, uint8_t *data)
78
for (i=0; i<strlen; i++) {
79
string[i] = asf_byteio_getWLE(data + i*2);
84
asf_byteio_readbyte(asf_stream_t *stream)
89
if ((ret = asf_byteio_read(&byte, 1, stream)) <= 0) {
90
return (ret == 0) ? ASF_ERROR_EOF : ASF_ERROR_IO;
97
asf_byteio_read(uint8_t *data, int size, asf_stream_t *stream)
102
return ASF_ERROR_INTERNAL;
105
while ((tmp = stream->read(stream->opaque, data+read, size-read)) > 0) {
113
return (tmp == 0) ? ASF_ERROR_EOF : ASF_ERROR_IO;