-
Notifications
You must be signed in to change notification settings - Fork 47
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
use standard types instead of custom ones #111
Comments
@robUx4 Pinging for your input, mostly wrt. to the C-style include file. |
If we're OK with API breakage, we can remove the old types altogether. With #107 there's already some code that may have to be conditionally compiled between libebml 1.x and 2.x. So we can also remove them IMO.
Not AFAIK. The VLC module using libebml/libmatroska is in C++.
No
We don't, but they are supposed to be compatible anyway. |
According to this comment there are only three programs packaged in Debian that use the libraries: VLC, MKVToolNix and gerbera. MKVToolNix had been a heavy user of the custom types but has since been converted to using all standard types. gerbera has exactly two occurrences (1, 2) of the custom types that I can see. Both are trivial to fix. The first occurrence has to be fixed due to the breaking change of the return type of VLC uses the types extensively in all of their Matroska code, but those look easy enough to convert. All in all we should probably keep them around for the time being but deprecate them. Then work on replacing them in gerbera & VLC first. |
I'll take care of that when we switch to 2.x libebml/libmatroska. It shouldn't be a problem. |
since gerbera was mentioned, its matroska handling leaks memory. I had a PR that fixed it: gerbera/gerbera#2280 but upstream is convinced the actual bug is in libebml. Since libebml is C++14 now, would it make sense to make use of std::shared_ptr for 2.0? gerbera and mkvtoolnix are C++17 and VLC is c++14 (I think?). edit: libebml_t.h should go away IMO. There are no C users. AFAIK they use whatever libavX provides them. edit2: speaking of libavX, reminds me of this little difference: gerbera/gerbera#2155 |
Fixed by #121 or is there anything left ? |
There are still a couple of places left where the standard types are used without the
For consistency's sake those should be changed, too. Other than these places I haven't found anything else, including in libMatroska. |
Well, that and we could discuss removing Similar argument for removing the Or at least changing all of our sources to the underlying types & only keeping the type aliases around as a backwards-compatibility thing. |
We should try to move to standard usage of the vector as well. I think it should be possible to have a default clone constructor for all classes. The tricky one is EbmlMaster which currently stores pointer of elements it holds. As said above, using |
I'd love for the library to completely remove the manual memory handling & using |
Changes API, no? |
It sure does, but we're already changing the API quite a bit with all the other changes. I just think that this would be a really big step in the right direction of using proper modern memory management that it's worth it. |
For the record I found some more (more or less) active projects using libebml/libmatroska:
|
Let's have an issue focussed on the upcoming change to using standard types (e.g.
std::uint32_t
) instead of our custom ones (e.g.uint32
).There's an older PR, #86, which does a lot of what I'd like to see, but it's somewhat controversial. The points I've seen there & in other places are:
(u)int(8|16|32|64)
tostd::(u)int(8|16|32|64)_t
(probably uncontroversial)size_t
tostd::size_t
(u)int(8|16|32|64)
types around for backwards compatibility but derive them from the official types instead of doing our own compiler- & OS-based#ifdef
thinglibebml_t.h
is suposed to be usable from C applications as well, leading to a couple of follow-up questions:stdint.h
)Anything else I've missed?
The text was updated successfully, but these errors were encountered: