2003-02-16 00:47:53 +00:00
|
|
|
/*
|
|
|
|
mkvmerge -- utility for splicing together matroska files
|
|
|
|
from component media subtypes
|
|
|
|
|
|
|
|
common.h
|
|
|
|
|
|
|
|
Written by Moritz Bunkus <moritz@bunkus.org>
|
|
|
|
|
|
|
|
Distributed under the GPL
|
|
|
|
see the file COPYING for details
|
|
|
|
or visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*/
|
|
|
|
|
2003-02-16 12:17:11 +00:00
|
|
|
/*!
|
|
|
|
\file
|
2003-04-11 10:05:11 +00:00
|
|
|
\version \$Id: common.h,v 1.10 2003/04/11 10:05:11 mosu Exp $
|
2003-02-16 12:17:11 +00:00
|
|
|
\brief definitions used in all programs, helper functions
|
|
|
|
\author Moritz Bunkus <moritz @ bunkus.org>
|
|
|
|
*/
|
|
|
|
|
2003-02-16 17:04:39 +00:00
|
|
|
#ifndef __COMMON_H
|
|
|
|
#define __COMMON_H
|
2003-02-16 00:47:53 +00:00
|
|
|
|
2003-03-13 09:31:06 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2003-04-11 10:05:11 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
#define strncasecmp _strnicmp
|
|
|
|
#define strcasecmp _stricmp
|
|
|
|
#define u_int16_t unsigned __int16
|
|
|
|
#define u_int32_t unsigned __int32
|
|
|
|
#define u_int64_t __int64
|
|
|
|
#define int64_t __int64
|
|
|
|
#define nice(a)
|
|
|
|
#endif
|
|
|
|
|
2003-03-03 13:47:50 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2003-02-16 11:44:19 +00:00
|
|
|
#define VERSIONINFO "mkvmerge v" VERSION
|
|
|
|
|
|
|
|
#define DISPLAYPRIORITY_HIGH 10
|
|
|
|
#define DISPLAYPRIORITY_MEDIUM 5
|
|
|
|
#define DISPLAYPRIORITY_LOW 1
|
|
|
|
|
|
|
|
/* errors */
|
|
|
|
#define EMOREDATA -1
|
|
|
|
#define EMALLOC -2
|
|
|
|
#define EBADHEADER -3
|
|
|
|
#define EBADEVENT -4
|
|
|
|
#define EOTHER -5
|
|
|
|
|
|
|
|
/* types */
|
|
|
|
#define TYPEUNKNOWN 0
|
|
|
|
#define TYPEOGM 1
|
|
|
|
#define TYPEAVI 2
|
|
|
|
#define TYPEWAV 3
|
|
|
|
#define TYPESRT 4
|
|
|
|
#define TYPEMP3 5
|
|
|
|
#define TYPEAC3 6
|
|
|
|
#define TYPECHAPTERS 7
|
|
|
|
#define TYPEMICRODVD 8
|
|
|
|
#define TYPEVOBSUB 9
|
2003-03-13 09:31:06 +00:00
|
|
|
#define TYPEMATROSKA 10
|
2003-02-16 11:44:19 +00:00
|
|
|
|
|
|
|
#define FOURCC(a, b, c, d) (unsigned long)((((unsigned char)a) << 24) + \
|
|
|
|
(((unsigned char)b) << 16) + \
|
|
|
|
(((unsigned char)c) << 8) + \
|
|
|
|
((unsigned char)d))
|
|
|
|
typedef struct {
|
|
|
|
int displacement;
|
|
|
|
double linear;
|
|
|
|
} audio_sync_t;
|
|
|
|
|
2003-03-05 13:51:20 +00:00
|
|
|
typedef struct {
|
|
|
|
// Options used by the readers.
|
|
|
|
char *fname;
|
2003-04-11 10:05:11 +00:00
|
|
|
unsigned char *atracks, *vtracks, *stracks;
|
2003-03-05 13:51:20 +00:00
|
|
|
|
|
|
|
// Options used by the packetizers.
|
|
|
|
unsigned char *private_data;
|
|
|
|
int private_size;
|
|
|
|
|
2003-03-05 17:44:32 +00:00
|
|
|
char fourcc[5];
|
2003-03-05 13:51:20 +00:00
|
|
|
|
|
|
|
audio_sync_t async;
|
|
|
|
} track_info_t;
|
|
|
|
|
2003-02-16 11:44:19 +00:00
|
|
|
typedef double stamp_t;
|
|
|
|
#define MAX_TIMESTAMP ((double)3.40282347e+38F)
|
|
|
|
|
2003-02-16 00:47:53 +00:00
|
|
|
#define die(s) _die(s, __FILE__, __LINE__)
|
|
|
|
void _die(const char *s, const char *file, int line);
|
|
|
|
|
2003-02-16 17:04:39 +00:00
|
|
|
char *map_video_codec_fourcc(char *fourcc, int *set_codec_private);
|
|
|
|
char *map_audio_codec_id(int id, int bps, int *set_codec_private);
|
|
|
|
|
2003-03-05 13:51:20 +00:00
|
|
|
track_info_t *duplicate_track_info(track_info_t *src);
|
|
|
|
void free_track_info(track_info_t *ti);
|
|
|
|
|
2003-03-13 09:31:06 +00:00
|
|
|
u_int16_t get_uint16(const void *buf);
|
|
|
|
u_int32_t get_uint32(const void *buf);
|
|
|
|
|
2003-02-16 00:47:53 +00:00
|
|
|
extern int verbose;
|
2003-02-16 17:04:39 +00:00
|
|
|
extern float video_fps;
|
2003-02-16 00:47:53 +00:00
|
|
|
|
2003-02-16 17:04:39 +00:00
|
|
|
#endif // __COMMON_H
|