Merge lp:~jhodapp/qtvideo-node/remove-stch-singleton into lp:qtvideo-node

Proposed by Jim Hodapp
Status: Merged
Merged at revision: 42
Proposed branch: lp:~jhodapp/qtvideo-node/remove-stch-singleton
Merge into: lp:qtvideo-node
Diff against target: 159 lines (+36/-7)
6 files modified
src/shadervideomaterial.cpp (+9/-3)
src/shadervideomaterial.h (+5/-0)
src/shadervideonode.cpp (+12/-2)
src/shadervideonode.h (+3/-0)
unittests/shadervideonode/player.cpp (+6/-2)
unittests/shadervideonode/tst_shadervideonode.cpp (+1/-0)
To merge this branch: bzr merge lp:~jhodapp/qtvideo-node/remove-stch-singleton
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+197924@code.launchpad.net

Commit message

Updated to support passing a SurfaceTextureClientHybris instance embedded in the frame's metadata. This removes the need for a singleton SurfaceTextureClientHybris instance in the hybris media layer.

Description of the change

Updated to support passing a SurfaceTextureClientHybris instance embedded in the frame's metadata. This removes the need for a singleton SurfaceTextureClientHybris instance in the hybris media layer.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :
Download full text (29.8 KiB)

Even with newer hybris, there's a broken test case:

dpkg-buildpackage: source package qtvideo-node
dpkg-buildpackage: source version 0.2.1+13.10.20130928.1-0ubuntu2
dpkg-buildpackage: source distribution trusty
 dpkg-source --before-build qtvideo-node-0.2.1+13.10.20130928.1
dpkg-buildpackage: host architecture armhf
 /usr/bin/fakeroot debian/rules clean
dh clean --parallel --buildsystem=qmake
   dh_testdir -O--parallel -O--buildsystem=qmake
   dh_auto_clean -O--parallel -O--buildsystem=qmake
   dh_clean -O--parallel -O--buildsystem=qmake
 debian/rules build-arch
dh build-arch --parallel --buildsystem=qmake
   dh_testdir -a -O--parallel -O--buildsystem=qmake
   dh_auto_configure -a -O--parallel -O--buildsystem=qmake
   dh_auto_build -a -O--parallel -O--buildsystem=qmake
