Commit Graph

26 Commits

Author SHA1 Message Date
LaserEyess 8886f017a1 matroska.py: remove python2 support
Since 0.33.0 mpv does not support python2. This commit removes
python2 support from the file completely with the following
changes:

 - __future__ import of print_function is python2 only
 - unicode literals are legacy in python3
 - 'sys.version_info.major < 3' check is redundant
2020-11-27 11:17:29 +01:00
jnozsc 611c92ef1d *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
wm4 9c639016f8 TOOLS/matroska.py: ignore some unused elements
So that demux_mkv doesn't log them as unknown.
2018-04-29 02:21:32 +03:00
wm4 028faacff5 video: add metadata handling for spherical video
This adds handling of spherical video metadata: retrieving it from
demux_lavf and demux_mkv, passing it through filters, and adjusting it
with vf_format. This does not include support for rendering this type of
video.

We don't expect we need/want to support the other projection types like
cube maps, so we don't include that for now. They can be added later as
needed.

Also raise the maximum sizes of stringified image params, since they
can get really long.
2017-08-21 14:56:07 +02:00
wm4 f8cc184134 TOOLS: change license of some scripts involved in build to LGPL
wscript calls them directly, and thus are probably part of the build
system. They seem to be fully covered by relicensing agreements.
2017-06-24 10:08:33 +02:00
wm4 2493d91122 TOOLS/matroska.py: use python3
"python" usually maps to Python 2, while all Python 3 installations
provide "python3". And the script requires Python 3.
2017-02-01 07:03:13 +01:00
wm4 9c12d54afa demux_mkv: passthrough BlockAdditions for libvpx alpha
Dumb but simple thing. Requires the FFmpeg libvpx decoder wrapper, as
its native decoder doesn't support alpha.
2017-01-31 14:48:10 +01:00
wm4 55d6408526 TOOLS/matroska.py: fix some minor things for dumping
TOOLS/matroska.py can be used stand-alone for dumping Matroska file
contents. Fix some related issues.

Elements were treated as unknown if the element hex ID contained
uppercase characters.

Unknown elements stopped parsing. This was intentional, but I don't
really see any reason for it.

Dumping with Python 2 is broken. I don't care, but everytime I hit this,
I find myself trying to find out why. So make it error out explicitly.
2017-01-31 14:47:11 +01:00
Stefano Pigozzi 737e3b1758 build: use matroska.py & file2string.py as python modules 2017-01-05 11:25:18 +01:00
wm4 1ef9876b7d TOOLS/matroska.py: format file dumper output slightly nicer 2016-12-17 17:30:13 +01:00
wm4 a61eb81141 TOOLS/matroska.py: allow using as module
Don't force CLI usage. It can be imported, and generate_C_header() and
generate_C_definitions() can be called with a file argument instead of
writing to stdout always.
2016-12-17 16:05:51 +01:00
wm4 ff9f5e06ff Revert "Port several python scripts to Perl"
This reverts commit fae7307931.

Before the waf build system was used, we had a configure script written
in shell. To drop the build dependency on Python, someone rewrote the
Python scripts we had to Perl. Now the shell configure script is gone,
and it makes no sense to have a build dependency on both Perl and
Python.

This isn't just a straight revert. It adds the new Matroska EBML
elements to the old Python scripts, adjusts the waf build system, and of
course doesn't add anything back needed by the old build system.

It would be better if this used matroska.py/file2string.py directly by
importing them as modules, instead of calling them via "python". But for
now this is simpler.
2016-12-17 15:43:15 +01:00
Kovensky fae7307931 Port several python scripts to Perl
file2string.pl and vdpau_functions.pl are direct ports.
matroska.py was reimplemented as the Parse::Matroska module in CPAN,
and matroska.pl was made a client of Parse::Matroska.
A copy of Parse::Matroska is included in TOOLS/lib, and matroska.pl
looks there first when trying to load the module.

osxbundle.py was not ported since I have no means to verify it.
Python is always available on OSX though, so there is no harm in
removing the check for it on configure.
2012-11-08 00:28:59 +01:00
Kovensky f9f6ded36c Fix string.format compatibility with Python 2.6 2012-10-01 14:28:29 +02:00
wm4 6fb0e6bf1c build: use "python" instead of "python3" as interpreter name
This works regardless whether "python" starts a Python 2 or Python 3
interpreter.
2012-09-29 16:22:01 +02:00
wm4 0ee09dcdbe build: make Python scripts compatible with Python 2.x
They were originally written for Python 3.x. Changing them to work on
Python 2.x as well is trivial. Tested with Python 2.7.3 and 3.2.3.
2012-09-29 15:53:54 +02:00
Uoti Urpala 39a45c7a17 build: use python3 to generate some files previously in git
Some files used during build are generated with Python scripts in
TOOLS/. Before, the generated files were included in the git tree.
Start creating them at build time. This introduces a build-dependency
on python3.

The files in question are:
libvo/vdpau_template.c
libmpdemux/ebml_types.h
libmpdemux/ebml_defs.c
2012-07-16 21:08:42 +03:00
Uoti Urpala f06fe7f80e TOOLS/matroska.py: recognize CodecName 2011-04-08 01:20:35 +03:00
Uoti Urpala 5a3edf4c07 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.
2010-11-21 14:20:38 +02:00
Uoti Urpala 259ab1fe2d TOOLS/matroska.py: recognize MaxCache element 2010-11-08 18:05:12 +02:00
Uoti Urpala 3a1f89810f TOOLS/matroska.py: stop cleanly at EOF of complete file when parsing
When using the script to parse a Matroska file, the script used to
exit with an exception at EOF. Change it to exit quietly instead if
the file was parsed successfully. Keep showing an exception if EOF is
encountered in the middle of an element (truncated file).
2010-11-02 04:18:37 +02:00
Uoti Urpala 49096c7ae2 TOOLS/matroska.py: change to python3 syntax 2010-11-02 04:18:37 +02:00
Uoti Urpala 7a190c461b TOOLS/matroska.py: recognize ChapCountry 2010-10-21 21:47:12 +03:00
Anton Khirnov de42015a97 demux_mkv: read tags. 2010-05-22 06:40:34 +03:00
Uoti Urpala cbc6eabb9f TOOLS/matroska.py: support 8-byte floats in parsing mode
Support parsing and printing the value of 8-byte floats when using the
script to parse and display contents of Matroska files.
2010-03-11 23:42:20 +02:00
Uoti Urpala 5f631d1c08 matroska: add new parsing code
Add a new EBML parser implementation that should allow significant
improvements to the Matroska demuxer. The new parsing code is not
actually used yet by the demuxer. The only changes to existing code in
this commit are to generate the MATROSKA_ID_* / EBML_ID_* macro
definitions from the new implementation and to rename some of them
(the new implementation uses names matching the official Matroska spec).

The main parser implementation is added in ebml.c. There are two new
generated files, ebml_defs.c and ebml_types.h, that contain
definitions of EBML elements. Those are generated by the new script
TOOLS/matroska.py. There's a new Makefile target "generated_ebml" that
run the script to refresh the content of the generated files.
2010-01-27 14:26:43 +02:00