mirror of
https://github.com/mpv-player/mpv
synced 2025-02-28 19:30:44 +00:00
TOOLS/matroska.py: recognize 3 more elements
Add definitions for DisplayUnit, OutputSamplingFrequency and FileDescription in matroska.py. Regenerate the C template files to allow using all current definitions in code.
This commit is contained in:
parent
dcaad783b0
commit
5a3edf4c07
@ -95,10 +95,12 @@ elements_matroska = (
|
|||||||
'PixelHeight, ba, uint',
|
'PixelHeight, ba, uint',
|
||||||
'DisplayWidth, 54b0, uint',
|
'DisplayWidth, 54b0, uint',
|
||||||
'DisplayHeight, 54ba, uint',
|
'DisplayHeight, 54ba, uint',
|
||||||
|
'DisplayUnit, 54b2, uint',
|
||||||
'FrameRate, 2383e3, float',
|
'FrameRate, 2383e3, float',
|
||||||
),
|
),
|
||||||
'Audio, e1, sub', (
|
'Audio, e1, sub', (
|
||||||
'SamplingFrequency, b5, float',
|
'SamplingFrequency, b5, float',
|
||||||
|
'OutputSamplingFrequency, 78b5, float',
|
||||||
'Channels, 9f, uint',
|
'Channels, 9f, uint',
|
||||||
'BitDepth, 6264, uint',
|
'BitDepth, 6264, uint',
|
||||||
),
|
),
|
||||||
@ -128,6 +130,7 @@ elements_matroska = (
|
|||||||
|
|
||||||
'Attachments, 1941a469, sub', (
|
'Attachments, 1941a469, sub', (
|
||||||
'AttachedFile*, 61a7, sub', (
|
'AttachedFile*, 61a7, sub', (
|
||||||
|
'FileDescription, 467e, str',
|
||||||
'FileName, 466e, str',
|
'FileName, 466e, str',
|
||||||
'FileMimeType, 4660, str',
|
'FileMimeType, 4660, str',
|
||||||
'FileData, 465c, binary',
|
'FileData, 465c, binary',
|
||||||
|
@ -48,14 +48,17 @@ F(MATROSKA_ID_TAG, tag, 1)
|
|||||||
}};
|
}};
|
||||||
#undef N
|
#undef N
|
||||||
|
|
||||||
|
E("ChapCountry", chap_country, EBML_TYPE_STR)
|
||||||
|
|
||||||
E("ChapLanguage", chap_language, EBML_TYPE_STR)
|
E("ChapLanguage", chap_language, EBML_TYPE_STR)
|
||||||
|
|
||||||
E("ChapString", chap_string, EBML_TYPE_STR)
|
E("ChapString", chap_string, EBML_TYPE_STR)
|
||||||
|
|
||||||
#define N chapter_display
|
#define N chapter_display
|
||||||
E_S("ChapterDisplay", 2)
|
E_S("ChapterDisplay", 3)
|
||||||
F(MATROSKA_ID_CHAPSTRING, chap_string, 0)
|
F(MATROSKA_ID_CHAPSTRING, chap_string, 0)
|
||||||
F(MATROSKA_ID_CHAPLANGUAGE, chap_language, 1)
|
F(MATROSKA_ID_CHAPLANGUAGE, chap_language, 1)
|
||||||
|
F(MATROSKA_ID_CHAPCOUNTRY, chap_country, 1)
|
||||||
}};
|
}};
|
||||||
#undef N
|
#undef N
|
||||||
|
|
||||||
@ -118,8 +121,11 @@ E("FileMimeType", file_mime_type, EBML_TYPE_STR)
|
|||||||
|
|
||||||
E("FileName", file_name, EBML_TYPE_STR)
|
E("FileName", file_name, EBML_TYPE_STR)
|
||||||
|
|
||||||
|
E("FileDescription", file_description, EBML_TYPE_STR)
|
||||||
|
|
||||||
#define N attached_file
|
#define N attached_file
|
||||||
E_S("AttachedFile", 4)
|
E_S("AttachedFile", 5)
|
||||||
|
F(MATROSKA_ID_FILEDESCRIPTION, file_description, 0)
|
||||||
F(MATROSKA_ID_FILENAME, file_name, 0)
|
F(MATROSKA_ID_FILENAME, file_name, 0)
|
||||||
F(MATROSKA_ID_FILEMIMETYPE, file_mime_type, 0)
|
F(MATROSKA_ID_FILEMIMETYPE, file_mime_type, 0)
|
||||||
F(MATROSKA_ID_FILEDATA, file_data, 0)
|
F(MATROSKA_ID_FILEDATA, file_data, 0)
|
||||||
@ -195,11 +201,14 @@ E("BitDepth", bit_depth, EBML_TYPE_UINT)
|
|||||||
|
|
||||||
E("Channels", channels, EBML_TYPE_UINT)
|
E("Channels", channels, EBML_TYPE_UINT)
|
||||||
|
|
||||||
|
E("OutputSamplingFrequency", output_sampling_frequency, EBML_TYPE_FLOAT)
|
||||||
|
|
||||||
E("SamplingFrequency", sampling_frequency, EBML_TYPE_FLOAT)
|
E("SamplingFrequency", sampling_frequency, EBML_TYPE_FLOAT)
|
||||||
|
|
||||||
#define N audio
|
#define N audio
|
||||||
E_S("Audio", 3)
|
E_S("Audio", 4)
|
||||||
F(MATROSKA_ID_SAMPLINGFREQUENCY, sampling_frequency, 0)
|
F(MATROSKA_ID_SAMPLINGFREQUENCY, sampling_frequency, 0)
|
||||||
|
F(MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY, output_sampling_frequency, 0)
|
||||||
F(MATROSKA_ID_CHANNELS, channels, 0)
|
F(MATROSKA_ID_CHANNELS, channels, 0)
|
||||||
F(MATROSKA_ID_BITDEPTH, bit_depth, 0)
|
F(MATROSKA_ID_BITDEPTH, bit_depth, 0)
|
||||||
}};
|
}};
|
||||||
@ -207,6 +216,8 @@ F(MATROSKA_ID_BITDEPTH, bit_depth, 0)
|
|||||||
|
|
||||||
E("FrameRate", frame_rate, EBML_TYPE_FLOAT)
|
E("FrameRate", frame_rate, EBML_TYPE_FLOAT)
|
||||||
|
|
||||||
|
E("DisplayUnit", display_unit, EBML_TYPE_UINT)
|
||||||
|
|
||||||
E("DisplayHeight", display_height, EBML_TYPE_UINT)
|
E("DisplayHeight", display_height, EBML_TYPE_UINT)
|
||||||
|
|
||||||
E("DisplayWidth", display_width, EBML_TYPE_UINT)
|
E("DisplayWidth", display_width, EBML_TYPE_UINT)
|
||||||
@ -218,12 +229,13 @@ E("PixelWidth", pixel_width, EBML_TYPE_UINT)
|
|||||||
E("FlagInterlaced", flag_interlaced, EBML_TYPE_UINT)
|
E("FlagInterlaced", flag_interlaced, EBML_TYPE_UINT)
|
||||||
|
|
||||||
#define N video
|
#define N video
|
||||||
E_S("Video", 6)
|
E_S("Video", 7)
|
||||||
F(MATROSKA_ID_FLAGINTERLACED, flag_interlaced, 0)
|
F(MATROSKA_ID_FLAGINTERLACED, flag_interlaced, 0)
|
||||||
F(MATROSKA_ID_PIXELWIDTH, pixel_width, 0)
|
F(MATROSKA_ID_PIXELWIDTH, pixel_width, 0)
|
||||||
F(MATROSKA_ID_PIXELHEIGHT, pixel_height, 0)
|
F(MATROSKA_ID_PIXELHEIGHT, pixel_height, 0)
|
||||||
F(MATROSKA_ID_DISPLAYWIDTH, display_width, 0)
|
F(MATROSKA_ID_DISPLAYWIDTH, display_width, 0)
|
||||||
F(MATROSKA_ID_DISPLAYHEIGHT, display_height, 0)
|
F(MATROSKA_ID_DISPLAYHEIGHT, display_height, 0)
|
||||||
|
F(MATROSKA_ID_DISPLAYUNIT, display_unit, 0)
|
||||||
F(MATROSKA_ID_FRAMERATE, frame_rate, 0)
|
F(MATROSKA_ID_FRAMERATE, frame_rate, 0)
|
||||||
}};
|
}};
|
||||||
#undef N
|
#undef N
|
||||||
@ -244,6 +256,8 @@ E("TrackTimecodeScale", track_timecode_scale, EBML_TYPE_FLOAT)
|
|||||||
|
|
||||||
E("DefaultDuration", default_duration, EBML_TYPE_UINT)
|
E("DefaultDuration", default_duration, EBML_TYPE_UINT)
|
||||||
|
|
||||||
|
E("MaxCache", max_cache, EBML_TYPE_UINT)
|
||||||
|
|
||||||
E("MinCache", min_cache, EBML_TYPE_UINT)
|
E("MinCache", min_cache, EBML_TYPE_UINT)
|
||||||
|
|
||||||
E("FlagLacing", flag_lacing, EBML_TYPE_UINT)
|
E("FlagLacing", flag_lacing, EBML_TYPE_UINT)
|
||||||
@ -261,7 +275,7 @@ E("TrackUID", track_uid, EBML_TYPE_UINT)
|
|||||||
E("TrackNumber", track_number, EBML_TYPE_UINT)
|
E("TrackNumber", track_number, EBML_TYPE_UINT)
|
||||||
|
|
||||||
#define N track_entry
|
#define N track_entry
|
||||||
E_S("TrackEntry", 19)
|
E_S("TrackEntry", 20)
|
||||||
F(MATROSKA_ID_TRACKNUMBER, track_number, 0)
|
F(MATROSKA_ID_TRACKNUMBER, track_number, 0)
|
||||||
F(MATROSKA_ID_TRACKUID, track_uid, 0)
|
F(MATROSKA_ID_TRACKUID, track_uid, 0)
|
||||||
F(MATROSKA_ID_TRACKTYPE, track_type, 0)
|
F(MATROSKA_ID_TRACKTYPE, track_type, 0)
|
||||||
@ -270,6 +284,7 @@ F(MATROSKA_ID_FLAGDEFAULT, flag_default, 0)
|
|||||||
F(MATROSKA_ID_FLAGFORCED, flag_forced, 0)
|
F(MATROSKA_ID_FLAGFORCED, flag_forced, 0)
|
||||||
F(MATROSKA_ID_FLAGLACING, flag_lacing, 0)
|
F(MATROSKA_ID_FLAGLACING, flag_lacing, 0)
|
||||||
F(MATROSKA_ID_MINCACHE, min_cache, 0)
|
F(MATROSKA_ID_MINCACHE, min_cache, 0)
|
||||||
|
F(MATROSKA_ID_MAXCACHE, max_cache, 0)
|
||||||
F(MATROSKA_ID_DEFAULTDURATION, default_duration, 0)
|
F(MATROSKA_ID_DEFAULTDURATION, default_duration, 0)
|
||||||
F(MATROSKA_ID_TRACKTIMECODESCALE, track_timecode_scale, 0)
|
F(MATROSKA_ID_TRACKTIMECODESCALE, track_timecode_scale, 0)
|
||||||
F(MATROSKA_ID_MAXBLOCKADDITIONID, max_block_addition_id, 0)
|
F(MATROSKA_ID_MAXBLOCKADDITIONID, max_block_addition_id, 0)
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#define MATROSKA_ID_FLAGFORCED 0x55aa
|
#define MATROSKA_ID_FLAGFORCED 0x55aa
|
||||||
#define MATROSKA_ID_FLAGLACING 0x9c
|
#define MATROSKA_ID_FLAGLACING 0x9c
|
||||||
#define MATROSKA_ID_MINCACHE 0x6de7
|
#define MATROSKA_ID_MINCACHE 0x6de7
|
||||||
|
#define MATROSKA_ID_MAXCACHE 0x6df8
|
||||||
#define MATROSKA_ID_DEFAULTDURATION 0x23e383
|
#define MATROSKA_ID_DEFAULTDURATION 0x23e383
|
||||||
#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314f
|
#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314f
|
||||||
#define MATROSKA_ID_MAXBLOCKADDITIONID 0x55ee
|
#define MATROSKA_ID_MAXBLOCKADDITIONID 0x55ee
|
||||||
@ -56,9 +57,11 @@
|
|||||||
#define MATROSKA_ID_PIXELHEIGHT 0xba
|
#define MATROSKA_ID_PIXELHEIGHT 0xba
|
||||||
#define MATROSKA_ID_DISPLAYWIDTH 0x54b0
|
#define MATROSKA_ID_DISPLAYWIDTH 0x54b0
|
||||||
#define MATROSKA_ID_DISPLAYHEIGHT 0x54ba
|
#define MATROSKA_ID_DISPLAYHEIGHT 0x54ba
|
||||||
|
#define MATROSKA_ID_DISPLAYUNIT 0x54b2
|
||||||
#define MATROSKA_ID_FRAMERATE 0x2383e3
|
#define MATROSKA_ID_FRAMERATE 0x2383e3
|
||||||
#define MATROSKA_ID_AUDIO 0xe1
|
#define MATROSKA_ID_AUDIO 0xe1
|
||||||
#define MATROSKA_ID_SAMPLINGFREQUENCY 0xb5
|
#define MATROSKA_ID_SAMPLINGFREQUENCY 0xb5
|
||||||
|
#define MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY 0x78b5
|
||||||
#define MATROSKA_ID_CHANNELS 0x9f
|
#define MATROSKA_ID_CHANNELS 0x9f
|
||||||
#define MATROSKA_ID_BITDEPTH 0x6264
|
#define MATROSKA_ID_BITDEPTH 0x6264
|
||||||
#define MATROSKA_ID_CONTENTENCODINGS 0x6d80
|
#define MATROSKA_ID_CONTENTENCODINGS 0x6d80
|
||||||
@ -77,6 +80,7 @@
|
|||||||
#define MATROSKA_ID_CUECLUSTERPOSITION 0xf1
|
#define MATROSKA_ID_CUECLUSTERPOSITION 0xf1
|
||||||
#define MATROSKA_ID_ATTACHMENTS 0x1941a469
|
#define MATROSKA_ID_ATTACHMENTS 0x1941a469
|
||||||
#define MATROSKA_ID_ATTACHEDFILE 0x61a7
|
#define MATROSKA_ID_ATTACHEDFILE 0x61a7
|
||||||
|
#define MATROSKA_ID_FILEDESCRIPTION 0x467e
|
||||||
#define MATROSKA_ID_FILENAME 0x466e
|
#define MATROSKA_ID_FILENAME 0x466e
|
||||||
#define MATROSKA_ID_FILEMIMETYPE 0x4660
|
#define MATROSKA_ID_FILEMIMETYPE 0x4660
|
||||||
#define MATROSKA_ID_FILEDATA 0x465c
|
#define MATROSKA_ID_FILEDATA 0x465c
|
||||||
@ -98,6 +102,7 @@
|
|||||||
#define MATROSKA_ID_CHAPTERDISPLAY 0x80
|
#define MATROSKA_ID_CHAPTERDISPLAY 0x80
|
||||||
#define MATROSKA_ID_CHAPSTRING 0x85
|
#define MATROSKA_ID_CHAPSTRING 0x85
|
||||||
#define MATROSKA_ID_CHAPLANGUAGE 0x437c
|
#define MATROSKA_ID_CHAPLANGUAGE 0x437c
|
||||||
|
#define MATROSKA_ID_CHAPCOUNTRY 0x437e
|
||||||
#define MATROSKA_ID_TAGS 0x1254c367
|
#define MATROSKA_ID_TAGS 0x1254c367
|
||||||
#define MATROSKA_ID_TAG 0x7373
|
#define MATROSKA_ID_TAG 0x7373
|
||||||
#define MATROSKA_ID_TARGETS 0x63c0
|
#define MATROSKA_ID_TARGETS 0x63c0
|
||||||
@ -153,9 +158,11 @@ struct ebml_tags {
|
|||||||
struct ebml_chapter_display {
|
struct ebml_chapter_display {
|
||||||
struct bstr chap_string;
|
struct bstr chap_string;
|
||||||
struct bstr *chap_language;
|
struct bstr *chap_language;
|
||||||
|
struct bstr *chap_country;
|
||||||
|
|
||||||
int n_chap_string;
|
int n_chap_string;
|
||||||
int n_chap_language;
|
int n_chap_language;
|
||||||
|
int n_chap_country;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ebml_chapter_atom {
|
struct ebml_chapter_atom {
|
||||||
@ -199,11 +206,13 @@ struct ebml_chapters {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct ebml_attached_file {
|
struct ebml_attached_file {
|
||||||
|
struct bstr file_description;
|
||||||
struct bstr file_name;
|
struct bstr file_name;
|
||||||
struct bstr file_mime_type;
|
struct bstr file_mime_type;
|
||||||
struct bstr file_data;
|
struct bstr file_data;
|
||||||
uint64_t file_uid;
|
uint64_t file_uid;
|
||||||
|
|
||||||
|
int n_file_description;
|
||||||
int n_file_name;
|
int n_file_name;
|
||||||
int n_file_mime_type;
|
int n_file_mime_type;
|
||||||
int n_file_data;
|
int n_file_data;
|
||||||
@ -266,10 +275,12 @@ struct ebml_content_encodings {
|
|||||||
|
|
||||||
struct ebml_audio {
|
struct ebml_audio {
|
||||||
double sampling_frequency;
|
double sampling_frequency;
|
||||||
|
double output_sampling_frequency;
|
||||||
uint64_t channels;
|
uint64_t channels;
|
||||||
uint64_t bit_depth;
|
uint64_t bit_depth;
|
||||||
|
|
||||||
int n_sampling_frequency;
|
int n_sampling_frequency;
|
||||||
|
int n_output_sampling_frequency;
|
||||||
int n_channels;
|
int n_channels;
|
||||||
int n_bit_depth;
|
int n_bit_depth;
|
||||||
};
|
};
|
||||||
@ -280,6 +291,7 @@ struct ebml_video {
|
|||||||
uint64_t pixel_height;
|
uint64_t pixel_height;
|
||||||
uint64_t display_width;
|
uint64_t display_width;
|
||||||
uint64_t display_height;
|
uint64_t display_height;
|
||||||
|
uint64_t display_unit;
|
||||||
double frame_rate;
|
double frame_rate;
|
||||||
|
|
||||||
int n_flag_interlaced;
|
int n_flag_interlaced;
|
||||||
@ -287,6 +299,7 @@ struct ebml_video {
|
|||||||
int n_pixel_height;
|
int n_pixel_height;
|
||||||
int n_display_width;
|
int n_display_width;
|
||||||
int n_display_height;
|
int n_display_height;
|
||||||
|
int n_display_unit;
|
||||||
int n_frame_rate;
|
int n_frame_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -299,6 +312,7 @@ struct ebml_track_entry {
|
|||||||
uint64_t flag_forced;
|
uint64_t flag_forced;
|
||||||
uint64_t flag_lacing;
|
uint64_t flag_lacing;
|
||||||
uint64_t min_cache;
|
uint64_t min_cache;
|
||||||
|
uint64_t max_cache;
|
||||||
uint64_t default_duration;
|
uint64_t default_duration;
|
||||||
double track_timecode_scale;
|
double track_timecode_scale;
|
||||||
uint64_t max_block_addition_id;
|
uint64_t max_block_addition_id;
|
||||||
@ -319,6 +333,7 @@ struct ebml_track_entry {
|
|||||||
int n_flag_forced;
|
int n_flag_forced;
|
||||||
int n_flag_lacing;
|
int n_flag_lacing;
|
||||||
int n_min_cache;
|
int n_min_cache;
|
||||||
|
int n_max_cache;
|
||||||
int n_default_duration;
|
int n_default_duration;
|
||||||
int n_track_timecode_scale;
|
int n_track_timecode_scale;
|
||||||
int n_max_block_addition_id;
|
int n_max_block_addition_id;
|
||||||
@ -459,4 +474,4 @@ extern const struct ebml_elem_desc ebml_tag_desc;
|
|||||||
extern const struct ebml_elem_desc ebml_targets_desc;
|
extern const struct ebml_elem_desc ebml_targets_desc;
|
||||||
extern const struct ebml_elem_desc ebml_simple_tag_desc;
|
extern const struct ebml_elem_desc ebml_simple_tag_desc;
|
||||||
|
|
||||||
#define MAX_EBML_SUBELEMENTS 19
|
#define MAX_EBML_SUBELEMENTS 20
|
||||||
|
Loading…
Reference in New Issue
Block a user