make[1]: Entering directory `/build/buildd/qtvideo-node-0.2.1+13.10.20130928.1'
cd src/ && ( test -e Makefile || /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake /build/buildd/qtvideo-node-0.2.1+13.10.20130928.1/src/src.pro -nocache QMAKE_CFLAGS_RELEASE=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_CFLAGS_DEBUG=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_CXXFLAGS_RELEASE=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_CXXFLAGS_DEBUG=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_LFLAGS_RELEASE=-Wl,-Bsymbolic-functions\ -Wl,-z,relro QMAKE_LFLAGS_DEBUG=-Wl,-Bsymbolic-functions\ -Wl,-z,relro QMAKE_STRIP=: PREFIX=/usr -o Makefile ) && make -f Makefile
cd unittests/ && ( test -e Makefile || /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake /build/buildd/qtvideo-node-0.2.1+13.10.20130928.1/unittests/unittests.pro -nocache QMAKE_CFLAGS_RELEASE=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_CFLAGS_DEBUG=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_CXXFLAGS_RELEASE=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_CXXFLAGS_DEBUG=-g\ -O2\ -fstack-protector\ --param=ssp-buffer-size=4\ -Wformat\ -Werror=format-security\ -D_FORTIFY_SOURCE=2 QMAKE_LFLAGS_RELEASE=-Wl,-Bsymbolic-functions\ -Wl,-z,relro QMAKE_LFLAGS_DEBUG=-Wl,-Bsymbolic-functions\ -Wl,-z,relro QMAKE_STRIP=: PREFIX=/usr -o Makefile ) && make -f Makefile
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!
make[2]: Entering directory `/build/buildd/qtvideo-node-0.2.1+13.10.20130928.1/unittests'
cd shadervideonode/ && ( test -e Makefile || /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake /build/buildd/qtvideo-node-0.2.1+13.10.20130928.1/unittests/shadervideonode/shadervideonode.pro -nocache QMAKE_C...

43. By Jim Hodapp

Fixed the tst_ShaderVideoNode::testTextureIdSetCurrentFrame unit test to work with the SurfaceTextureClient frame metadata change.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Tested and worked fine with latest hybris and qtmultimedia-touch. Merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/shadervideomaterial.cpp'
--- src/shadervideomaterial.cpp 2013-09-13 15:56:26 +0000
+++ src/shadervideomaterial.cpp 2013-12-16 18:43:55 +0000
@@ -36,7 +36,8 @@
36ShaderVideoMaterial::ShaderVideoMaterial(const QVideoSurfaceFormat &format)36ShaderVideoMaterial::ShaderVideoMaterial(const QVideoSurfaceFormat &format)
37 : m_format(format),37 : m_format(format),
38 m_camControl(0),38 m_camControl(0),
39 m_textureId(0)39 m_textureId(0),
40 m_surfaceTextureClient(0)
40{41{
41}42}
4243
@@ -71,6 +72,11 @@
71 m_textureId = textureId;72 m_textureId = textureId;
72}73}
7374
75void ShaderVideoMaterial::setSurfaceTextureClient(SurfaceTextureClientHybris surface_texture_client)
76{
77 m_surfaceTextureClient = surface_texture_client;
78}
79
74void ShaderVideoMaterial::bind()80void ShaderVideoMaterial::bind()
75{81{
76 if (!m_camControl && !m_textureId) {82 if (!m_camControl && !m_textureId) {
@@ -82,8 +88,8 @@
82 android_camera_get_preview_texture_transformation(m_camControl, m_textureMatrix);88 android_camera_get_preview_texture_transformation(m_camControl, m_textureMatrix);
83 }89 }
84 else {90 else {
85 surface_texture_client_update_texture();91 surface_texture_client_update_texture(m_surfaceTextureClient);
86 surface_texture_client_get_transformation_matrix(static_cast<float*>(m_textureMatrix));92 surface_texture_client_get_transformation_matrix(m_surfaceTextureClient, static_cast<float*>(m_textureMatrix));
87 }93 }
8894
89 undoAndroidYFlip(m_textureMatrix);95 undoAndroidYFlip(m_textureMatrix);
9096
=== modified file 'src/shadervideomaterial.h'
--- src/shadervideomaterial.h 2013-09-11 18:43:39 +0000
+++ src/shadervideomaterial.h 2013-12-16 18:43:55 +0000
@@ -28,6 +28,8 @@
28class ShaderVideoMaterial : public QSGMaterial28class ShaderVideoMaterial : public QSGMaterial
29{29{
30public:30public:
31 typedef void* SurfaceTextureClientHybris;
32
31 ShaderVideoMaterial(const QVideoSurfaceFormat &format);33 ShaderVideoMaterial(const QVideoSurfaceFormat &format);
3234
33 QSGMaterialShader *createShader() const;35 QSGMaterialShader *createShader() const;
@@ -40,6 +42,8 @@
40 void setTextureId(GLuint textureId);42 void setTextureId(GLuint textureId);
41 GLuint textureId() const { return m_textureId; }43 GLuint textureId() const { return m_textureId; }
4244
45 void setSurfaceTextureClient(SurfaceTextureClientHybris surface_texture_client);
46
43 void bind();47 void bind();
4448
45private:49private:
@@ -49,6 +53,7 @@
49 QVideoSurfaceFormat m_format;53 QVideoSurfaceFormat m_format;
50 CameraControl *m_camControl;54 CameraControl *m_camControl;
51 GLuint m_textureId;55 GLuint m_textureId;
56 SurfaceTextureClientHybris m_surfaceTextureClient;
52 static ShaderVideoShader *m_videoShader; // the shader is cached in the Qt scene graph57 static ShaderVideoShader *m_videoShader; // the shader is cached in the Qt scene graph
53 GLfloat m_textureMatrix[16];58 GLfloat m_textureMatrix[16];
54};59};
5560
=== modified file 'src/shadervideonode.cpp'
--- src/shadervideonode.cpp 2013-09-11 18:43:39 +0000
+++ src/shadervideonode.cpp 2013-12-16 18:43:55 +0000
@@ -27,7 +27,8 @@
27 */27 */
28ShaderVideoNode::ShaderVideoNode(const QVideoSurfaceFormat &format) :28ShaderVideoNode::ShaderVideoNode(const QVideoSurfaceFormat &format) :
29 m_format(format),29 m_format(format),
30 m_textureId(0)30 m_textureId(0),
31 m_surfaceTextureClient(0)
31{32{
32 m_material = new ShaderVideoMaterial(format);33 m_material = new ShaderVideoMaterial(format);
33 setMaterial(m_material);34 setMaterial(m_material);
@@ -71,13 +72,22 @@
71 return;72 return;
72 }73 }
73 m_material->setCamControl((CameraControl*)ci);74 m_material->setCamControl((CameraControl*)ci);
74 } else if (frame.availableMetaData().contains("TextureId")) {75 } else if (frame.availableMetaData().contains("TextureId") &&
76 frame.availableMetaData().contains("SurfaceTextureClient")) {
75 m_textureId = frame.metaData("TextureId").value<GLuint>();77 m_textureId = frame.metaData("TextureId").value<GLuint>();
76 if (m_textureId == 0) {78 if (m_textureId == 0) {
77 qWarning() << "No valid textureId in video frame";79 qWarning() << "No valid textureId in video frame";
78 return;80 return;
79 }81 }
80 m_material->setTextureId(m_textureId);82 m_material->setTextureId(m_textureId);
83
84 m_surfaceTextureClient = reinterpret_cast<SurfaceTextureClientHybris>
85 (frame.metaData("SurfaceTextureClient").value<unsigned int>());
86 if (m_surfaceTextureClient == 0) {
87 qWarning() << "No valid SurfaceTextureClient instance in video frame";
88 return;
89 }
90 m_material->setSurfaceTextureClient(m_surfaceTextureClient);
81 } else if (!frame.availableMetaData().contains("CamControl") &&91 } else if (!frame.availableMetaData().contains("CamControl") &&
82 !frame.availableMetaData().contains("TextureId")) {92 !frame.availableMetaData().contains("TextureId")) {
83 qWarning() << "No camera control or texture id instance included in video frame";93 qWarning() << "No camera control or texture id instance included in video frame";
8494
=== modified file 'src/shadervideonode.h'
--- src/shadervideonode.h 2013-07-29 09:21:03 +0000
+++ src/shadervideonode.h 2013-12-16 18:43:55 +0000
@@ -29,6 +29,8 @@
29{29{
30 Q_OBJECT30 Q_OBJECT
31public:31public:
32 typedef void* SurfaceTextureClientHybris;
33
32 ShaderVideoNode(const QVideoSurfaceFormat &format);34 ShaderVideoNode(const QVideoSurfaceFormat &format);
33 ~ShaderVideoNode();35 ~ShaderVideoNode();
3436
@@ -46,6 +48,7 @@
46 QVideoSurfaceFormat m_format;48 QVideoSurfaceFormat m_format;
47 ShaderVideoMaterial *m_material;49 ShaderVideoMaterial *m_material;
48 GLuint m_textureId;50 GLuint m_textureId;
51 SurfaceTextureClientHybris m_surfaceTextureClient;
49 SnapshotGenerator *m_snapshotGenerator;52 SnapshotGenerator *m_snapshotGenerator;
50};53};
5154
5255
=== modified file 'unittests/shadervideonode/player.cpp'
--- unittests/shadervideonode/player.cpp 2013-09-13 15:56:26 +0000
+++ unittests/shadervideonode/player.cpp 2013-12-16 18:43:55 +0000
@@ -18,11 +18,15 @@
1818
19#include <QtGlobal>19#include <QtGlobal>
2020
21void surface_texture_client_get_transformation_matrix(float *matrix)21typedef void* SurfaceTextureClientHybris;
22
23void surface_texture_client_get_transformation_matrix(SurfaceTextureClientHybris stc, float *matrix)
22{24{
25 Q_UNUSED(stc);
23 Q_UNUSED(matrix);26 Q_UNUSED(matrix);
24}27}
2528
26void surface_texture_client_update_texture()29void surface_texture_client_update_texture(SurfaceTextureClientHybris stc)
27{30{
31 Q_UNUSED(stc);
28}32}
2933
=== modified file 'unittests/shadervideonode/tst_shadervideonode.cpp'
--- unittests/shadervideonode/tst_shadervideonode.cpp 2013-09-12 16:16:28 +0000
+++ unittests/shadervideonode/tst_shadervideonode.cpp 2013-12-16 18:43:55 +0000
@@ -95,6 +95,7 @@
95 QCOMPARE(node.m_material->textureId(), (const GLuint)0);95 QCOMPARE(node.m_material->textureId(), (const GLuint)0);
9696
97 frame.setMetaData("TextureId", 70001);97 frame.setMetaData("TextureId", 70001);
98 frame.setMetaData("SurfaceTextureClient", 0x1);
98 node.setCurrentFrame(frame);99 node.setCurrentFrame(frame);
99 QCOMPARE(node.m_material->textureId(), (const GLuint)70001);100 QCOMPARE(node.m_material->textureId(), (const GLuint)70001);
100}101}

Subscribers

People subscribed via source and target branches