mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Also check the lang in case insensitive
This commit is contained in:
parent
33e7f7384e
commit
2a9630258f
22658 changed files with 3562773 additions and 3562767 deletions
34
node_modules/mux.js/lib/tools/parse-tfdt.js
generated
vendored
34
node_modules/mux.js/lib/tools/parse-tfdt.js
generated
vendored
|
@ -1,17 +1,17 @@
|
|||
var toUnsigned = require('../utils/bin').toUnsigned;
|
||||
|
||||
var tfdt = function(data) {
|
||||
var result = {
|
||||
version: data[0],
|
||||
flags: new Uint8Array(data.subarray(1, 4)),
|
||||
baseMediaDecodeTime: toUnsigned(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7])
|
||||
};
|
||||
if (result.version === 1) {
|
||||
result.baseMediaDecodeTime *= Math.pow(2, 32);
|
||||
result.baseMediaDecodeTime += toUnsigned(data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11]);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = tfdt;
|
||||
|
||||
var toUnsigned = require('../utils/bin').toUnsigned;
|
||||
|
||||
var tfdt = function(data) {
|
||||
var result = {
|
||||
version: data[0],
|
||||
flags: new Uint8Array(data.subarray(1, 4)),
|
||||
baseMediaDecodeTime: toUnsigned(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7])
|
||||
};
|
||||
if (result.version === 1) {
|
||||
result.baseMediaDecodeTime *= Math.pow(2, 32);
|
||||
result.baseMediaDecodeTime += toUnsigned(data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11]);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = tfdt;
|
||||
|
||||
|
|
98
node_modules/mux.js/lib/tools/parse-tfhd.js
generated
vendored
98
node_modules/mux.js/lib/tools/parse-tfhd.js
generated
vendored
|
@ -1,49 +1,49 @@
|
|||
var tfhd = function(data) {
|
||||
var
|
||||
view = new DataView(data.buffer, data.byteOffset, data.byteLength),
|
||||
result = {
|
||||
version: data[0],
|
||||
flags: new Uint8Array(data.subarray(1, 4)),
|
||||
trackId: view.getUint32(4)
|
||||
},
|
||||
baseDataOffsetPresent = result.flags[2] & 0x01,
|
||||
sampleDescriptionIndexPresent = result.flags[2] & 0x02,
|
||||
defaultSampleDurationPresent = result.flags[2] & 0x08,
|
||||
defaultSampleSizePresent = result.flags[2] & 0x10,
|
||||
defaultSampleFlagsPresent = result.flags[2] & 0x20,
|
||||
durationIsEmpty = result.flags[0] & 0x010000,
|
||||
defaultBaseIsMoof = result.flags[0] & 0x020000,
|
||||
i;
|
||||
|
||||
i = 8;
|
||||
if (baseDataOffsetPresent) {
|
||||
i += 4; // truncate top 4 bytes
|
||||
// FIXME: should we read the full 64 bits?
|
||||
result.baseDataOffset = view.getUint32(12);
|
||||
i += 4;
|
||||
}
|
||||
if (sampleDescriptionIndexPresent) {
|
||||
result.sampleDescriptionIndex = view.getUint32(i);
|
||||
i += 4;
|
||||
}
|
||||
if (defaultSampleDurationPresent) {
|
||||
result.defaultSampleDuration = view.getUint32(i);
|
||||
i += 4;
|
||||
}
|
||||
if (defaultSampleSizePresent) {
|
||||
result.defaultSampleSize = view.getUint32(i);
|
||||
i += 4;
|
||||
}
|
||||
if (defaultSampleFlagsPresent) {
|
||||
result.defaultSampleFlags = view.getUint32(i);
|
||||
}
|
||||
if (durationIsEmpty) {
|
||||
result.durationIsEmpty = true;
|
||||
}
|
||||
if (!baseDataOffsetPresent && defaultBaseIsMoof) {
|
||||
result.baseDataOffsetIsMoof = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = tfhd;
|
||||
var tfhd = function(data) {
|
||||
var
|
||||
view = new DataView(data.buffer, data.byteOffset, data.byteLength),
|
||||
result = {
|
||||
version: data[0],
|
||||
flags: new Uint8Array(data.subarray(1, 4)),
|
||||
trackId: view.getUint32(4)
|
||||
},
|
||||
baseDataOffsetPresent = result.flags[2] & 0x01,
|
||||
sampleDescriptionIndexPresent = result.flags[2] & 0x02,
|
||||
defaultSampleDurationPresent = result.flags[2] & 0x08,
|
||||
defaultSampleSizePresent = result.flags[2] & 0x10,
|
||||
defaultSampleFlagsPresent = result.flags[2] & 0x20,
|
||||
durationIsEmpty = result.flags[0] & 0x010000,
|
||||
defaultBaseIsMoof = result.flags[0] & 0x020000,
|
||||
i;
|
||||
|
||||
i = 8;
|
||||
if (baseDataOffsetPresent) {
|
||||
i += 4; // truncate top 4 bytes
|
||||
// FIXME: should we read the full 64 bits?
|
||||
result.baseDataOffset = view.getUint32(12);
|
||||
i += 4;
|
||||
}
|
||||
if (sampleDescriptionIndexPresent) {
|
||||
result.sampleDescriptionIndex = view.getUint32(i);
|
||||
i += 4;
|
||||
}
|
||||
if (defaultSampleDurationPresent) {
|
||||
result.defaultSampleDuration = view.getUint32(i);
|
||||
i += 4;
|
||||
}
|
||||
if (defaultSampleSizePresent) {
|
||||
result.defaultSampleSize = view.getUint32(i);
|
||||
i += 4;
|
||||
}
|
||||
if (defaultSampleFlagsPresent) {
|
||||
result.defaultSampleFlags = view.getUint32(i);
|
||||
}
|
||||
if (durationIsEmpty) {
|
||||
result.durationIsEmpty = true;
|
||||
}
|
||||
if (!baseDataOffsetPresent && defaultBaseIsMoof) {
|
||||
result.baseDataOffsetIsMoof = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = tfhd;
|
||||
|
|
164
node_modules/mux.js/lib/tools/parse-trun.js
generated
vendored
164
node_modules/mux.js/lib/tools/parse-trun.js
generated
vendored
|
@ -1,82 +1,82 @@
|
|||
var parseSampleFlags = require('./parse-sample-flags.js');
|
||||
|
||||
var trun = function(data) {
|
||||
var
|
||||
result = {
|
||||
version: data[0],
|
||||
flags: new Uint8Array(data.subarray(1, 4)),
|
||||
samples: []
|
||||
},
|
||||
view = new DataView(data.buffer, data.byteOffset, data.byteLength),
|
||||
// Flag interpretation
|
||||
dataOffsetPresent = result.flags[2] & 0x01, // compare with 2nd byte of 0x1
|
||||
firstSampleFlagsPresent = result.flags[2] & 0x04, // compare with 2nd byte of 0x4
|
||||
sampleDurationPresent = result.flags[1] & 0x01, // compare with 2nd byte of 0x100
|
||||
sampleSizePresent = result.flags[1] & 0x02, // compare with 2nd byte of 0x200
|
||||
sampleFlagsPresent = result.flags[1] & 0x04, // compare with 2nd byte of 0x400
|
||||
sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08, // compare with 2nd byte of 0x800
|
||||
sampleCount = view.getUint32(4),
|
||||
offset = 8,
|
||||
sample;
|
||||
|
||||
if (dataOffsetPresent) {
|
||||
// 32 bit signed integer
|
||||
result.dataOffset = view.getInt32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
// Overrides the flags for the first sample only. The order of
|
||||
// optional values will be: duration, size, compositionTimeOffset
|
||||
if (firstSampleFlagsPresent && sampleCount) {
|
||||
sample = {
|
||||
flags: parseSampleFlags(data.subarray(offset, offset + 4))
|
||||
};
|
||||
offset += 4;
|
||||
if (sampleDurationPresent) {
|
||||
sample.duration = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleSizePresent) {
|
||||
sample.size = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleCompositionTimeOffsetPresent) {
|
||||
if (result.version === 1) {
|
||||
sample.compositionTimeOffset = view.getInt32(offset);
|
||||
} else {
|
||||
sample.compositionTimeOffset = view.getUint32(offset);
|
||||
}
|
||||
offset += 4;
|
||||
}
|
||||
result.samples.push(sample);
|
||||
sampleCount--;
|
||||
}
|
||||
|
||||
while (sampleCount--) {
|
||||
sample = {};
|
||||
if (sampleDurationPresent) {
|
||||
sample.duration = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleSizePresent) {
|
||||
sample.size = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleFlagsPresent) {
|
||||
sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleCompositionTimeOffsetPresent) {
|
||||
if (result.version === 1) {
|
||||
sample.compositionTimeOffset = view.getInt32(offset);
|
||||
} else {
|
||||
sample.compositionTimeOffset = view.getUint32(offset);
|
||||
}
|
||||
offset += 4;
|
||||
}
|
||||
result.samples.push(sample);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = trun;
|
||||
var parseSampleFlags = require('./parse-sample-flags.js');
|
||||
|
||||
var trun = function(data) {
|
||||
var
|
||||
result = {
|
||||
version: data[0],
|
||||
flags: new Uint8Array(data.subarray(1, 4)),
|
||||
samples: []
|
||||
},
|
||||
view = new DataView(data.buffer, data.byteOffset, data.byteLength),
|
||||
// Flag interpretation
|
||||
dataOffsetPresent = result.flags[2] & 0x01, // compare with 2nd byte of 0x1
|
||||
firstSampleFlagsPresent = result.flags[2] & 0x04, // compare with 2nd byte of 0x4
|
||||
sampleDurationPresent = result.flags[1] & 0x01, // compare with 2nd byte of 0x100
|
||||
sampleSizePresent = result.flags[1] & 0x02, // compare with 2nd byte of 0x200
|
||||
sampleFlagsPresent = result.flags[1] & 0x04, // compare with 2nd byte of 0x400
|
||||
sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08, // compare with 2nd byte of 0x800
|
||||
sampleCount = view.getUint32(4),
|
||||
offset = 8,
|
||||
sample;
|
||||
|
||||
if (dataOffsetPresent) {
|
||||
// 32 bit signed integer
|
||||
result.dataOffset = view.getInt32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
// Overrides the flags for the first sample only. The order of
|
||||
// optional values will be: duration, size, compositionTimeOffset
|
||||
if (firstSampleFlagsPresent && sampleCount) {
|
||||
sample = {
|
||||
flags: parseSampleFlags(data.subarray(offset, offset + 4))
|
||||
};
|
||||
offset += 4;
|
||||
if (sampleDurationPresent) {
|
||||
sample.duration = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleSizePresent) {
|
||||
sample.size = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleCompositionTimeOffsetPresent) {
|
||||
if (result.version === 1) {
|
||||
sample.compositionTimeOffset = view.getInt32(offset);
|
||||
} else {
|
||||
sample.compositionTimeOffset = view.getUint32(offset);
|
||||
}
|
||||
offset += 4;
|
||||
}
|
||||
result.samples.push(sample);
|
||||
sampleCount--;
|
||||
}
|
||||
|
||||
while (sampleCount--) {
|
||||
sample = {};
|
||||
if (sampleDurationPresent) {
|
||||
sample.duration = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleSizePresent) {
|
||||
sample.size = view.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleFlagsPresent) {
|
||||
sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));
|
||||
offset += 4;
|
||||
}
|
||||
if (sampleCompositionTimeOffsetPresent) {
|
||||
if (result.version === 1) {
|
||||
sample.compositionTimeOffset = view.getInt32(offset);
|
||||
} else {
|
||||
sample.compositionTimeOffset = view.getUint32(offset);
|
||||
}
|
||||
offset += 4;
|
||||
}
|
||||
result.samples.push(sample);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = trun;
|
||||
|
|
1038
node_modules/mux.js/lib/tools/ts-inspector.js
generated
vendored
1038
node_modules/mux.js/lib/tools/ts-inspector.js
generated
vendored
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue