代码拉取完成,页面将自动刷新
import { writeLog } from "./Log.js";
import { PpsParser, SpsParser } from "./Parser.js";
export function resolveUnit(header, body) {
const t = header & 0x1f;
switch (t) {
case 1:
writeLog("NALU_TYPE_SLICE");
removeEBSP(body);
break;
case 2:
writeLog("NALU_TYPE_DPA");
break;
case 3:
writeLog("NALU_TYPE_DPB");
break;
case 4:
writeLog("NALU_TYPE_DPC");
break;
case 5:
writeLog("NALU_TYPE_IDR");
removeEBSP(body);
break;
case 6:
writeLog("NALU_TYPE_SEI");
break;
case 7:
writeLog("NALU_TYPE_SPS");
removeEBSP(body);
const sps = SpsParser(body);
console.log(sps);
break;
case 8:
writeLog("NALU_TYPE_PPS");
removeEBSP(body);
PpsParser(body);
break;
case 9:
writeLog("NALU_TYPE_AUD");
break;
}
}
function removeEBSP(payload) {
/**
* 0x 00 00 03 00
* 0x 00 00 03 01
* 0x 00 00 03 02
* 0x 00 00 03 03
*/
let index = 2,
removePosIndexs = [];
const length = payload.length;
while (index <= length - 1) {
if (payload[index] === 3) {
if (
payload[index - 2] === 0 &&
payload[index - 1] === 0 &&
(payload[index + 1] === 0 || payload[index + 1] === 1 || payload[index + 1] === 2 || payload[index + 1] === 3)
) {
} else {
}
}
index++;
}
if (removePosIndexs.length === 0) {
return payload;
} else {
const newPayload = new Uint8Array(length - removePosIndexs.length);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。