Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解码器初始化后调用报错 #5

Open
ligengmi opened this issue Oct 25, 2022 · 0 comments
Open

解码器初始化后调用报错 #5

ligengmi opened this issue Oct 25, 2022 · 0 comments

Comments

@ligengmi
Copy link

playvideo() {
let token =
"base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1";
let version = "100.1.0";
var decoderMod = null;
decoderMod = new MissileDecoderModule.CMissileDecoder(token, version);
console.log(decoderMod.initDecoder);
decoderMod.initFinish = function () {
console.log("init Finshed");
var bind_ret = decoderMod.bindCallback(function (
y,
u,
v,
stride_y,
stride_u,
stride_v,
width,
height,
pts,
pix_name
) {});
let ws = new WebSocket(this.H264url);
let rtp = new Rtp();
ws.binaryType = "arraybuffer";
ws.onopen = function (evt) {
ws.send("playtest");
};
var ptsIdx = 0;
ws.onmessage = function (e) {
let arrh265 = rtp.parse(e.data);
var rawParserObj = new MissileDecoderModule.CRawParser();
rawParserObj.appendStreamRet(arrh265.data);
let nalBuf = rawParserObj.nextNalu(); // nal
console.log(decoderMod);
decoderMod.decodeNalu(nalBuf, ptsIdx);
ptsIdx++;
};
console.log("bind ret ", bind_ret);
};
decoderMod.initDecoder();
decoderMod.release();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant