Merge lp:~justinmcp/media-hub/1603729 into lp:media-hub

Proposed by Justin McPherson
Status: Approved
Approved by: Jim Hodapp
Approved revision: 208
Proposed branch: lp:~justinmcp/media-hub/1603729
Merge into: lp:media-hub
Diff against target: 206 lines (+36/-39)
5 files modified
src/core/media/engine.h (+1/-2)
src/core/media/gstreamer/engine.cpp (+2/-8)
src/core/media/gstreamer/engine.h (+1/-2)
src/core/media/player_implementation.cpp (+25/-20)
tests/unit-tests/test-gstreamer-engine.cpp (+7/-7)
To merge this branch: bzr merge lp:~justinmcp/media-hub/1603729
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
Review via email: mp+303097@code.launchpad.net

Commit message

Fix use of custom headers when working with playlists.

Description of the change

Fix use of custom headers when working with playlists.

To post a comment you must log in.
Revision history for this message
Santosh (santoshbit2007) wrote :

I have just looked into code from coding prespective not other aspects. So I have one comment inline.
Its ok from my side if that is correct.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

A couple of comments inline.

review: Needs Fixing (code)
lp:~justinmcp/media-hub/1603729 updated
206. By Justin McPherson

Fix typo.

Revision history for this message
Justin McPherson (justinmcp) :
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Looks good to me. Let me know the silo number and I'll help test this out when it's ready. Thanks man.

review: Approve (code)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

@Santosh, I'll let you top approve once you feel it's good.

Revision history for this message
David Barth (dbarth) wrote :
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Thanks David. I tried to install this silo but it causes my turbo device to
not fully boot. It's most likely that media-hub isn't coming up quite right
which is usually the cause for Unity8 not starting which is what I'm seeing.

On Fri, Aug 19, 2016 at 10:37 AM, David Barth <email address hidden>
wrote:

> @jim: packages now in https://launchpad.net/~ci-
> train-ppa-service/+archive/ubuntu/landing-044/+packages
> --
> https://code.launchpad.net/~justinmcp/media-hub/1603729/+merge/303097
> You are reviewing the proposed merge of lp:~justinmcp/media-hub/1603729
> into lp:media-hub.
>

Revision history for this message
Justin McPherson (justinmcp) wrote :

I've tested this on the devices I have access to; a M10 and a N4. Both boot and work as expected. Both were using OTA-12. Can anyone confirm on other devices?

Revision history for this message
Jim Hodapp (jhodapp) wrote :

I'll test this on a freshly flashed krillin

Revision history for this message
Jim Hodapp (jhodapp) wrote :

This is consistent across both turbo and krillin for me. Both devices no longer boot into Unity8 after installing this silo.

review: Needs Fixing
Revision history for this message
Jim Hodapp (jhodapp) wrote :

This also needs to be re-synced against lp:media-hub as the latest version info has changed from other landings.

lp:~justinmcp/media-hub/1603729 updated
207. By Justin McPherson

Merge from trunk.

208. By Justin McPherson

Fix merge

Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve (code)
lp:~justinmcp/media-hub/1603729 updated
209. By Justin McPherson

Merge from trunk.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

What's the latest on this Justin? Do you plan to get this landed soon?

Revision history for this message
Justin McPherson (justinmcp) wrote :

There was a binary break on trunk, and Oxide needs to be pulled into the silo. I've been working on some urgent tasks, but I'll see if I can push this forward.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Sounds good Justin. Last I checked this was ready to simply hand over to QA to test for regressions and once they mark it as having passed, land it. Should be minimal work for you.

lp:~justinmcp/media-hub/1603729 updated
210. By Justin McPherson

Merge from trunk.

Unmerged revisions

210. By Justin McPherson

Merge from trunk.

209. By Justin McPherson

Merge from trunk.

208. By Justin McPherson

Fix merge

207. By Justin McPherson

Merge from trunk.

206. By Justin McPherson

Fix typo.

205. By Justin McPherson

Add an empty URI to avoid playlist playback when using custom headers

204. By Justin McPherson

Unify versions of open_resource_for_uri().

