~ubuntu-branches/ubuntu/vivid/media-hub/vivid-updates

« back to all changes in this revision

Viewing changes to src/core/media/null_track_list.h

  • Committer: Package Import Robot
  • Author(s): CI Train Bot, Thomas Voss, CI Train Bot, Jim Hodapp, Ricardo Mendoza, Ricardo Salveti de Araujo, thomas-voss
  • Date: 2015-03-20 13:16:48 UTC
  • mfrom: (1.1.34)
  • Revision ID: package-import@ubuntu.com-20150320131648-dv8aynyyjib9v2sr
Tags: 3.0.0+15.04.20150320-0ubuntu1
[ Thomas Voss ]
* Refactor client-facing interfaces to pull out explicit dependency on hybris-based media layer.

[ CI Train Bot ]
* New rebuild forced.

[ Jim Hodapp ]
* Disconnect playback_status_changed_signal in ~Private() to avoid a
  deadlock.
* Prevent a 0 position from being reported to the app which happens
  while seeking. Covers bad behavior that happens from GStreamer. Also
  expose the about_to_finish signal to the client. Enable playback
  again after manually seeking all the way to EOS. Also only send
  VideoDimensionsChanged signal only when necessary.

[ Ricardo Mendoza ]
* Add an interface apparmor::ubuntu::RequestAuthenticator that is used
  to authenticate incoming open uri requests. Add an interface
  apparmor::ubuntu::RequestContextResolver that is used to resolve a
  dbus name to an apparmor::ubuntu::Context. Provide an implementation
  apparmor::ubuntu::ExistingAuthenticator that takes the impl. from
  player_skeleton.cpp and uses it to implement the interface. Provide
  an implementation apparmor::ubuntu::RequestContextResolver that
  reaches out to the dbus daemon to resolve a given bus name to an
  apparmor profile. Remove obsolete query for the apparmor profile in
  ServiceSkeleton. Adjust the implementation in media::PlayerSkeleton
  to rely on Request{Authenticator, ContextResolver}. removed:
  src/core/media/apparmor.h added: src/core/media/apparmor/
  src/core/media/apparmor/context.cpp
  src/core/media/apparmor/context.h src/core/media/apparmor/dbus.h
  src/core/media/apparmor/ubuntu.cpp src/core/media/apparmor/ubuntu.h
* Introduce an interface media::audio::OutputObserver that allows the
  core classes to observer the state of external audio outputs
  (headphones/headsets). Provide an implementation of
  media::audio::OutputObserver that relies on Pulseaudio to monitor
  the availability of ports on the default sink. Adjust
  media::ServiceImplementation to use media::audio::OutputObserver,
  defaulting to media::audio::PulseAudioOutputObserver.
* Migrate all Player DBus methods to use transact_method() instead of
  invoke_method_synchronously(), to prevent bus executor deadlocks.

[ Ricardo Salveti de Araujo ]
* Add an interface apparmor::ubuntu::RequestAuthenticator that is used
  to authenticate incoming open uri requests. Add an interface
  apparmor::ubuntu::RequestContextResolver that is used to resolve a
  dbus name to an apparmor::ubuntu::Context. Provide an implementation
  apparmor::ubuntu::ExistingAuthenticator that takes the impl. from
  player_skeleton.cpp and uses it to implement the interface. Provide
  an implementation apparmor::ubuntu::RequestContextResolver that
  reaches out to the dbus daemon to resolve a given bus name to an
  apparmor profile. Remove obsolete query for the apparmor profile in
  ServiceSkeleton. Adjust the implementation in media::PlayerSkeleton
  to rely on Request{Authenticator, ContextResolver}. removed:
  src/core/media/apparmor.h added: src/core/media/apparmor/
  src/core/media/apparmor/context.cpp
  src/core/media/apparmor/context.h src/core/media/apparmor/dbus.h
  src/core/media/apparmor/ubuntu.cpp src/core/media/apparmor/ubuntu.h
* Move src/core/media/call-monitor to src/core/media/telephony.
  Introduce a proper interface media::telephony::CallMonitor. Slightly
  adjust existing implementation based on Qt. Adjust
  media::ServiceImplementation to account for changes in
  media::telephony::CallMonitor.

