]> git.sesse.net Git - x264/blob - output/matroska_ebml.h
Fix aspect ratio writing in the MKV muxer
[x264] / output / matroska_ebml.h
1 /*****************************************************************************
2  * matroska_ebml.h:
3  *****************************************************************************
4  * Copyright (C) 2005 Mike Matsnev
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
19  *****************************************************************************/
20
21 #ifndef X264_MATROSKA_EBML_H
22 #define X264_MATROSKA_EBML_H
23
24 /* Matroska display size units from the spec */
25 #define DS_PIXELS        0
26 #define DS_CM            1
27 #define DS_INCHES        2
28 #define DS_ASPECT_RATIO  3
29
30 typedef struct mk_writer mk_writer;
31
32 mk_writer *mk_create_writer( const char *filename );
33
34 int mk_writeHeader( mk_writer *w, const char *writing_app,
35                     const char *codec_id,
36                     const void *codec_private, unsigned codec_private_size,
37                     int64_t default_frame_duration,
38                     int64_t timescale,
39                     unsigned width, unsigned height,
40                     unsigned d_width, unsigned d_height, int display_size_units );
41
42 int mk_start_frame( mk_writer *w );
43 int mk_add_frame_data( mk_writer *w, const void *data, unsigned size );
44 int mk_set_frame_flags( mk_writer *w, int64_t timestamp, int keyframe, int skippable );
45 int mk_close( mk_writer *w, int64_t last_delta );
46
47 #endif