2 * Copyright (c) 2004, Marcus Overhagen
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
23 * OF THE POSSIBILITY OF SUCH DAMAGE.
25 #ifndef _MATROSKA_READER_H
26 #define _MATROSKA_READER_H
28 #include "ReaderPlugin.h"
29 #include "libMatroskaParser/StreamIO.h"
33 class mkvReader
: public Reader
39 virtual const char *Copyright();
41 virtual status_t
Sniff(int32
*streamCount
);
43 virtual void GetFileFormatInfo(media_file_format
*mff
);
45 virtual status_t
AllocateCookie(int32 streamNumber
, void **cookie
);
47 virtual status_t
FreeCookie(void *cookie
);
49 virtual status_t
GetStreamInfo(void *cookie
, int64
*frameCount
, bigtime_t
*duration
,
50 media_format
*format
, const void **infoBuffer
, size_t *infoSize
);
52 virtual status_t
Seek(void *cookie
, uint32 flags
,
53 int64
*frame
, bigtime_t
*time
);
55 virtual status_t
FindKeyFrame(void* cookie
, uint32 flags
,
56 int64
* frame
, bigtime_t
* time
);
58 virtual status_t
GetNextChunk(void *cookie
,
59 const void **chunkBuffer
, size_t *chunkSize
,
60 media_header
*mediaHeader
);
62 status_t
SetupVideoCookie(mkv_cookie
*cookie
);
63 status_t
SetupAudioCookie(mkv_cookie
*cookie
);
64 status_t
SetupTextCookie(mkv_cookie
*cookie
);
65 int CreateFakeAACDecoderConfig(const TrackInfo
*track
, uint8
**fakeExtraData
);
68 InputStream
* fInputStream
;
70 const SegmentInfo
* fFileInfo
;
74 class mkvReaderPlugin
: public ReaderPlugin
80 MediaPlugin
*instantiate_plugin();