Skip to content

SWIG: fixed some unknown types #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/AvTranscoder/avTranscoder.i
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
%include "AvTranscoder/swig/avOperator.i"

%{
#include <AvTranscoder/Library.hpp>
#include <AvTranscoder/log.hpp>
%}

%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 <AvTranscoder/Library.hpp>
%include <AvTranscoder/log.hpp>

%include "AvTranscoder/library.i"
%include "AvTranscoder/option.i"
%include "AvTranscoder/util.i"
%include "AvTranscoder/codec/codec.i"
Expand Down
15 changes: 15 additions & 0 deletions src/AvTranscoder/library.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%{
#include <AvTranscoder/Library.hpp>
%}

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 >;
%template(IntVector) vector< size_t >;
}

%include <AvTranscoder/Library.hpp>
2 changes: 1 addition & 1 deletion src/AvTranscoder/option.i
Original file line number Diff line number Diff line change
Expand Up @@ -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 <AvTranscoder/Option.hpp>
3 changes: 3 additions & 0 deletions src/AvTranscoder/properties/properties.i
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace std {
%template(ChannelVector) vector< avtranscoder::Channel >;
}

%include <AvTranscoder/file/util.hpp>
%include <AvTranscoder/file/FormatContext.hpp>

%include <AvTranscoder/properties/util.hpp>
%include <AvTranscoder/properties/FileProperties.hpp>
%include <AvTranscoder/properties/PixelProperties.hpp>
Expand Down
2 changes: 2 additions & 0 deletions src/AvTranscoder/transcoder/transcoder.i
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
#include <AvTranscoder/transcoder/Transcoder.hpp>
%}

%template(StreamTranscoderVector) std::vector< avtranscoder::StreamTranscoder* >;

%include <AvTranscoder/transcoder/StreamTranscoder.hpp>
%include <AvTranscoder/transcoder/Transcoder.hpp>
33 changes: 33 additions & 0 deletions test/pyTest/testLibrary.py
Original file line number Diff line number Diff line change
@@ -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)