[ thomas-voss ]
* Add an interface apparmor::ubuntu::RequestAuthenticator that is used
  to authenticate incoming open uri requests. Add an interface
  apparmor::ubuntu::RequestContextResolver that is used to resolve a
  dbus name to an apparmor::ubuntu::Context. Provide an implementation
  apparmor::ubuntu::ExistingAuthenticator that takes the impl. from
  player_skeleton.cpp and uses it to implement the interface. Provide
  an implementation apparmor::ubuntu::RequestContextResolver that
  reaches out to the dbus daemon to resolve a given bus name to an
  apparmor profile. Remove obsolete query for the apparmor profile in
  ServiceSkeleton. Adjust the implementation in media::PlayerSkeleton
  to rely on Request{Authenticator, ContextResolver}. removed:
  src/core/media/apparmor.h added: src/core/media/apparmor/
  src/core/media/apparmor/context.cpp
  src/core/media/apparmor/context.h src/core/media/apparmor/dbus.h
  src/core/media/apparmor/ubuntu.cpp src/core/media/apparmor/ubuntu.h
* Add an interface media::ClientDeathObserver that abstracts away
  receiving key-based death notifications for clients associated to
  media::Player instances server-side Provide an implementation
  media::HybrisClientDeathObserver that relies on hybris and
  ultimately on Android's onBinderDied to receive death notifications.
  Adjust media::PlayerStub and media::PlayerImplementation to account
  for the new interface. Adjust the CMake setup for tests to link
  media-hub-service instead of recompiling large parts of the
  implementation classes.
* Decouple PlayerSkeleton and PlayerImplementation by making
  PlayerImplementation being able to inherit from arbitrary base
  classes, as long as they provide the set of properties and signals
  defined by media::Player.
* Decouple the ServiceSkeleton from the ServiceImplementation by
  introducing a common interface media::KeyedPlayerStore for storing
  running Player sessions indexed by the Player::Key. Provide a
  default implementation HashedKeyedPlayerStore relying on a hash map
  for keeping track of player instances. Adjust implementation to
  account for ServiceImplementation no longer inheriting from
  ServiceSkeleton.
* Introduce a common class media::helper::ExternalHelpers that
  provides a convenient way to:
* Introduce an interface media::RecorderObserver that allows the core
  classes to monitor the overall state of the system. Provide an
  implementation of media::RecorderObserver relying on Hybris to
  interface with the Android side. Adjust the ServiceImplementation to
  connect to the platform-default media::RecorderObserver.
* Introduce an interface media::audio::OutputObserver that allows the
  core classes to observer the state of external audio outputs
  (headphones/headsets). Provide an implementation of
  media::audio::OutputObserver that relies on Pulseaudio to monitor
  the availability of ports on the default sink. Adjust
  media::ServiceImplementation to use media::audio::OutputObserver,
  defaulting to media::audio::PulseAudioOutputObserver.
* Introduce an interface media::power::BatteryObserver to monitor the
  current battery level of the system. The core reacts to low/very low
  battery levels by pausing all multimedia playback sessions and
  resumes them whenever the user has been notified of the critical
  battery level. Provide an implementation of
  media::power::BatteryObserver using
  com.canonical.indicator.power.Battery. Adjust
  media::ServiceImplementation to use media::power::BatteryObserver.
* Move gstreamer::Playbin implementation to its own cpp file, thus
  internalizing the Hybris setup portions. Make sure that media-hub-
  service knows about
  media::Player::Error::OutOfProcessBufferStreamingNotSupported by
  linking with media-hub-client.
* Move src/core/media/call-monitor to src/core/media/telephony.
  Introduce a proper interface media::telephony::CallMonitor. Slightly
  adjust existing implementation based on Qt. Adjust
  media::ServiceImplementation to account for changes in
  media::telephony::CallMonitor.
