[Matroska-devel] LibMatroska example question
amueller at itec.uni-klu.ac.at
Thu Jan 26 11:30:51 CET 2006
I tried to adapt my muxing application to use pointers instead of the
& in the variable definition, but i ran into troubles again.
I read parts of the source code of VLC (which does not contain a
matroska multiplexer) and mkvmerge. MkVMerge is a great application,
but it is really hard to understand because of all the beatiful
separation of functionallity into seperate modules.
Doesn't there exist a simple sample application that only takes two
files (audio and video) and multiplexes them into one matroska file.
This programm should not have all the bells and whistles that e.g
MkvMerge has, because of learning how to se the pure multiplexing in
In my application I want to save two (or later more) streams
interleaved (one video, one audio, one video, ...) into a matroska
file. So I have a class MKIO that has a method
bool writeFrame(Frame* frm, int trackId);
I want to have all the necessary variables defined as class variables
(KaxSegment, KaxTracks, ...) because I instantiate the Matroska
Header on first writeFrame and then on each additional call of this
method I "add" a Frame to the container (KaxCluster->AddFrame). So I
have to have access to some variables, that need to keep their values
throughout method calls.
I follow this list quite some time and I notized that several people
would need some simple sample applications for matroska with quite
some good documentation (also inline code documentatio).
I want to use Matroska as the main container format for our
multimedia framework, because I think it offers a lot of features
that allow us to store additional intormation (even as a kind of
metadata serialization of our internal metadata structure).
thanks and regards,
Am 25.01.2006 um 19:00 schrieb Steve Lhomme:
> Hi Armin,
> Using global variables is usually a bad idea, even if that's the
> easiest case. Your program won't be thread-safe and reentrant. In C+
> + you usually offer a method in your class to give access to this
> variable, like :
> KaxTracks & GetTracks();
> const KaxTracks & GetTracks() const;
> & will give you a reference to the object. That's like a pointer,
> but you don't have to check if it's NULL. If you are not sure about
> this syntax, just use pointers...
> I hope it helped.
> Armin Müller wrote:
>> i write a multiplexing module for our multimedia framework at
>> So i took the example code for multiplexing from the libmatroska
>> package (Linux).
>> I have a class-method that does the multiplexing., this is where I
>> KaxTracks & MyTracks = GetChild<KaxTracks>(FileSegment); /*
>> Filesegment is a KaxSegment */
>> now I need to have the variable MyTracks globally in my class
>> available, so I have to declare it outside of this function.
>> I tried:
>> KaxTracks MyTracks;
>> &MyTracks = GetChild<KaxTracks>(FileSegment);
>> I also tried it without ampersand, but I don't understand this
>> Can anyone show me how to declare the variable (globally) and then
>> assign the return value of GetChild?
>> thanks and regards,
>> Matroska-devel mailing list
>> Matroska-devel at lists.matroska.org
>> Read Matroska-Devel on GMane: http://dir.gmane.org/
> robUx4 on blog <http://robux4.blogspot.com/>
> Matroska-devel mailing list
> Matroska-devel at lists.matroska.org
> Read Matroska-Devel on GMane: http://dir.gmane.org/
More information about the Matroska-devel