Create one code path so logic is easily applied to all.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/media/engine.h'
2--- src/core/media/engine.h 2016-08-11 19:09:00 +0000
3+++ src/core/media/engine.h 2016-11-07 23:52:53 +0000
4@@ -76,8 +76,7 @@
5
6 virtual const core::Property<State>& state() const = 0;
7
8- virtual bool open_resource_for_uri(const core::ubuntu::media::Track::UriType& uri, bool do_pipeline_reset) = 0;
9- virtual bool open_resource_for_uri(const core::ubuntu::media::Track::UriType& uri, const Player::HeadersType&) = 0;
10+ virtual bool open_resource_for_uri(const core::ubuntu::media::Track::UriType& uri, const Player::HeadersType&, bool do_pipeline_reset) = 0;
11 // Throws core::ubuntu::media::Player::Error::OutOfProcessBufferStreamingNotSupported if the implementation does not
12 // support this feature.
13 virtual void create_video_sink(uint32_t texture_id) = 0;
14
15=== modified file 'src/core/media/gstreamer/engine.cpp'
16--- src/core/media/gstreamer/engine.cpp 2016-08-23 08:26:11 +0000
17+++ src/core/media/gstreamer/engine.cpp 2016-11-07 23:52:53 +0000
18@@ -433,16 +433,10 @@
19 }
20
21 bool gstreamer::Engine::open_resource_for_uri(const media::Track::UriType& uri,
22+ const core::ubuntu::media::Player::HeadersType& headers,
23 bool do_pipeline_reset)
24 {
25- d->playbin.set_uri(uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset);
26- return true;
27-}
28-
29-bool gstreamer::Engine::open_resource_for_uri(const media::Track::UriType& uri,
30- const core::ubuntu::media::Player::HeadersType& headers)
31-{
32- d->playbin.set_uri(uri, headers);
33+ d->playbin.set_uri(uri, headers, do_pipeline_reset);
34 return true;
35 }
36
37
38=== modified file 'src/core/media/gstreamer/engine.h'
39--- src/core/media/gstreamer/engine.h 2016-08-11 19:09:00 +0000
40+++ src/core/media/gstreamer/engine.h 2016-11-07 23:52:53 +0000
41@@ -33,8 +33,7 @@
42
43 const core::Property<State>& state() const;
44
45- bool open_resource_for_uri(const core::ubuntu::media::Track::UriType& uri, bool do_pipeline_reset);
46- bool open_resource_for_uri(const core::ubuntu::media::Track::UriType& uri, const core::ubuntu::media::Player::HeadersType& headers);
47+ bool open_resource_for_uri(const core::ubuntu::media::Track::UriType& uri, const core::ubuntu::media::Player::HeadersType& headers, bool do_pipeline_reset);
48 void create_video_sink(uint32_t texture_id);
49
50 // use_main_thread will set the pipeline's new state in the main thread context
51
52=== modified file 'src/core/media/player_implementation.cpp'
53--- src/core/media/player_implementation.cpp 2016-08-15 19:27:29 +0000
54+++ src/core/media/player_implementation.cpp 2016-11-07 23:52:53 +0000
55@@ -301,6 +301,26 @@
56 engine->reset();
57 }
58
59+ bool open_uri(const Track::UriType& uri, const Player::HeadersType& headers = Player::HeadersType{})
60+ {
61+ track_list->reset();
62+
63+ // If empty uri, give the same meaning as QMediaPlayer::setMedia("")
64+ if (uri.empty())
65+ {
66+ MH_DEBUG("Resetting current media");
67+ return true;
68+ }
69+
70+ static const bool do_pipeline_reset = false;
71+ const bool ret = engine->open_resource_for_uri(uri, headers, do_pipeline_reset);
72+ // Don't set new track as the current track to play since we're calling open_resource_for_uri above
73+ static const bool make_current = false;
74+ track_list->add_track_with_uri_at(headers.empty() ? uri : "", media::TrackList::after_empty_track(), make_current);
75+
76+ return ret;
77+ }
78+
79 void open_first_track_from_tracklist(const media::Track::Id& id)
80 {
81 const Track::UriType uri = track_list->query_uri_for_track(id);
82@@ -312,7 +332,7 @@
83 uri);
84 MH_INFO("\twith a Track::Id: %s", id);
85 static const bool do_pipeline_reset = false;
86- engine->open_resource_for_uri(uri, do_pipeline_reset);
87+ engine->open_resource_for_uri(uri, Player::HeadersType{}, do_pipeline_reset);
88 }
89 }
90
91@@ -620,7 +640,7 @@
92 {
93 MH_INFO("Advancing to next track on playbin: %s", uri);
94 static const bool do_pipeline_reset = false;
95- d->engine->open_resource_for_uri(uri, do_pipeline_reset);
96+ d->engine->open_resource_for_uri(uri, Player::HeadersType{}, do_pipeline_reset);
97 }
98
99 d->doing_go_to_track.unlock();
100@@ -700,7 +720,7 @@
101 MH_INFO("Setting next track on playbin (on_go_to_track signal): %s", uri);
102 MH_INFO("\twith a Track::Id: %s", id);
103 static const bool do_pipeline_reset = true;
104- d->engine->open_resource_for_uri(uri, do_pipeline_reset);
105+ d->engine->open_resource_for_uri(uri, Player::HeadersType{}, do_pipeline_reset);
106 }
107
108 if (auto_play)
109@@ -854,28 +874,13 @@
110 template<typename Parent>
111 bool media::PlayerImplementation<Parent>::open_uri(const Track::UriType& uri)
112 {
113- d->track_list->reset();
114-
115- // If empty uri, give the same meaning as QMediaPlayer::setMedia("")
116- if (uri.empty())
117- {
118- MH_DEBUG("Resetting current media");
119- return true;
120- }
121-
122- static const bool do_pipeline_reset = false;
123- const bool ret = d->engine->open_resource_for_uri(uri, do_pipeline_reset);
124- // Don't set new track as the current track to play since we're calling open_resource_for_uri above
125- static const bool make_current = false;
126- d->track_list->add_track_with_uri_at(uri, media::TrackList::after_empty_track(), make_current);
127-
128- return ret;
129+ return d->open_uri(uri);
130 }
131
132 template<typename Parent>
133 bool media::PlayerImplementation<Parent>::open_uri(const Track::UriType& uri, const Player::HeadersType& headers)
134 {
135- return d->engine->open_resource_for_uri(uri, headers);
136+ return d->open_uri(uri, headers);
137 }
138
139 template<typename Parent>
140
141=== modified file 'tests/unit-tests/test-gstreamer-engine.cpp'
142--- tests/unit-tests/test-gstreamer-engine.cpp 2016-08-11 19:09:00 +0000
143+++ tests/unit-tests/test-gstreamer-engine.cpp 2016-11-07 23:52:53 +0000
144@@ -104,7 +104,7 @@
145 std::placeholders::_1));
146
147 static const bool do_pipeline_reset = false;
148- EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, do_pipeline_reset));
149+ EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset));
150 static const bool use_main_context = true;
151 EXPECT_TRUE(engine.play(use_main_context));
152 EXPECT_TRUE(wst.wait_for_state_for(
153@@ -147,7 +147,7 @@
154 std::placeholders::_1));
155
156 static const bool do_pipeline_reset = false;
157- EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, do_pipeline_reset));
158+ EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset));
159 static const bool use_main_context = true;
160 EXPECT_TRUE(engine.play(use_main_context));
161 EXPECT_TRUE(wst.wait_for_state_for(
162@@ -208,7 +208,7 @@
163 std::ref(wst),
164 std::placeholders::_1));
165
166- EXPECT_TRUE(engine.open_resource_for_uri(test_audio_uri, headers));
167+ EXPECT_TRUE(engine.open_resource_for_uri(test_audio_uri, headers, false));
168 static const bool use_main_context = true;
169 EXPECT_TRUE(engine.play(use_main_context));
170 EXPECT_TRUE(wst.wait_for_state_for(
171@@ -240,7 +240,7 @@
172 std::placeholders::_1));
173
174 static const bool do_pipeline_reset = true;
175- EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, do_pipeline_reset));
176+ EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset));
177 EXPECT_TRUE(engine.play());
178 EXPECT_TRUE(wst.wait_for_state_for(
179 core::ubuntu::media::Engine::State::playing,
180@@ -289,7 +289,7 @@
181 std::placeholders::_1));
182
183 static const bool do_pipeline_reset = true;
184- EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, do_pipeline_reset));
185+ EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset));
186 EXPECT_TRUE(engine.play());
187 EXPECT_TRUE(wst.wait_for_state_for(
188 core::ubuntu::media::Engine::State::playing,
189@@ -336,7 +336,7 @@
190 std::placeholders::_1));
191
192 static const bool do_pipeline_reset = true;
193- EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, do_pipeline_reset));
194+ EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset));
195 EXPECT_TRUE(engine.play());
196 EXPECT_TRUE(wst.wait_for_state_for(
197 core::ubuntu::media::Engine::State::playing,
198@@ -372,7 +372,7 @@
199 std::ref(wst),
200 std::placeholders::_1));
201 static const bool do_pipeline_reset = true;
202- EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, do_pipeline_reset));
203+ EXPECT_TRUE(engine.open_resource_for_uri(test_file_uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset));
204 EXPECT_TRUE(engine.play());
205 EXPECT_TRUE(wst.wait_for_state_for(
206 core::ubuntu::media::Engine::State::playing,

Subscribers

People subscribed via source and target branches