-
Notifications
You must be signed in to change notification settings - Fork 351
Evi/typings #458
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
Evi/typings #458
Conversation
Resolved |
cc @bigmistqke if you want to review |
@@ -25,8 +25,8 @@ function decimalToHex(d: number | string, padding?: number | null) { | |||
} | |||
|
|||
class avcCSampleEntryBase extends VisualSampleEntry { | |||
declare avcC: avcCBox; | |||
declare avcCs: Array<avcCBox>; | |||
avcC: avcCBox | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure about this change, my reasoning is that the avcC is at some point undefined (same for most other boxes)
We seem to be checking if (this.avcC)
meaning the type can actually be undefined, so I'd say we should do this update, though I'm missing quite a lot of those in the commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 078e7c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking of dropping the latest commit and current work (unmerged) to merge this PR and resolve issues, then come back to it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why no | undefined typings are working?
This is probably due to strict: false
in the tsconfig. Maybe not a bad idea to set it to true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, only Found 1118 errors in 154 files.
haha
I might have time to work on that, I'll break this PR in more PRs so we can merge few things at least
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit has some memory implications: instead of having a shared method on the prototype, this will create a function for each box' instance.
Why do we need this change: bdf5e29 |
The previous API was allowing users to do: https://github.com/w3c/webcodecs/blob/446d831/samples/audio-video-player/mp4_pull_demuxer.js#L171-L179 This is now broken if I'm not mistaken |
This seems to run. Am I missing something? function _getDescription(descriptionBox: Box) {
const stream = new DataStream(undefined, 0, DataStream.BIG_ENDIAN);
descriptionBox.write(stream);
return new Uint8Array(stream.buffer, 8); // Remove the box header.
}
const avcc = new avcCBox();
avcc.SPS = [];
avcc.PPS = [];
console.log(_getDescription(avcc)); |
I've fixed most of the issues you've highlighted in this PR locally. I'll be closing this PR and the other ones you've opened. Once I've pushed my fixes, feel free to open again if the issues continue. |
Ahah ok 🫡 |
Description
Fixes a few bugs in the lib along typings please start reviewing after feat: fix onReady, onMoovStart and onSidx callbacks typing
I can't update the base of my PRs, unsure why