diff options
author | Carlos Goncalves <mail@cgoncalves.info> | 2010-03-09 12:48:41 +0000 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-04-12 17:30:01 -0300 |
commit | 3ddaabdefe113406be50447515fcf39cc058554a (patch) | |
tree | b1dd7dfb0121d3bcf1bdbe30e3e082f3c492c370 | |
parent | 542095e1ee72e32e5b935fb20c52d17d54903f79 (diff) |
Initial QtMultimedia bindings
-rw-r--r-- | PySide/CMakeLists.txt | 1 | ||||
-rw-r--r-- | PySide/QtMultimedia/CMakeLists.txt | 64 | ||||
-rw-r--r-- | PySide/QtMultimedia/typesystem_multimedia.xml | 65 | ||||
-rw-r--r-- | PySide/global.h | 1 | ||||
-rw-r--r-- | PySide/typesystem_templates.xml | 6 |
5 files changed, 137 insertions, 0 deletions
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt index 53e5851f0..d7f476a12 100644 --- a/PySide/CMakeLists.txt +++ b/PySide/CMakeLists.txt @@ -46,3 +46,4 @@ HAS_QT_MODULE(QT_QTSQL_FOUND QtSql) HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools) HAS_QT_MODULE(QT_QTHELP_FOUND QtHelp) HAS_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns) +HAS_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia) diff --git a/PySide/QtMultimedia/CMakeLists.txt b/PySide/QtMultimedia/CMakeLists.txt new file mode 100644 index 000000000..223485480 --- /dev/null +++ b/PySide/QtMultimedia/CMakeLists.txt @@ -0,0 +1,64 @@ +project(QtMultimedia) + +if(Q_WS_X11) + set(MODULE_NAME multimedia_x11) + set(SPECIFIC_OS_FILES + ) +elseif(Q_WS_MAC) + set(MODULE_NAME multimedia_mac) + set(SPECIFIC_OS_FILES + ) +else() + message(FATAL_ERROR "OS not supported") +endif(Q_WS_X11) + +if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) + set (QtMultimedia_46_SRC ) +else () + set(QtMultimedia_46_SRC + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudio_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractvideobuffer_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractvideosurface_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudiodeviceinfo_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudioformat_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudioinput_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudiooutput_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideoframe_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideosurfaceformat_wrapper.cpp + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qtmultimedia_module_wrapper.cpp + ) +endif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6) + +set(QtMultimedia_SRC +${SPECIFIC_OS_FILES} +${QtMultimedia_46_SRC} +) + +execute_generator(multimedia QtMultimedia_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_SOURCE_DIR}") + +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/ + ${QT_INCLUDE_DIR} + ${QT_QTCORE_INCLUDE_DIR} + ${QT_QTGUI_INCLUDE_DIR} + ${QT_QTMULTIMEDIA_INCLUDE_DIR} + ${SHIBOKEN_INCLUDE_DIR} + ${libpyside_SOURCE_DIR} + ${PYTHON_INCLUDE_PATH} + ${QtCore_BINARY_DIR}/PySide/QtCore/ + ${QtGui_BINARY_DIR}/PySide/QtGui/ + ) + +add_library(QtMultimedia MODULE ${QtMultimedia_SRC}) +set_property(TARGET QtMultimedia PROPERTY PREFIX "") +target_link_libraries(QtMultimedia + pyside + ${PYTHON_LIBRARIES} + ${SHIBOKEN_LIBRARY} + ${QT_QTMULTIMEDIA_LIBRARY} + ) +add_dependencies(QtMultimedia QtGui) + +# install +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtMultimedia.so + DESTINATION ${SITE_PACKAGE}/PySide) diff --git a/PySide/QtMultimedia/typesystem_multimedia.xml b/PySide/QtMultimedia/typesystem_multimedia.xml new file mode 100644 index 000000000..d523dba97 --- /dev/null +++ b/PySide/QtMultimedia/typesystem_multimedia.xml @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<typesystem package="PySide.QtMultimedia"> + <load-typesystem name="typesystem_gui.xml.in" generate="no" /> + + <rejection class="" function-name="qobject_cast<QAudioEngineFactoryInterface*>"/> + <rejection class="" function-name="qobject_interface_iid<QAudioEngineFactoryInterface*>"/> + + <namespace-type name="QAudio"/> + <enum-type name="QAudio::Error"/> + <enum-type name="QAudio::Mode"/> + <enum-type name="QAudio::State"/> + <enum-type name="QAbstractVideoBuffer::HandleType"/> + <enum-type name="QAbstractVideoBuffer::MapMode"/> + <enum-type name="QAbstractVideoSurface::Error"/> + <enum-type name="QAudioFormat::Endian"/> + <enum-type name="QAudioFormat::SampleType"/> + <enum-type name="QVideoFrame::FieldType"/> + <enum-type name="QVideoFrame::PixelFormat"/> + <enum-type name="QVideoSurfaceFormat::Direction"/> + <enum-type name="QVideoSurfaceFormat::YCbCrColorSpace"/> + + <object-type name="QAbstractVideoBuffer"> + <modify-function signature="map(QAbstractVideoBuffer::MapMode, int*, int*)"> + <modify-argument index="0"> + <replace-type modified-type="PyObject *"/> + </modify-argument> + <modify-argument index="2"> + <remove-argument/> + </modify-argument> + <modify-argument index="3"> + <remove-argument/> + </modify-argument> + <inject-code class="target" position="beginning"> + <insert-template name="fix_arg,int*,int*"/> + </inject-code> + </modify-function> + </object-type> + + <object-type name="QVideoSurfaceFormat"/> + <object-type name="QAbstractVideoSurface"> + <modify-function signature="nearestFormat(const QVideoSurfaceFormat&)const" remove="all"/> + <modify-function signature="surfaceFormat()const" remove="all"/> + </object-type> + <object-type name="QAudioDeviceInfo"> + <modify-function signature="defaultInputDevice()" remove="all"/> + <modify-function signature="defaultOutputDevice()" remove="all"/> + <modify-function signature="nearestFormat(const QAudioFormat&)const" remove="all"/> + <modify-function signature="preferredFormat()const" remove="all"/> + <modify-function signature="availableDevices(QAudio::Mode)" remove="all"/> + </object-type> + <object-type name="QAudioFormat"/> + <!-- DONE TODO TESTCASE check ctor setParent() --> + <!-- TODO TESTCASE start() check reference-count --> + <object-type name="QAudioInput"> + <modify-function signature="format()const" remove="all"/> + </object-type> + <!-- DONE TODO TESTCASE check ctor setParent() --> + <!-- TODO TESTCASE start() check reference-count --> + <object-type name="QAudioOutput"> + <modify-function signature="format()const" remove="all"/> + </object-type> + <!-- TODO TESTCASE don't increment the reference count of the video buffer --> + <object-type name="QVideoFrame"/> + +</typesystem> diff --git a/PySide/global.h b/PySide/global.h index 6b9927f96..23acc79f1 100644 --- a/PySide/global.h +++ b/PySide/global.h @@ -22,6 +22,7 @@ #include <QtNetwork/QtNetwork> #include <QtScript/QtScript> #include <QtScriptTools/QtScriptTools> +#include <QtMultimedia/QtMultimedia> // QT_GUI_LIB must be defined to QSqlRelationalDelegate become visible #define QT_GUI_LIB diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml index b60757591..3badcf273 100644 --- a/PySide/typesystem_templates.xml +++ b/PySide/typesystem_templates.xml @@ -133,5 +133,11 @@ *%2 = %CONVERTTOCPP[bool](_py_ok_); </template> + <template name="fix_arg,int*,int*"> + %RETURN_TYPE _ret; + int a, b; + _ret = %CPPSELF.%FUNCTION_NAME(%1, &a, &b); + %PYARG_0 = Shiboken::makeTuple(_ret, a, b); + </template> </typesystem> |