Merge lp:~thomas-voss/media-hub/disconnect-signal-translation-layer-on-destruction into lp:media-hub

Proposed by Thomas Voß
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 91
Merged at revision: 89
Proposed branch: lp:~thomas-voss/media-hub/disconnect-signal-translation-layer-on-destruction
Merge into: lp:media-hub
Diff against target: 75 lines (+18/-18)
2 files modified
debian/control (+1/-1)
src/core/media/player_stub.cpp (+17/-17)
To merge this branch: bzr merge lp:~thomas-voss/media-hub/disconnect-signal-translation-layer-on-destruction
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
Alberto Aguirre (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+240413@code.launchpad.net

Commit message

Disconnect signal translation layer on destruction.

Description of the change

Disconnect signal translation layer on destruction.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
88. By Thomas Voß

Init disconnect tokens on construction.

89. By Thomas Voß

Add missing ,.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

You can achieve the same effect by changing the position of struct dbus to be the last element in Signals, but this works too.

review: Approve
90. By Thomas Voß

Ensure remote signals are destroyed first.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
91. By Thomas Voß

Bump build-dep version on dbus-cpp.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Yep.

review: Approve
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-10-23 21:25:38 +0000
3+++ debian/control 2014-11-05 07:41:46 +0000
4@@ -20,7 +20,7 @@
5 libboost-program-options-dev (>=1.53),
6 libboost-system-dev (>=1.53),
7 libdbus-1-dev,
8- libdbus-cpp-dev (>= 4.1.0),
9+ libdbus-cpp-dev (>= 4.2.0),
10 libgoogle-glog-dev,
11 libhybris-dev (>=0.1.0+git20131207+e452e83-0ubuntu28),
12 libprocess-cpp-dev,
13
14=== modified file 'src/core/media/player_stub.cpp'
15--- src/core/media/player_stub.cpp 2014-10-22 20:08:22 +0000
16+++ src/core/media/player_stub.cpp 2014-11-05 07:41:46 +0000
17@@ -179,19 +179,19 @@
18 const std::shared_ptr<DBusEndOfStreamSignal>& eos,
19 const std::shared_ptr<DBusPlaybackStatusChangedSignal>& status,
20 const std::shared_ptr<DBusVideoDimensionChangedSignal>& d)
21- : dbus
22+ : playback_complete_cb(nullptr),
23+ playback_complete_context(nullptr),
24+ seeked_to(),
25+ end_of_stream(),
26+ playback_status_changed(),
27+ video_dimension_changed(),
28+ dbus
29 {
30 seeked,
31 eos,
32 status,
33 d
34- },
35- playback_complete_cb(nullptr),
36- playback_complete_context(nullptr),
37- seeked_to(),
38- end_of_stream(),
39- playback_status_changed(),
40- video_dimension_changed()
41+ }
42 {
43 dbus.seeked_to->connect([this](std::uint64_t value)
44 {
45@@ -218,15 +218,7 @@
46 std::cout << "VideoDimensionChanged signal arrived via the bus." << std::endl;
47 video_dimension_changed(mask);
48 });
49- }
50-
51- struct DBus
52- {
53- std::shared_ptr<DBusSeekedToSignal> seeked_to;
54- std::shared_ptr<DBusEndOfStreamSignal> end_of_stream;
55- std::shared_ptr<DBusPlaybackStatusChangedSignal> playback_status_changed;
56- std::shared_ptr<DBusVideoDimensionChangedSignal> video_dimension_changed;
57- } dbus;
58+ }
59
60 void set_playback_complete_cb(PlaybackCompleteCb cb, void *context)
61 {
62@@ -240,6 +232,14 @@
63 core::Signal<void> end_of_stream;
64 core::Signal<media::Player::PlaybackStatus> playback_status_changed;
65 core::Signal<uint64_t> video_dimension_changed;
66+
67+ struct DBus
68+ {
69+ std::shared_ptr<DBusSeekedToSignal> seeked_to;
70+ std::shared_ptr<DBusEndOfStreamSignal> end_of_stream;
71+ std::shared_ptr<DBusPlaybackStatusChangedSignal> playback_status_changed;
72+ std::shared_ptr<DBusVideoDimensionChangedSignal> video_dimension_changed;
73+ } dbus;
74 } signals;
75 };
76

Subscribers

People subscribed via source and target branches