* Replace home-grown mask type for the video size with a std::tuple,
  i.e., media::video::Dimensions. Introduce a simple TaggedInteger
  class to distinguish between Width, Height and other dimensions.
  Adjust interfaces of media::Player to rely on the new type. Adjust
  implementation classes to account for interface changes. Adjust
  Codec implementation for sending the tagged integer via the bus.
  Adjust gstreamer::Engine and gstreamer::Playbin to hand out the
  correct types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 * This program is free software: you can redistribute it and/or modify it
 
4
 * under the terms of the GNU Lesser General Public License version 3,
 
5
 * as published by the Free Software Foundation.
 
6
 *
 
7
 * This program is distributed in the hope that it will be useful,
 
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
 * GNU Lesser General Public License for more details.
 
11
 *
 
12
 * You should have received a copy of the GNU Lesser General Public License
 
13
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
14
 *
 
15
 * Authored by: Thomas Voß <thomas.voss@canonical.com>
 
16
 */
 
17
 
 
18
#ifndef CORE_MEDIA_NULL_TRACK_LIST_H_
 
19
#define CORE_MEDIA_NULL_TRACK_LIST_H_
 
20
 
 
21
#include <core/media/track.h>
 
22
#include <core/media/track_list.h>
 
23
 
 
24
namespace core
 
25
{
 
26
namespace ubuntu
 
27
{
 
28
namespace media
 
29
{
 
30
// A helper type to replace the playlist implementation below.
 
31
// Please note that this type is only a temporary manner. Ideally,
 
32
// the actual implementation should be injected as a dependency from the
 
33
// outside.
 
34
struct NullTrackList : public media::TrackList
 
35
{
 
36
    NullTrackList() = default;
 
37
 
 
38
    bool has_next()
 
39
    {
 
40
        return false;
 
41
    }
 
42
 
 
43
    media::Track::Id next()
 
44
    {
 
45
        return media::Track::Id{};
 
46
    }
 
47
 
 
48
    media::Track::UriType query_uri_for_track(const media::Track::Id&)
 
49
    {
 
50
        return media::Track::UriType{};
 
51
    }
 
52
 
 
53
    const core::Property<bool>& can_edit_tracks() const override
 
54
    {
 
55
        return props_and_sigs.can_edit_tracks;
 
56
    }
 
57
 
 
58
    const core::Property<Container>& tracks() const override
 
59
    {
 
60
        return props_and_sigs.tracks;
 
61
    }
 
62
 
 
63
    virtual media::Track::MetaData query_meta_data_for_track(const media::Track::Id&) override
 
64
    {
 
65
        return media::Track::MetaData{};
 
66
    }
 
67
 
 
68
    void add_track_with_uri_at(const media::Track::UriType&, const media::Track::Id&, bool) override
 
69
    {
 
70
    }
 
71
 
 
72
    void remove_track(const media::Track::Id&) override
 
73
    {
 
74
    }
 
75
 
 
76
    void go_to(const media::Track::Id&) override
 
77
    {
 
78
    }
 
79
 
 
80
    const core::Signal<void>& on_track_list_replaced() const override
 
81
    {
 
82
        return props_and_sigs.on_track_list_replaced;
 
83
    }
 
84
 
 
85
    const core::Signal<media::Track::Id>& on_track_added() const override
 
86
    {
 
87
        return props_and_sigs.on_track_added;
 
88
    }
 
89
 
 
90
    const core::Signal<media::Track::Id>& on_track_removed() const override
 
91
    {
 
92
        return props_and_sigs.on_track_removed;
 
93
    }
 
94
 
 
95
    const core::Signal<media::Track::Id>& on_track_changed() const override
 
96
    {
 
97
        return props_and_sigs.on_track_changed;
 
98
    }
 
99
 
 
100
    struct
 
101
    {
 
102
        core::Property<bool> can_edit_tracks;
 
103
        core::Property<TrackList::Container> tracks;
 
104
        core::Signal<void> on_track_list_replaced;
 
105
        core::Signal<media::Track::Id> on_track_added;
 
106
        core::Signal<media::Track::Id> on_track_removed;
 
107
        core::Signal<media::Track::Id> on_track_changed;
 
108
    } props_and_sigs;
 
109
};
 
110
}
 
111
}
 
112
}
 
113
 
 
114
#endif // CORE_MEDIA_NULL_TRACK_LIST_H_