Support for new file formats

Lukáš Lalinský lalinsky at
Fri Feb 22 11:36:46 UTC 2013

Matroska is a very complex format. I'd probably focus on a specific
use-case (e.g. only WebM), rather than the Matroska container in
general. It should be much easier to reach the end that way.

For a new format, you generally have to implement a TagLib::File,
TagLib::Tag and TagLib::AudioProperties subclass.

For Matroska in general, I think it's going to be a little more
complicated, because there can be multiple "files" with multiple tags
in one real file, so I'm not sure how to best structure it.

For Ogg, we have base clases for the container format itself and then
subclasses that implement formats like Ogg Vorbis, Ogg FLAC, etc.
Matroska support should probably follow a similar route.

Yes, no external dependencies is an important rule, it makes TagLib
usable on many platforms.

Please follow the style of the other TagLib code (e.g. 2 space indent,
no space after if/for, etc.). It's not a very common formatting, so
you might need to update your editor settings, but it will be easier
to review and include it.

You should also write unit tests, so that we can test the code
automatically in the future.

I don't think we have a 64-bit implementation of htonl/ntohl, but in
general, you should use ByteVector::toLongLong() to read integers in
the correct byte order.

Good luck! :)


On Thu, Feb 21, 2013 at 5:10 PM, Sebastian Rachuj <rachus at> wrote:
> Hello,
> Currently I was thinking about adding elementary support for matroska (as requested by someone) to taglib. I'm not sure if I'm capable of doing this, but I will give it a try (don't be angry if I fail, please). But therefore I would like to ask you a few questions:
> Is it enough to create a TagLib::MKV::File class that extends TagLib::File or are there more interfaces, that I have to take care of? Are there any rules for the code? (like no other dependencies, which I think is an important feature of taglib)
> Do you have a htonl/ntohl implementation for 64 bit integers (offset_t) by chance?
> As I already said, I'm not sure if I can achieve anything, but I would like to.
> Regards
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at

More information about the taglib-devel mailing list