From 280fc54e6491faa37c7aec96119200c7fd8fc4ec Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 12 Feb 2016 16:43:24 +0100 Subject: [PATCH 1/7] Transcoder: added StreamTranscoderVector to SWIG --- src/AvTranscoder/transcoder/transcoder.i | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/AvTranscoder/transcoder/transcoder.i b/src/AvTranscoder/transcoder/transcoder.i index 3b934ab7..ffb1eedd 100644 --- a/src/AvTranscoder/transcoder/transcoder.i +++ b/src/AvTranscoder/transcoder/transcoder.i @@ -3,5 +3,7 @@ #include %} +%template(StreamTranscoderVector) std::vector< avtranscoder::StreamTranscoder* >; + %include %include From 65a732929f9b04e2aef1bb79f2a7924fb0f39a3e Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 12 Feb 2016 16:44:31 +0100 Subject: [PATCH 2/7] properties: fixed EAnalyseLevel and FormatContext for SWIG --- src/AvTranscoder/properties/properties.i | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AvTranscoder/properties/properties.i b/src/AvTranscoder/properties/properties.i index e80e70ce..00cbaeaa 100644 --- a/src/AvTranscoder/properties/properties.i +++ b/src/AvTranscoder/properties/properties.i @@ -46,6 +46,9 @@ namespace std { %template(ChannelVector) vector< avtranscoder::Channel >; } +%include +%include + %include %include %include From 0f25422cb03f507e9a1e951ef26eee58d5622a55 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 12 Feb 2016 16:49:16 +0100 Subject: [PATCH 3/7] Library: added Libraries to SWIG --- src/AvTranscoder/avTranscoder.i | 3 +-- src/AvTranscoder/library.i | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 src/AvTranscoder/library.i diff --git a/src/AvTranscoder/avTranscoder.i b/src/AvTranscoder/avTranscoder.i index fe9db742..e11d29c2 100644 --- a/src/AvTranscoder/avTranscoder.i +++ b/src/AvTranscoder/avTranscoder.i @@ -17,7 +17,6 @@ %include "AvTranscoder/swig/avOperator.i" %{ -#include #include %} @@ -26,9 +25,9 @@ %include "AvTranscoder/data/data.i" %include "AvTranscoder/profile/profile.i" -%include %include +%include "AvTranscoder/library.i" %include "AvTranscoder/option.i" %include "AvTranscoder/util.i" %include "AvTranscoder/codec/codec.i" diff --git a/src/AvTranscoder/library.i b/src/AvTranscoder/library.i new file mode 100644 index 00000000..d365fa6a --- /dev/null +++ b/src/AvTranscoder/library.i @@ -0,0 +1,14 @@ +%{ +#include +%} + +namespace std { +// Allow vector of object with no default constructor +%ignore vector< avtranscoder::Library >::vector(size_type); +%ignore vector< avtranscoder::Library >::resize; + +// Create instantiations of a template classes +%template(Libraries) vector< avtranscoder::Library >; +} + +%include From 9a6e6bc122aa822309deb40de19275848920de7f Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 12 Feb 2016 16:54:07 +0100 Subject: [PATCH 4/7] Option: fixed IntPair for SWIG --- src/AvTranscoder/option.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AvTranscoder/option.i b/src/AvTranscoder/option.i index ff550d2e..4abeb1ad 100644 --- a/src/AvTranscoder/option.i +++ b/src/AvTranscoder/option.i @@ -9,7 +9,7 @@ namespace std { // Create instantiations of a template classes %template(OptionArray) vector< avtranscoder::Option >; -%template(IntPair) pair< size_t, size_t >; +%template(IntPair) pair< int, int >; } %include From 0db0702eb7c3423c3407ac04b3126a8d0776d0c1 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 12 Feb 2016 16:55:44 +0100 Subject: [PATCH 5/7] Library: added IntVector to SWIG --- src/AvTranscoder/library.i | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AvTranscoder/library.i b/src/AvTranscoder/library.i index d365fa6a..019b906c 100644 --- a/src/AvTranscoder/library.i +++ b/src/AvTranscoder/library.i @@ -9,6 +9,7 @@ namespace std { // Create instantiations of a template classes %template(Libraries) vector< avtranscoder::Library >; +%template(IntVector) vector< size_t >; } %include From ad2a8c3665c109ce209dc47e810b0831d2205450 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Fri, 12 Feb 2016 16:57:07 +0100 Subject: [PATCH 6/7] decodedData: fixed ProfileMap for SWIG --- src/AvTranscoder/avTranscoder.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AvTranscoder/avTranscoder.i b/src/AvTranscoder/avTranscoder.i index e11d29c2..8b2ec56a 100644 --- a/src/AvTranscoder/avTranscoder.i +++ b/src/AvTranscoder/avTranscoder.i @@ -22,8 +22,8 @@ %include "AvTranscoder/progress/progress.i" %include "AvTranscoder/properties/properties.i" -%include "AvTranscoder/data/data.i" %include "AvTranscoder/profile/profile.i" +%include "AvTranscoder/data/data.i" %include From 3d06c346d86b65ebba6cea32ea9fbdcddef17249 Mon Sep 17 00:00:00 2001 From: Clement Champetier Date: Mon, 15 Feb 2016 11:54:51 +0100 Subject: [PATCH 7/7] pyTest: added testLibrary to check name and license of libraries --- test/pyTest/testLibrary.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/pyTest/testLibrary.py diff --git a/test/pyTest/testLibrary.py b/test/pyTest/testLibrary.py new file mode 100644 index 00000000..f7c812b9 --- /dev/null +++ b/test/pyTest/testLibrary.py @@ -0,0 +1,33 @@ +from nose.tools import * + +from pyAvTranscoder import avtranscoder as av + + +def testListLibraries(): + """ + Check name and license of libraries. + """ + librariesName = set(["avtranscoder", "avutil", "avformat", "avcodec", "avresample", "swresample", "swscale", "avfilter"]) + + for library in av.getLibraries(): + libraryName = library.getName() + if libraryName == "avtranscoder": + assert_equals(library.getLicense(), "GPL v2 or LGPL v2.1") + assert_in(libraryName, librariesName) + librariesName.remove(libraryName) + + # avresample or swresample, if avtranscoder depends on libav or ffmpeg + assert_equals(len(librariesName), 1) + + +def testSupportedExtensions(): + """ + Check if we can access the supported extensions. + These numbers of input/output extensions correspond to the features implemented in common libraries (not in third parties). + @note Tested with ffmpeg-2.4.2 + """ + inputExtensions = av.getInputExtensions() + outputExtensions = av.getOutputExtensions() + + assert_greater_equal(len(inputExtensions), 162) + assert_greater_equal(len(outputExtensions), 184)