Initial QtMultimedia bindings
This commit is contained in:
parent
542095e1ee
commit
3ddaabdefe
5 changed files with 137 additions and 0 deletions
|
|
@ -46,3 +46,4 @@ HAS_QT_MODULE(QT_QTSQL_FOUND QtSql)
|
||||||
HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
|
HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
|
||||||
HAS_QT_MODULE(QT_QTHELP_FOUND QtHelp)
|
HAS_QT_MODULE(QT_QTHELP_FOUND QtHelp)
|
||||||
HAS_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
|
HAS_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
|
||||||
|
HAS_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)
|
||||||
|
|
|
||||||
64
PySide/QtMultimedia/CMakeLists.txt
Normal file
64
PySide/QtMultimedia/CMakeLists.txt
Normal file
|
|
@ -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)
|
||||||
65
PySide/QtMultimedia/typesystem_multimedia.xml
Normal file
65
PySide/QtMultimedia/typesystem_multimedia.xml
Normal file
|
|
@ -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>
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include <QtNetwork/QtNetwork>
|
#include <QtNetwork/QtNetwork>
|
||||||
#include <QtScript/QtScript>
|
#include <QtScript/QtScript>
|
||||||
#include <QtScriptTools/QtScriptTools>
|
#include <QtScriptTools/QtScriptTools>
|
||||||
|
#include <QtMultimedia/QtMultimedia>
|
||||||
|
|
||||||
// QT_GUI_LIB must be defined to QSqlRelationalDelegate become visible
|
// QT_GUI_LIB must be defined to QSqlRelationalDelegate become visible
|
||||||
#define QT_GUI_LIB
|
#define QT_GUI_LIB
|
||||||
|
|
|
||||||
|
|
@ -133,5 +133,11 @@
|
||||||
*%2 = %CONVERTTOCPP[bool](_py_ok_);
|
*%2 = %CONVERTTOCPP[bool](_py_ok_);
|
||||||
</template>
|
</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>
|
</typesystem>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue