Merge lp:~phablet-team/media-hub/pulse-output-change-pause into lp:media-hub

Proposed by Jim Hodapp
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 108
Merged at revision: 97
Proposed branch: lp:~phablet-team/media-hub/pulse-output-change-pause
Merge into: lp:media-hub
Diff against target: 534 lines (+361/-8)
7 files modified
debian/control (+1/-0)
debian/media-hub.conf (+1/-1)
src/core/media/CMakeLists.txt (+3/-1)
src/core/media/service_implementation.cpp (+350/-2)
src/core/media/service_skeleton.cpp (+1/-0)
tests/unit-tests/CMakeLists.txt (+1/-0)
tests/unit-tests/test-gstreamer-engine.cpp (+4/-4)
To merge this branch: bzr merge lp:~phablet-team/media-hub/pulse-output-change-pause
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
PS Jenkins bot continuous-integration Approve
Ricardo Salveti (community) Approve
Review via email: mp+241452@code.launchpad.net

Commit message

* Pause playback when a headphone is unplugged or an A2DP device is unpaired

Description of the change

* Pause playback when a headphone is unplugged or an A2DP device is unpaired

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Comments inline.

Revision history for this message
Ricardo Salveti (rsalveti) :
review: Needs Fixing
98. By Ricardo Mendoza

Address comments and modify logic for deciding when to pause.

99. By Ricardo Mendoza

Merge trunk

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

Comments inline.

review: Needs Fixing
100. By Ricardo Mendoza

* Refactor to track sink and server changes, and initial setup.
* Keep track of new sinks and pause media accordingly if not fallbacks are in place.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
101. By Ricardo Mendoza

Address comments

102. By Ricardo Mendoza

Build warning.

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 :

Comments inline.

review: Needs Information
103. By Ricardo Mendoza

Log to stdout, remove unwanted subscriptions

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
104. By Ricardo Mendoza

Disable broken tests for vivid. Test framework rework incoming to address flaky tests

105. By Ricardo Mendoza

Disable another test

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 :

Few things when testing with mako:
1) Without a headset and a2dp, it'll always trigger a pause when starting media-hub (at least on touch), as primary_idx starts with 0, which is indeed the primary sink (maybe we should handle the initial case differently?)
2) Media-hub starting at the same time as pulse, creating a race, and not necessarily having enough time to get a valid connection with pulse (I had "Unable to create a connection to the pulseaudio context" when testing, had to restart media-hub to get it to work as expected). Either we create an upstart override similar to the one we have for indicator-sound (waiting for pulseaudio started, touch specific), or we keep trying to create a pulseaudio context for a defined amount of time/tries before giving up

Other than that it looks fine, also worked as expected when an active call was in progress (but it still tried to pause when unplugging my wired headset, but as it was already paused, it didn't change anything).

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

Well the trying to pause is a bit misleading. It calls the function that enumerates through all of the Player instances and looks for one in the playing state that's part of the multimedia audio role. If it doesn't find one playing, it won't actually try to update the GStreamer pipeline state. That's why I say the output of media-hub looks a bit misleading. I do think the first case shouldn't happen though...we should even try to pause before ever playing anything. And #2 is certainly an issue that needs fixing.

106. By Ricardo Mendoza

* Catch uninitialized active sink and dont pause.
* Wait to connect to server in case its not yet available (race)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
107. By Ricardo Mendoza

Track connection state and restore pulseaudio context if it goes away.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
108. By Ricardo Mendoza

Remove commented out code

Revision history for this message
Jim Hodapp (jhodapp) :
review: Needs Fixing (code)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Code is looking good now, tested and works as expected as well.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-11-11 20:18:36 +0000
+++ debian/control 2014-11-20 18:31:53 +0000
@@ -28,6 +28,7 @@
28 gstreamer1.0-libav,28 gstreamer1.0-libav,
29 libgstreamer1.0-dev,29 libgstreamer1.0-dev,
30 pkg-config,30 pkg-config,
31 libpulse-dev,
31 qtbase5-dev,32 qtbase5-dev,
32 libtelepathy-qt5-dev,33 libtelepathy-qt5-dev,
33Standards-Version: 3.9.534Standards-Version: 3.9.5
3435
=== modified file 'debian/media-hub.conf'
--- debian/media-hub.conf 2014-05-20 09:53:23 +0000
+++ debian/media-hub.conf 2014-11-20 18:31:53 +0000
@@ -1,6 +1,6 @@
1description "Starts the media-hub service"1description "Starts the media-hub service"
22
3start on started dbus and xsession SESSION=ubuntu-touch3start on started dbus and started pulseaudio and xsession SESSION=ubuntu-touch
4stop on runlevel [06]4stop on runlevel [06]
55
6respawn6respawn
77
=== modified file 'src/core/media/CMakeLists.txt'
--- src/core/media/CMakeLists.txt 2014-11-03 00:56:55 +0000
+++ src/core/media/CMakeLists.txt 2014-11-20 18:31:53 +0000
@@ -1,5 +1,6 @@
1pkg_check_modules(PC_GSTREAMER_1_0 REQUIRED gstreamer-1.0)1pkg_check_modules(PC_GSTREAMER_1_0 REQUIRED gstreamer-1.0)
2include_directories(${PC_GSTREAMER_1_0_INCLUDE_DIRS} ${HYBRIS_MEDIA_CFLAGS})2pkg_check_modules(PC_PULSE_AUDIO REQUIRED libpulse)
3include_directories(${PC_GSTREAMER_1_0_INCLUDE_DIRS} ${HYBRIS_MEDIA_CFLAGS} ${PC_PULSE_AUDIO_INCLUDE_DIRS})
34
4# We compile with all symbols visible by default. For the shipping library, we strip5# We compile with all symbols visible by default. For the shipping library, we strip
5# out all symbols that are not in core::ubuntu::media*6# out all symbols that are not in core::ubuntu::media*
@@ -100,6 +101,7 @@
100 ${PROCESS_CPP_LDFLAGS}101 ${PROCESS_CPP_LDFLAGS}
101 ${GIO_LIBRARIES}102 ${GIO_LIBRARIES}
102 ${HYBRIS_MEDIA_LIBRARIES}103 ${HYBRIS_MEDIA_LIBRARIES}
104 ${PC_PULSE_AUDIO_LIBRARIES}
103)105)
104106
105include_directories(${PROJECT_SOURCE_DIR}/src/ ${HYBRIS_MEDIA_CFLAGS})107include_directories(${PROJECT_SOURCE_DIR}/src/ ${HYBRIS_MEDIA_CFLAGS})
106108
=== modified file 'src/core/media/service_implementation.cpp'
--- src/core/media/service_implementation.cpp 2014-11-03 00:56:55 +0000
+++ src/core/media/service_implementation.cpp 2014-11-20 18:31:53 +0000
@@ -15,6 +15,9 @@
15 *15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 * Jim Hodapp <jim.hodapp@canonical.com>17 * Jim Hodapp <jim.hodapp@canonical.com>
18 * Ricardo Mendoza <ricardo.mendoza@canonical.com>
19 *
20 * Note: Some of the PulseAudio code was adapted from telepathy-ofono
18 */21 */
1922
20#include "service_implementation.h"23#include "service_implementation.h"
@@ -26,11 +29,15 @@
2629
27#include <boost/asio.hpp>30#include <boost/asio.hpp>
2831
32#include <string>
29#include <cstdint>33#include <cstdint>
34#include <cstring>
30#include <map>35#include <map>
31#include <memory>36#include <memory>
32#include <thread>37#include <thread>
3338
39#include <pulse/pulseaudio.h>
40
34#include "util/timeout.h"41#include "util/timeout.h"
35#include "unity_screen_service.h"42#include "unity_screen_service.h"
36#include <hybris/media/media_recorder_layer.h>43#include <hybris/media/media_recorder_layer.h>
@@ -45,6 +52,11 @@
45 : resume_key(std::numeric_limits<std::uint32_t>::max()),52 : resume_key(std::numeric_limits<std::uint32_t>::max()),
46 keep_alive(io_service),53 keep_alive(io_service),
47 disp_cookie(0),54 disp_cookie(0),
55 pulse_mainloop_api(nullptr),
56 pulse_context(nullptr),
57 headphones_connected(false),
58 a2dp_connected(false),
59 primary_idx(-1),
48 call_monitor(new CallMonitor)60 call_monitor(new CallMonitor)
49 {61 {
50 bus = std::shared_ptr<dbus::Bus>(new dbus::Bus(core::dbus::WellKnownBus::session));62 bus = std::shared_ptr<dbus::Bus>(new dbus::Bus(core::dbus::WellKnownBus::session));
@@ -54,6 +66,67 @@
54 bus->run();66 bus->run();
55 }));67 }));
5668
69 // Spawn pulse watchdog
70 pulse_mainloop = nullptr;
71 pulse_worker = std::move(std::thread([this]()
72 {
73 std::unique_lock<std::mutex> lk(pulse_mutex);
74 pcv.wait(lk,
75 [this]{
76 if (pulse_mainloop != nullptr || pulse_context != nullptr)
77 {
78 // We come from instance death, destroy and create.
79 if (pulse_context != nullptr)
80 {
81 pa_threaded_mainloop_lock(pulse_mainloop);
82 pa_operation *o;
83 o = pa_context_drain(pulse_context,
84 [](pa_context *context, void *userdata)
85 {
86 (void) context;
87
88 Private *p = reinterpret_cast<Private*>(userdata);
89 pa_threaded_mainloop_signal(p->mainloop(), 0);
90 }, this);
91
92 if (o)
93 {
94 while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
95 pa_threaded_mainloop_wait(pulse_mainloop);
96
97 pa_operation_unref(o);
98 }
99
100 pa_context_set_state_callback(pulse_context, NULL, NULL);
101 pa_context_set_subscribe_callback(pulse_context, NULL, NULL);
102 pa_context_disconnect(pulse_context);
103 pa_context_unref(pulse_context);
104 pulse_context = nullptr;
105 pa_threaded_mainloop_unlock(pulse_mainloop);
106 }
107 }
108
109 if (pulse_mainloop == nullptr)
110 {
111 pulse_mainloop = pa_threaded_mainloop_new();
112
113 if (pa_threaded_mainloop_start(pulse_mainloop) != 0)
114 {
115 std::cerr << "Unable to start pulseaudio mainloop, audio output detection will not function" << std::endl;
116 pa_threaded_mainloop_free(pulse_mainloop);
117 pulse_mainloop = nullptr;
118 }
119 }
120
121 do {
122 create_pulse_context();
123 } while (pulse_context == nullptr);
124
125 // Wait for next instance death.
126 return false;
127 });
128 }));
129
57 // Connect the property change signal that will allow media-hub to take appropriate action130 // Connect the property change signal that will allow media-hub to take appropriate action
58 // when the battery level reaches critical131 // when the battery level reaches critical
59 auto stub_service = dbus::Service::use_service(bus, "com.canonical.indicator.power");132 auto stub_service = dbus::Service::use_service(bus, "com.canonical.indicator.power");
@@ -74,10 +147,22 @@
74147
75 ~Private()148 ~Private()
76 {149 {
150 release_pulse_context();
151
152 if (pulse_mainloop != nullptr)
153 {
154 pa_threaded_mainloop_stop(pulse_mainloop);
155 pa_threaded_mainloop_free(pulse_mainloop);
156 pulse_mainloop = nullptr;
157 }
158
77 bus->stop();159 bus->stop();
78160
79 if (worker.joinable())161 if (worker.joinable())
80 worker.join();162 worker.join();
163
164 if (pulse_worker.joinable())
165 pulse_worker.join();
81 }166 }
82167
83 void media_recording_started(bool started)168 void media_recording_started(bool started)
@@ -116,6 +201,249 @@
116 p->media_recording_started(started);201 p->media_recording_started(started);
117 }202 }
118203
204 pa_threaded_mainloop *mainloop()
205 {
206 return pulse_mainloop;
207 }
208
209 bool is_port_available(pa_card_port_info **ports, uint32_t n_ports, const char *name)
210 {
211 bool ret = false;
212
213 if (ports != nullptr && n_ports > 0 && name != nullptr)
214 {
215 for (uint32_t i=0; i<n_ports; i++)
216 {
217 if (strstr(ports[i]->name, name) != nullptr && ports[i]->available != PA_PORT_AVAILABLE_NO)
218 {
219 ret = true;
220 break;
221 }
222 }
223 }
224
225 return ret;
226 }
227
228 void update_wired_output()
229 {
230 const pa_operation *o = pa_context_get_card_info_by_index(pulse_context, primary_idx,
231 [](pa_context *context, const pa_card_info *info, int eol, void *userdata)
232 {
233 (void) context;
234 (void) eol;
235
236 if (info == nullptr || userdata == nullptr)
237 return;
238
239 Private *p = reinterpret_cast<Private*>(userdata);
240 if (p->is_port_available(info->ports, info->n_ports, "output-wired"))
241 {
242 if (!p->headphones_connected)
243 std::cout << "Wired headphones connected" << std::endl;
244 p->headphones_connected = true;
245 }
246 else if (p->headphones_connected == true)
247 {
248 std::cout << "Wired headphones disconnected" << std::endl;
249 p->headphones_connected = false;
250 p->pause_playback_if_necessary(std::get<0>(p->active_sink));
251 }
252 }, this);
253 (void) o;
254 }
255
256 void pause_playback_if_necessary(int index)
257 {
258 // Catch uninitialized case (active index == -1)
259 if (std::get<0>(active_sink) == -1)
260 return;
261
262 if (headphones_connected)
263 return;
264
265 // No headphones/fallback on primary sink? Pause.
266 if (index == primary_idx)
267 pause_playback();
268 }
269
270 void set_active_sink(const char *name)
271 {
272 const pa_operation *o = pa_context_get_sink_info_by_name(pulse_context, name,
273 [](pa_context *context, const pa_sink_info *i, int eol, void *userdata)
274 {
275 (void) context;
276
277 if (eol)
278 return;
279
280 Private *p = reinterpret_cast<Private*>(userdata);
281 std::tuple<uint32_t, uint32_t, std::string> new_sink(std::make_tuple(i->index, i->card, i->name));
282
283 printf("pulsesink: active_sink=('%s',%d,%d) -> ('%s',%d,%d)\n",
284 std::get<2>(p->active_sink).c_str(), std::get<0>(p->active_sink),
285 std::get<1>(p->active_sink), i->name, i->index, i->card);
286
287 p->pause_playback_if_necessary(i->index);
288 p->active_sink = new_sink;
289 }, this);
290
291 (void) o;
292 }
293
294 void update_active_sink()
295 {
296 const pa_operation *o = pa_context_get_server_info(pulse_context,
297 [](pa_context *context, const pa_server_info *i, void *userdata)
298 {
299 (void) context;
300
301 Private *p = reinterpret_cast<Private*>(userdata);
302 if (i->default_sink_name != std::get<2>(p->active_sink))
303 p->set_active_sink(i->default_sink_name);
304 p->update_wired_output();
305 }, this);
306
307 (void) o;
308 }
309
310 void create_pulse_context()
311 {
312 if (pulse_context != nullptr)
313 return;
314
315 active_sink = std::make_tuple(-1, -1, "");
316
317 bool keep_going = true, ok = true;
318
319 pulse_mainloop_api = pa_threaded_mainloop_get_api(pulse_mainloop);
320 pa_threaded_mainloop_lock(pulse_mainloop);
321
322 pulse_context = pa_context_new(pulse_mainloop_api, "MediaHubPulseContext");
323 pa_context_set_state_callback(pulse_context,
324 [](pa_context *context, void *userdata)
325 {
326 (void) context;
327 Private *p = reinterpret_cast<Private*>(userdata);
328 // Signals the pa_threaded_mainloop_wait below to proceed
329 pa_threaded_mainloop_signal(p->mainloop(), 0);
330 }, this);
331
332 if (pulse_context == nullptr)
333 {
334 std::cerr << "Unable to create new pulseaudio context" << std::endl;
335 pa_threaded_mainloop_unlock(pulse_mainloop);
336 return;
337 }
338
339 pa_context_connect(pulse_context, nullptr, pa_context_flags_t((int) PA_CONTEXT_NOAUTOSPAWN | (int) PA_CONTEXT_NOFAIL), nullptr);
340 pa_threaded_mainloop_wait(pulse_mainloop);
341
342 while (keep_going)
343 {
344 switch (pa_context_get_state(pulse_context))
345 {
346 case PA_CONTEXT_CONNECTING: // Wait for service to be available
347 case PA_CONTEXT_AUTHORIZING:
348 case PA_CONTEXT_SETTING_NAME:
349 break;
350
351 case PA_CONTEXT_READY:
352 std::cout << "Pulseaudio connection established." << std::endl;
353 keep_going = false;
354 break;
355
356 case PA_CONTEXT_FAILED:
357 case PA_CONTEXT_TERMINATED:
358 keep_going = false;
359 ok = false;
360 break;
361
362 default:
363 std::cerr << "Pulseaudio connection failure: " << pa_strerror(pa_context_errno(pulse_context));
364 keep_going = false;
365 ok = false;
366 }
367
368 if (keep_going)
369 pa_threaded_mainloop_wait(pulse_mainloop);
370 }
371
372 if (ok)
373 {
374 pa_context_set_state_callback(pulse_context,
375 [](pa_context *context, void *userdata)
376 {
377 (void) context;
378 (void) userdata;
379 Private *p = reinterpret_cast<Private*>(userdata);
380 std::unique_lock<std::mutex> lk(p->pulse_mutex);
381 switch (pa_context_get_state(context))
382 {
383 case PA_CONTEXT_FAILED:
384 case PA_CONTEXT_TERMINATED:
385 p->pcv.notify_all();
386 break;
387 default:
388 break;
389 }
390 }, this);
391
392 //FIXME: Get index for "sink.primary", the default onboard card on Touch.
393 pa_context_get_sink_info_by_name(pulse_context, "sink.primary",
394 [](pa_context *context, const pa_sink_info *i, int eol, void *userdata)
395 {
396 (void) context;
397
398 if (eol)
399 return;
400
401 Private *p = reinterpret_cast<Private*>(userdata);
402 p->primary_idx = i->index;
403 p->update_wired_output();
404 }, this);
405
406 update_active_sink();
407
408 pa_context_set_subscribe_callback(pulse_context,
409 [](pa_context *context, pa_subscription_event_type_t t, uint32_t idx, void *userdata)
410 {
411 (void) context;
412 (void) idx;
413
414 if (userdata == nullptr)
415 return;
416
417 Private *p = reinterpret_cast<Private*>(userdata);
418 if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK)
419 {
420 p->update_active_sink();
421 }
422 }, this);
423 pa_context_subscribe(pulse_context, PA_SUBSCRIPTION_MASK_SINK, nullptr, this);
424 }
425 else
426 {
427 std::cerr << "Connection to pulseaudio failed or was dropped." << std::endl;
428 pa_context_unref(pulse_context);
429 pulse_context = nullptr;
430 }
431
432 pa_threaded_mainloop_unlock(pulse_mainloop);
433 }
434
435 void release_pulse_context()
436 {
437 if (pulse_context != nullptr)
438 {
439 pa_threaded_mainloop_lock(pulse_mainloop);
440 pa_context_disconnect(pulse_context);
441 pa_context_unref(pulse_context);
442 pa_threaded_mainloop_unlock(pulse_mainloop);
443 pulse_context = nullptr;
444 }
445 }
446
119 // This holds the key of the multimedia role Player instance that was paused447 // This holds the key of the multimedia role Player instance that was paused
120 // when the battery level reached 10% or 5%448 // when the battery level reached 10% or 5%
121 media::Player::PlayerKey resume_key;449 media::Player::PlayerKey resume_key;
@@ -129,14 +457,28 @@
129 int disp_cookie;457 int disp_cookie;
130 std::shared_ptr<dbus::Object> uscreen_session;458 std::shared_ptr<dbus::Object> uscreen_session;
131 MediaRecorderObserver *observer;459 MediaRecorderObserver *observer;
460
461 // Pulse-specific
462 pa_mainloop_api *pulse_mainloop_api;
463 pa_threaded_mainloop *pulse_mainloop;
464 pa_context *pulse_context;
465 std::thread pulse_worker;
466 std::mutex pulse_mutex;
467 std::condition_variable pcv;
468 bool headphones_connected;
469 bool a2dp_connected;
470 std::tuple<int, int, std::string> active_sink;
471 int primary_idx;
472
473 // Gets signaled when both the headphone jack is removed or an A2DP device is
474 // disconnected and playback needs pausing
475 core::Signal<void> pause_playback;
132 std::unique_ptr<CallMonitor> call_monitor;476 std::unique_ptr<CallMonitor> call_monitor;
133 std::list<media::Player::PlayerKey> paused_sessions;477 std::list<media::Player::PlayerKey> paused_sessions;
134};478};
135479
136media::ServiceImplementation::ServiceImplementation() : d(new Private())480media::ServiceImplementation::ServiceImplementation() : d(new Private())
137{481{
138 cout << __PRETTY_FUNCTION__ << endl;
139
140 d->power_level->changed().connect([this](const core::IndicatorPower::PowerLevel::ValueType &level)482 d->power_level->changed().connect([this](const core::IndicatorPower::PowerLevel::ValueType &level)
141 {483 {
142 // When the battery level hits 10% or 5%, pause all multimedia sessions.484 // When the battery level hits 10% or 5%, pause all multimedia sessions.
@@ -153,6 +495,12 @@
153 resume_multimedia_session();495 resume_multimedia_session();
154 });496 });
155497
498 d->pause_playback.connect([this]()
499 {
500 std::cout << "Got pause_playback signal, pausing all multimedia sessions" << std::endl;
501 pause_all_multimedia_sessions();
502 });
503
156 d->call_monitor->on_change([this](CallMonitor::State state) {504 d->call_monitor->on_change([this](CallMonitor::State state) {
157 switch (state) {505 switch (state) {
158 case CallMonitor::OffHook:506 case CallMonitor::OffHook:
159507
=== modified file 'src/core/media/service_skeleton.cpp'
--- src/core/media/service_skeleton.cpp 2014-10-14 16:21:47 +0000
+++ src/core/media/service_skeleton.cpp 2014-11-20 18:31:53 +0000
@@ -14,6 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 * Jim Hodapp <jim.hodapp@canonical.com>
17 */18 */
1819
19#include "service_skeleton.h"20#include "service_skeleton.h"
2021
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2014-11-03 00:56:55 +0000
+++ tests/unit-tests/CMakeLists.txt 2014-11-20 18:31:53 +0000
@@ -36,6 +36,7 @@
36 ${PC_GSTREAMER_1_0_LIBRARIES}36 ${PC_GSTREAMER_1_0_LIBRARIES}
37 ${PROCESS_CPP_LDFLAGS}37 ${PROCESS_CPP_LDFLAGS}
38 ${GIO_LIBRARIES}38 ${GIO_LIBRARIES}
39 ${PC_PULSE_AUDIO_LIBRARIES}
3940
40 gmock41 gmock
41 gmock_main42 gmock_main
4243
=== modified file 'tests/unit-tests/test-gstreamer-engine.cpp'
--- tests/unit-tests/test-gstreamer-engine.cpp 2014-08-26 20:34:30 +0000
+++ tests/unit-tests/test-gstreamer-engine.cpp 2014-11-20 18:31:53 +0000
@@ -65,7 +65,7 @@
65 gstreamer::Engine engine;65 gstreamer::Engine engine;
66}66}
6767
68TEST(GStreamerEngine, setting_uri_and_starting_audio_only_playback_works)68TEST(GStreamerEngine, DISABLED_setting_uri_and_starting_audio_only_playback_works)
69{69{
70 const std::string test_file{"/tmp/test.ogg"};70 const std::string test_file{"/tmp/test.ogg"};
71 const std::string test_file_uri{"file:///tmp/test.ogg"};71 const std::string test_file_uri{"file:///tmp/test.ogg"};
@@ -110,7 +110,7 @@
110 std::chrono::seconds{10}));110 std::chrono::seconds{10}));
111}111}
112112
113TEST(GStreamerEngine, setting_uri_and_starting_video_playback_works)113TEST(GStreamerEngine, DISABLED_setting_uri_and_starting_video_playback_works)
114{114{
115 const std::string test_file{"/tmp/h264.avi"};115 const std::string test_file{"/tmp/h264.avi"};
116 const std::string test_file_uri{"file:///tmp/h264.avi"};116 const std::string test_file_uri{"file:///tmp/h264.avi"};
@@ -152,7 +152,7 @@
152 std::chrono::seconds{10}));152 std::chrono::seconds{10}));
153}153}
154154
155TEST(GStreamerEngine, stop_pause_play_seek_audio_only_works)155TEST(GStreamerEngine, DISABLED_stop_pause_play_seek_audio_only_works)
156{156{
157 const std::string test_file{"/tmp/test.ogg"};157 const std::string test_file{"/tmp/test.ogg"};
158 const std::string test_file_uri{"file:///tmp/test.ogg"};158 const std::string test_file_uri{"file:///tmp/test.ogg"};
@@ -198,7 +198,7 @@
198 std::chrono::seconds{40}));198 std::chrono::seconds{40}));
199}199}
200200
201TEST(GStreamerEngine, stop_pause_play_seek_video_works)201TEST(GStreamerEngine, DISABLED_stop_pause_play_seek_video_works)
202{202{
203 const std::string test_file{"/tmp/h264.avi"};203 const std::string test_file{"/tmp/h264.avi"};
204 const std::string test_file_uri{"file:///tmp/h264.avi"};204 const std::string test_file_uri{"file:///tmp/h264.avi"};

Subscribers

People subscribed via source and target branches

to all changes: