Merge lp:~phablet-team/qtubuntu-media/fix-1457972 into lp:qtubuntu-media

Proposed by Jim Hodapp on 2015-05-28
Status: Merged
Approved by: Jim Hodapp on 2015-06-02
Approved revision: 80
Merged at revision: 80
Proposed branch: lp:~phablet-team/qtubuntu-media/fix-1457972
Merge into: lp:qtubuntu-media
Diff against target: 78 lines (+21/-4)
3 files modified
src/aal/aalmediaplayerservice.cpp (+7/-3)
src/aal/aalvideorenderercontrol.cpp (+10/-1)
src/aal/aalvideorenderercontrol.h (+4/-0)
To merge this branch: bzr merge lp:~phablet-team/qtubuntu-media/fix-1457972
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-06-02
Nick Dedekind (community) 2015-05-28 Approve on 2015-06-02
Review via email: mp+260520@code.launchpad.net

Commit Message

Don't auto play when playing a video unless QMediaPlayerControl::play() was actually called.

Description of the Change

Don't auto play when playing a video unless QMediaPlayerControl::play() was actually called.

To post a comment you must log in.
Nick Dedekind (nick-dedekind) wrote :

I'm not entirely sure what's going on here.

The MediaPlayer is calling AalMediaPlayerControl::play, which calls AalMediaPlayerService::play.
the AalMediaPlayerService::play then calls AalVideoRendererControl::autoplay(true)

Then, when AalVideoRendererControl::onGLConsumerSet gets called (not entirely sure when this comes around), it calls AalMediaPlayerService::play again... ?

review: Needs Information
Jim Hodapp (jhodapp) wrote :

Addressed comment in private chat.

Nick Dedekind (nick-dedekind) wrote :

Working for me now.

review: Approve
77. By Jim Hodapp on 2015-06-02

Make sure we only use m_videoOutput if isVideoSource and it's not NULL

78. By Jim Hodapp on 2015-06-02

Merged trunk.

79. By Jim Hodapp on 2015-06-02

Merged with trunk.

80. By Jim Hodapp on 2015-06-02

Merged trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/aal/aalmediaplayerservice.cpp'
2--- src/aal/aalmediaplayerservice.cpp 2015-05-27 15:00:53 +0000
3+++ src/aal/aalmediaplayerservice.cpp 2015-06-02 19:37:07 +0000
4@@ -270,9 +270,13 @@
5 return;
6 }
7
8- if (isVideoSource()
9- && !m_firstPlayback && m_videoOutput != NULL)
10- m_videoOutput->setupSurface();
11+ if (isVideoSource() && m_videoOutput != NULL)
12+ {
13+ m_videoOutput->autoPlay(true);
14+
15+ if (!m_firstPlayback)
16+ m_videoOutput->setupSurface();
17+ }
18
19 // If we previously played and hit the end-of-stream, stop will be called which
20 // tears down the video sink. We need a new video sink in order to render video again
21
22=== modified file 'src/aal/aalvideorenderercontrol.cpp'
23--- src/aal/aalvideorenderercontrol.cpp 2015-03-16 19:58:06 +0000
24+++ src/aal/aalvideorenderercontrol.cpp 2015-06-02 19:37:07 +0000
25@@ -89,6 +89,7 @@
26 m_orientation(media::Player::Orientation::rotate0),
27 m_height(0),
28 m_width(0),
29+ m_autoPlay(false),
30 m_surfaceStarted(false),
31 m_flipped(false),
32 m_doRendering(false),
33@@ -153,6 +154,11 @@
34 return m_width;
35 }
36
37+void AalVideoRendererControl::autoPlay(bool doAutoPlay)
38+{
39+ m_autoPlay = doAutoPlay;
40+}
41+
42 void AalVideoRendererControl::playbackComplete()
43 {
44 qDebug() << Q_FUNC_INFO;
45@@ -290,7 +296,10 @@
46 void AalVideoRendererControl::onGLConsumerSet()
47 {
48 qDebug() << Q_FUNC_INFO;
49- m_service->play();
50+ // Only cause playback to start if QMediaPlayerControl::play() was already called.
51+ // See AalMediaPlayerService::play()
52+ if (m_autoPlay)
53+ m_service->play();
54 }
55
56 void AalVideoRendererControl::presentVideoFrame(const QVideoFrame &frame, bool empty)
57
58=== modified file 'src/aal/aalvideorenderercontrol.h'
59--- src/aal/aalvideorenderercontrol.h 2015-03-16 19:58:06 +0000
60+++ src/aal/aalvideorenderercontrol.h 2015-06-02 19:37:07 +0000
61@@ -58,6 +58,9 @@
62 uint32_t height() const;
63 uint32_t width() const;
64
65+ // Whether QMediaPlayerService::play() will be called from onGLConsumerSet or not
66+ void autoPlay(bool doAutoPlay = true);
67+
68 // Callbacks
69 static void updateVideoTextureCb(void *context);
70
71@@ -88,6 +91,7 @@
72 core::ubuntu::media::Player::Orientation m_orientation;
73 uint32_t m_height;
74 uint32_t m_width;
75+ bool m_autoPlay;
76 bool m_surfaceStarted;
77 bool m_flipped;
78 bool m_doRendering;

Subscribers

People subscribed via source and target branches

to all changes: