Lines Matching refs:stream

371   function Bitstream(stream) {  argument
372 this.stream = stream;
378 result = new Bitstream(this.stream.copy());
384 return 8 * this.stream.offset + this.bitPosition;
388 return this.stream.available((bits + 8 - this.bitPosition) / 8);
394 this.stream.advance(pos >> 3);
401 this.stream.rewind(Math.abs(pos >> 3));
418 return this.stream.advance(1);
429 a = ((this.stream.peekUInt8() << this.bitPosition) & 0xff) >>> (8 - bits);
431 a = ((this.stream.peekUInt16() << this.bitPosition) & 0xffff) >>> (16 - bits);
433 a = ((this.stream.peekUInt24() << this.bitPosition) & 0xffffff) >>> (24 - bits);
435 a = (this.stream.peekUInt32() << this.bitPosition) >>> (32 - bits);
437 a0 = this.stream.peekUInt8(0) * 0x0100000000;
438 a1 = this.stream.peekUInt8(1) << 24 >>> 0;
439 a2 = this.stream.peekUInt8(2) << 16;
440 a3 = this.stream.peekUInt8(3) << 8;
441 a4 = this.stream.peekUInt8(4);
470 a = ((this.stream.peekUInt8() << this.bitPosition) & 0xff) >>> (8 - bits);
472 a = ((this.stream.peekUInt16() << this.bitPosition) & 0xffff) >>> (16 - bits);
474 a = ((this.stream.peekUInt24() << this.bitPosition) & 0xffffff) >>> (24 - bits);
476 a = (this.stream.peekUInt32() << this.bitPosition) >>> (32 - bits);
478 a0 = this.stream.peekUInt8(0) * 0x0100000000;
479 a1 = this.stream.peekUInt8(1) << 24 >>> 0;
480 a2 = this.stream.peekUInt8(2) << 16;
481 a3 = this.stream.peekUInt8(3) << 8;
482 a4 = this.stream.peekUInt8(4);
512 a = (this.stream.peekUInt8(0)) >>> this.bitPosition;
514 a |= (this.stream.peekUInt8(1)) << (8 - this.bitPosition);
517 a |= (this.stream.peekUInt8(2)) << (16 - this.bitPosition);
520 a += (this.stream.peekUInt8(3)) << (24 - this.bitPosition) >>> 0;
523 a += (this.stream.peekUInt8(4)) * Math.pow(2, 32 - this.bitPosition);
554 a = (this.stream.peekUInt8(0)) >>> this.bitPosition;
556 a |= (this.stream.peekUInt8(1)) << (8 - this.bitPosition);
559 a |= (this.stream.peekUInt8(2)) << (16 - this.bitPosition);
562 a += (this.stream.peekUInt8(3)) << (24 - this.bitPosition) >>> 0;
565 a += (this.stream.peekUInt8(4)) * Math.pow(2, 32 - this.bitPosition);
1384 this.stream = new Stream(list);
1385 this.bitstream = new Bitstream(this.stream);
1452 this.stream.seek(seekPoint.offset);
1492 var chunkSize, i, littleEndian, output, samples, stream, _i, _j, _k, _l, _m, _n;
1493 stream = this.stream;
1495 chunkSize = Math.min(4096, stream.remainingBytes());
1505 output[i] = stream.readFloat32(littleEndian);
1511 output[i] = stream.readFloat64(littleEndian);
1522 output[i] = stream.readInt8();
1528 output[i] = stream.readInt16(littleEndian);
1534 output[i] = stream.readInt24(littleEndian);
1540 output[i] = stream.readInt32(littleEndian);
1614 var i, output, samples, stream, table, _i;
1615 stream = this.stream, table = this.table;
1616 samples = Math.min(4096, this.stream.remainingBytes());
1622 output[i] = table[stream.readUInt8()];
1656 this.stream = new Stream(list);
1738 var e, format, offset, stream, _i, _len;
1739 stream = Stream.fromBuffer(buffer);
1742 offset = stream.offset;
1744 if (format.probe(stream)) {
1750 stream.seek(offset);
1785 if (!this.readStart && this.stream.available(12)) {
1786 if (this.stream.readString(4) !== 'FORM') {
1789 this.fileSize = this.stream.readUInt32();
1790 this.fileType = this.stream.readString(4);
1796 while (this.stream.available(1)) {
1797 if (!this.readHeaders && this.stream.available(8)) {
1798 this.type = this.stream.readString(4);
1799 this.len = this.stream.readUInt32();
1803 if (!this.stream.available(this.len)) {
1808 channelsPerFrame: this.stream.readUInt16(),
1809 sampleCount: this.stream.readUInt32(),
1810 bitsPerChannel: this.stream.readUInt16(),
1811 sampleRate: this.stream.readFloat80(),
1818 format = this.stream.readString(4);
1827 this.stream.advance(this.len - 18);
1832 if (!(this.readSSNDHeader && this.stream.available(4))) {
1833 offset = this.stream.readUInt32();
1834 this.stream.advance(4);
1835 this.stream.advance(offset);
1838 buffer = this.stream.readSingleBuffer(this.len);
1844 if (!this.stream.available(this.len)) {
1847 this.stream.advance(this.len);
1893 if (!this.readHeader && this.stream.available(24)) {
1894 if (this.stream.readString(4) !== '.snd') {
1897 size = this.stream.readUInt32();
1898 dataSize = this.stream.readUInt32();
1899 encoding = this.stream.readUInt32();
1905 sampleRate: this.stream.readUInt32(),
1906 channelsPerFrame: this.stream.readUInt32(),
1921 while (this.stream.available(1)) {
1922 this.emit('data', this.stream.readSingleBuffer(this.stream.remainingBytes()));
1956 if (!this.format && this.stream.available(64)) {
1957 if (this.stream.readString(4) !== 'caff') {
1960 this.stream.advance(4);
1961 if (this.stream.readString(4) !== 'desc') {
1964 if (!(this.stream.readUInt32() === 0 && this.stream.readUInt32() === 32)) {
1968 this.format.sampleRate = this.stream.readFloat64();
1969 this.format.formatID = this.stream.readString(4);
1970 flags = this.stream.readUInt32();
1975 this.format.bytesPerPacket = this.stream.readUInt32();
1976 this.format.framesPerPacket = this.stream.readUInt32();
1977 this.format.channelsPerFrame = this.stream.readUInt32();
1978 this.format.bitsPerChannel = this.stream.readUInt32();
1981 while (this.stream.available(1)) {
1984 type: this.stream.readString(4),
1985 oversize: this.stream.readUInt32() !== 0,
1986 size: this.stream.readUInt32()
1994 if (this.stream.available(this.headerCache.size)) {
1996 offset = this.stream.offset + this.headerCache.size;
1997 if (cookie = M4ADemuxer.readEsds(this.stream)) {
2000 this.stream.seek(offset);
2002 buffer = this.stream.readBuffer(this.headerCache.size);
2009 if (this.stream.available(this.headerCache.size)) {
2010 if (this.stream.readUInt32() !== 0) {
2013 this.numPackets = this.stream.readUInt32();
2014 if (this.stream.readUInt32() !== 0) {
2017 this.numFrames = this.stream.readUInt32();
2018 this.primingFrames = this.stream.readUInt32();
2019 this.remainderFrames = this.stream.readUInt32();
2026 byteOffset += this.format.bytesPerPacket || M4ADemuxer.readDescrLen(this.stream);
2027 sampleOffset += this.format.framesPerPacket || M4ADemuxer.readDescrLen(this.stream);
2033 entries = this.stream.readUInt32();
2036 key = this.stream.readString(null);
2037 value = this.stream.readString(null);
2045 this.stream.advance(4);
2053 buffer = this.stream.readSingleBuffer(this.headerCache.size);
2061 if (this.stream.available(this.headerCache.size)) {
2062 this.stream.advance(this.headerCache.size);
2136 while (this.stream.available(1) && !this["break"]) {
2138 if (!this.stream.available(8)) {
2141 this.len = this.stream.readUInt32() - 8;
2142 this.type = this.stream.readString(4);
2147 this.offsets.push(this.stream.offset + this.len);
2153 if (!(this.stream.available(this.len) || path === 'mdat')) {
2163 if (!this.stream.available(this.len)) {
2166 this.stream.advance(this.len);
2168 while (this.stream.offset >= this.offsets[this.offsets.length - 1]) {
2182 if (_ref = this.stream.readString(4), __indexOf.call(TYPES, _ref) < 0) {
2185 return this.stream.advance(this.len - 4);
2194 this.stream.advance(4);
2195 this.stream.advance(8);
2196 this.track.id = this.stream.readUInt32();
2197 return this.stream.advance(this.len - 16);
2201 this.stream.advance(4);
2202 this.stream.advance(4);
2203 this.track.type = this.stream.readString(4);
2204 this.stream.advance(12);
2205 return this.stream.advance(this.len - 24);
2209 this.stream.advance(4);
2210 this.stream.advance(8);
2211 this.track.timeScale = this.stream.readUInt32();
2212 this.track.duration = this.stream.readUInt32();
2213 return this.stream.advance(4);
2227 this.stream.advance(4);
2228 numEntries = this.stream.readUInt32();
2230 return this.stream.advance(this.len - 8);
2235 this.stream.advance(4);
2237 format.formatID = this.stream.readString(4);
2238 this.stream.advance(6);
2239 this.stream.advance(2);
2240 version = this.stream.readUInt16();
2241 this.stream.advance(6);
2242 format.channelsPerFrame = this.stream.readUInt16();
2243 format.bitsPerChannel = this.stream.readUInt16();
2244 this.stream.advance(4);
2245 format.sampleRate = this.stream.readUInt16();
2246 this.stream.advance(2);
2248 format.framesPerPacket = this.stream.readUInt32();
2249 this.stream.advance(4);
2250 format.bytesPerFrame = this.stream.readUInt32();
2251 this.stream.advance(4);
2266 this.stream.advance(4);
2267 return this.track.cookie = this.stream.readBuffer(this.len - 4);
2272 offset = this.stream.offset + this.len;
2273 this.track.cookie = M4ADemuxer.readEsds(this.stream);
2274 return this.stream.seek(offset);
2278 return this.track.format.littleEndian = !!this.stream.readUInt16();
2281 M4ADemuxer.readDescrLen = function(stream) { argument
2286 c = stream.readUInt8();
2295 M4ADemuxer.readEsds = function(stream) { argument
2297 stream.advance(4);
2298 tag = stream.readUInt8();
2299 len = M4ADemuxer.readDescrLen(stream);
2301 stream.advance(2);
2302 flags = stream.readUInt8();
2304 stream.advance(2);
2307 stream.advance(stream.readUInt8());
2310 stream.advance(2);
2313 stream.advance(2);
2315 tag = stream.readUInt8();
2316 len = M4ADemuxer.readDescrLen(stream);
2318 codec_id = stream.readUInt8();
2319 stream.advance(1);
2320 stream.advance(3);
2321 stream.advance(4);
2322 stream.advance(4);
2323 tag = stream.readUInt8();
2324 len = M4ADemuxer.readDescrLen(stream);
2326 return stream.readBuffer(len);
2334 this.stream.advance(4);
2335 entries = this.stream.readUInt32();
2339 count: this.stream.readUInt32(),
2340 duration: this.stream.readUInt32()
2348 this.stream.advance(4);
2349 entries = this.stream.readUInt32();
2353 first: this.stream.readUInt32(),
2354 count: this.stream.readUInt32(),
2355 id: this.stream.readUInt32()
2363 this.stream.advance(4);
2364 this.track.sampleSize = this.stream.readUInt32();
2365 entries = this.stream.readUInt32();
2369 this.track.sampleSizes[i] = this.stream.readUInt32();
2377 this.stream.advance(4);
2378 entries = this.stream.readUInt32();
2381 this.track.chunkOffsets[i] = this.stream.readUInt32();
2391 this.track.chapterTracks[i] = this.stream.readUInt32();
2439 this.stream.seek(this.mdatOffset - 8);
2466 this.mdatOffset = this.stream.offset;
2469 bytes = Math.min(this.stream.remainingBytes(), this.len);
2470 this.stream.advance(bytes);
2486 this.stream.seek(this.mdatOffset);
2490 if (!this.stream.available(offset - this.stream.offset)) {
2494 this.stream.seek(offset);
2500 if (!this.stream.available(length + size)) {
2524 this.emit('data', this.stream.readBuffer(length));
2552 if (!this.stream.available(point.position - this.stream.offset + 32)) {
2555 this.stream.seek(point.position);
2556 len = this.stream.readUInt16();
2558 if (!this.stream.available(len)) {
2562 bom = this.stream.peekUInt16();
2564 title = this.stream.readString(len, 'utf16-bom');
2568 title = this.stream.readString(len, 'utf8');
2583 return this.stream.advance(4);
2592 this.stream.advance(8);
2599 return this.metadata[field] = this.stream.readString(this.len, 'utf8');
2659 return this.metadata[field] = this.stream.readBuffer(this.len);
2665 return this.metadata[field] = genres[this.stream.readUInt16() - 1];
2669 return this.metadata[field] = this.stream.readUInt16();
2674 rating = this.stream.readUInt8();
2679 this.stream.advance(2);
2680 this.metadata[field] = this.stream.readUInt16() + ' of ' + this.stream.readUInt16();
2681 return this.stream.advance(this.len - 6);
2689 return this.metadata[field] = this.stream.readUInt8() === 1;
2736 if (!this.readStart && this.stream.available(12)) {
2737 if (this.stream.readString(4) !== 'RIFF') {
2740 this.fileSize = this.stream.readUInt32(true);
2742 if (this.stream.readString(4) !== 'WAVE') {
2746 while (this.stream.available(1)) {
2747 if (!this.readHeaders && this.stream.available(8)) {
2748 this.type = this.stream.readString(4);
2749 this.len = this.stream.readUInt32(true);
2753 encoding = this.stream.readUInt16(true);
2761 channelsPerFrame: this.stream.readUInt16(true),
2762 sampleRate: this.stream.readUInt32(true),
2765 this.stream.advance(4);
2766 this.stream.advance(2);
2767 this.format.bitsPerChannel = this.stream.readUInt16(true);
2770 this.stream.advance(this.len - 16);
2778 buffer = this.stream.readSingleBuffer(this.len);
2784 if (!this.stream.available(this.len)) {
2787 this.stream.advance(this.len);