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
1=== modified file 'src/shadervideomaterial.cpp'
2--- src/shadervideomaterial.cpp 2013-09-13 15:56:26 +0000
3+++ src/shadervideomaterial.cpp 2013-12-16 18:43:55 +0000
4@@ -36,7 +36,8 @@
5 ShaderVideoMaterial::ShaderVideoMaterial(const QVideoSurfaceFormat &format)
6 : m_format(format),
7 m_camControl(0),
8- m_textureId(0)
9+ m_textureId(0),
10+ m_surfaceTextureClient(0)
11 {
12 }
13
14@@ -71,6 +72,11 @@
15 m_textureId = textureId;
16 }
17
18+void ShaderVideoMaterial::setSurfaceTextureClient(SurfaceTextureClientHybris surface_texture_client)
19+{
20+ m_surfaceTextureClient = surface_texture_client;
21+}
22+
23 void ShaderVideoMaterial::bind()
24 {
25 if (!m_camControl && !m_textureId) {
26@@ -82,8 +88,8 @@
27 android_camera_get_preview_texture_transformation(m_camControl, m_textureMatrix);
28 }
29 else {
30- surface_texture_client_update_texture();
31- surface_texture_client_get_transformation_matrix(static_cast<float*>(m_textureMatrix));
32+ surface_texture_client_update_texture(m_surfaceTextureClient);
33+ surface_texture_client_get_transformation_matrix(m_surfaceTextureClient, static_cast<float*>(m_textureMatrix));
34 }
35
36 undoAndroidYFlip(m_textureMatrix);
37
38=== modified file 'src/shadervideomaterial.h'
39--- src/shadervideomaterial.h 2013-09-11 18:43:39 +0000
40+++ src/shadervideomaterial.h 2013-12-16 18:43:55 +0000
41@@ -28,6 +28,8 @@
42 class ShaderVideoMaterial : public QSGMaterial
43 {
44 public:
45+ typedef void* SurfaceTextureClientHybris;
46+
47 ShaderVideoMaterial(const QVideoSurfaceFormat &format);
48
49 QSGMaterialShader *createShader() const;
50@@ -40,6 +42,8 @@
51 void setTextureId(GLuint textureId);
52 GLuint textureId() const { return m_textureId; }
53
54+ void setSurfaceTextureClient(SurfaceTextureClientHybris surface_texture_client);
55+
56 void bind();
57
58 private:
59@@ -49,6 +53,7 @@
60 QVideoSurfaceFormat m_format;
61 CameraControl *m_camControl;
62 GLuint m_textureId;
63+ SurfaceTextureClientHybris m_surfaceTextureClient;
64 static ShaderVideoShader *m_videoShader; // the shader is cached in the Qt scene graph
65 GLfloat m_textureMatrix[16];
66 };
67
68=== modified file 'src/shadervideonode.cpp'
69--- src/shadervideonode.cpp 2013-09-11 18:43:39 +0000
70+++ src/shadervideonode.cpp 2013-12-16 18:43:55 +0000
71@@ -27,7 +27,8 @@
72 */
73 ShaderVideoNode::ShaderVideoNode(const QVideoSurfaceFormat &format) :
74 m_format(format),
75- m_textureId(0)
76+ m_textureId(0),
77+ m_surfaceTextureClient(0)
78 {
79 m_material = new ShaderVideoMaterial(format);
80 setMaterial(m_material);
81@@ -71,13 +72,22 @@
82 return;
83 }
84 m_material->setCamControl((CameraControl*)ci);
85- } else if (frame.availableMetaData().contains("TextureId")) {
86+ } else if (frame.availableMetaData().contains("TextureId") &&
87+ frame.availableMetaData().contains("SurfaceTextureClient")) {
88 m_textureId = frame.metaData("TextureId").value<GLuint>();
89 if (m_textureId == 0) {
90 qWarning() << "No valid textureId in video frame";
91 return;
92 }
93 m_material->setTextureId(m_textureId);
94+
95+ m_surfaceTextureClient = reinterpret_cast<SurfaceTextureClientHybris>
96+ (frame.metaData("SurfaceTextureClient").value<unsigned int>());
97+ if (m_surfaceTextureClient == 0) {
98+ qWarning() << "No valid SurfaceTextureClient instance in video frame";
99+ return;
100+ }
101+ m_material->setSurfaceTextureClient(m_surfaceTextureClient);
102 } else if (!frame.availableMetaData().contains("CamControl") &&
103 !frame.availableMetaData().contains("TextureId")) {
104 qWarning() << "No camera control or texture id instance included in video frame";
105
106=== modified file 'src/shadervideonode.h'
107--- src/shadervideonode.h 2013-07-29 09:21:03 +0000
108+++ src/shadervideonode.h 2013-12-16 18:43:55 +0000
109@@ -29,6 +29,8 @@
110 {
111 Q_OBJECT
112 public:
113+ typedef void* SurfaceTextureClientHybris;
114+
115 ShaderVideoNode(const QVideoSurfaceFormat &format);
116 ~ShaderVideoNode();
117
118@@ -46,6 +48,7 @@
119 QVideoSurfaceFormat m_format;
120 ShaderVideoMaterial *m_material;
121 GLuint m_textureId;
122+ SurfaceTextureClientHybris m_surfaceTextureClient;
123 SnapshotGenerator *m_snapshotGenerator;
124 };
125
126
127=== modified file 'unittests/shadervideonode/player.cpp'
128--- unittests/shadervideonode/player.cpp 2013-09-13 15:56:26 +0000
129+++ unittests/shadervideonode/player.cpp 2013-12-16 18:43:55 +0000
130@@ -18,11 +18,15 @@
131
132 #include <QtGlobal>
133
134-void surface_texture_client_get_transformation_matrix(float *matrix)
135+typedef void* SurfaceTextureClientHybris;
136+
137+void surface_texture_client_get_transformation_matrix(SurfaceTextureClientHybris stc, float *matrix)
138 {
139+ Q_UNUSED(stc);
140 Q_UNUSED(matrix);
141 }
142
143-void surface_texture_client_update_texture()
144+void surface_texture_client_update_texture(SurfaceTextureClientHybris stc)
145 {
146+ Q_UNUSED(stc);
147 }
148
149=== modified file 'unittests/shadervideonode/tst_shadervideonode.cpp'
150--- unittests/shadervideonode/tst_shadervideonode.cpp 2013-09-12 16:16:28 +0000
151+++ unittests/shadervideonode/tst_shadervideonode.cpp 2013-12-16 18:43:55 +0000
152@@ -95,6 +95,7 @@
153 QCOMPARE(node.m_material->textureId(), (const GLuint)0);
154
155 frame.setMetaData("TextureId", 70001);
156+ frame.setMetaData("SurfaceTextureClient", 0x1);
157 node.setCurrentFrame(frame);
158 QCOMPARE(node.m_material->textureId(), (const GLuint)70001);
159 }

Subscribers

People subscribed via source and target branches