Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Cutify #28

Merged
merged 52 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4982e49
Replace process-cpp with QCoreApplication
mardy Apr 22, 2021
e943656
ServiceSkeleton: remove unused private method
mardy Apr 23, 2021
daf6e2f
Rewrite service using Qt
mardy Apr 30, 2021
3828b47
service: add DBusPropertyNotifier class
mardy May 1, 2021
df4fa1f
service: move player registration to skeleton
mardy May 1, 2021
782947d
service: use DBusPropertyNotifier in Player adapter
mardy May 1, 2021
b21b7e8
service: register types used in the D-Bus interfaces
mardy May 2, 2021
9443863
service: rework registration of D-Bus objects
mardy May 3, 2021
8a41507
service: create an object to manage the MPRIS interfaces
mardy May 3, 2021
93570aa
service: simplify PlayerSkeleton
mardy May 3, 2021
af1da49
service: remove bitrate properties from metadata map
mardy May 4, 2021
4ad47d1
service: terminate on disconnection from D-Bus
mardy May 5, 2021
26ba943
service: remove unused type CoverArtResolver
mardy May 6, 2021
5cdc0c3
tests: remove unit tests subdirectory
mardy May 6, 2021
4ebcd9a
tests: remove unused tests
mardy May 6, 2021
3ba035c
tests: move data files into service subdirectory
mardy May 7, 2021
914bbb5
service: do not crash if OpenUri is called with no params
mardy May 7, 2021
df2332b
service: simplify boolean logic in Player adaptor
mardy May 7, 2021
c7a410a
tests: add functional tests
mardy May 7, 2021
718055e
service: add workaround for QMetaType weirdness
mardy May 8, 2021
0240a8d
service: set engine to stopped even if unitialized
mardy May 8, 2021
39b060e
tests: add a test to check for permission denied
mardy May 8, 2021
cfd1959
service: allow functional testing of pipeline
mardy May 9, 2021
2eff084
service: watch for clients dying on non-hybris platforms
mardy May 9, 2021
d239b4f
tests: check for powerd invocations
mardy May 10, 2021
02812b7
service: quit on SIGTERM
mardy May 10, 2021
5ea122b
tests: improve setup for coverage report
mardy May 10, 2021
6b6bd8a
service: cache property values in DBusPropertyNotifier
mardy May 10, 2021
b9e8a81
service: don't expose bitrate in metadata
mardy May 10, 2021
7b227a6
service: add a throttle on the Buffering signal
mardy May 10, 2021
7c4c418
service: do not emit clientDisconnected signal on playbin reset
mardy May 10, 2021
ede9f25
tests: verify pausing on low battery
mardy May 10, 2021
b7b6b66
tests: simplify watching property changes
mardy May 12, 2021
316cf28
service: avoid calling open_uri twice
mardy May 13, 2021
8cae850
service: refactor OpenUri{,Extended} to reuse most of the code
mardy May 13, 2021
dcc1b7c
tests: add a test for OpenUriExtended
mardy May 13, 2021
36a4c23
service: restore Gstreamer pipeline dumping
mardy May 13, 2021
540499c
service: forward the Authorization header
mardy May 13, 2021
41f9021
service: do not emit GoToTrack signal when moving automatically
mardy May 14, 2021
e10cebf
service: move to next track on endOfStream, not aboutToFinish
mardy May 14, 2021
d8d3e84
tests: do not use dbus-monitor ficture on http tests
mardy May 14, 2021
78bce8c
service: allow the same client to play concurrent sounds
mardy May 14, 2021
c8be24d
service: do not emit Paused state when setting up the playbin
mardy May 14, 2021
bde55a2
service: workaround client library bug
mardy May 14, 2021
c90652a
service: allow the AudioStreamRole property to be written to
mardy May 15, 2021
285c14d
tests: properly shutdown HTTP server
mardy May 15, 2021
255c883
service: disconnect PlayerImplementation handlers
mardy May 22, 2021
9663476
service: print error message from gstreamer
mardy May 23, 2021
783ae81
tests: use 127.0.0.1 instead of localhost
mardy May 23, 2021
45a49dd
service: get the number of audio/video streams from the playbin
mardy May 27, 2021
6a28cfe
service: use aa_splitcon() to parse AppArmor profiles
mardy Jun 2, 2021
e7cd801
service: fix playback of ogg files from messaging-app
mardy Jun 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ if (NOT DEFINED UBUNTU_MEDIA_HUB_VERSION_MAJOR)
endif()
endif()

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -fPIC -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fno-strict-aliasing -Wextra -fPIC -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-strict-aliasing -Wextra -fPIC -pthread")

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

Expand All @@ -48,11 +49,11 @@ include(GNUInstallDirs)
find_package(PkgConfig)
find_package(Boost COMPONENTS filesystem log system thread program_options REQUIRED)
find_package(GLog)
find_package(Qt5Core REQUIRED)
find_package(Qt5DBus REQUIRED)
pkg_check_modules(DBUS dbus-1 REQUIRED)
pkg_check_modules(DBUS_CPP dbus-cpp REQUIRED)
pkg_check_modules(PROCESS_CPP process-cpp REQUIRED)
pkg_check_modules(PROPERTIES_CPP properties-cpp REQUIRED)
pkg_check_modules(PROCESS_CPP process-cpp REQUIRED)
pkg_check_modules(GIO gio-2.0 REQUIRED)
pkg_check_modules(HYBRIS_MEDIA libmedia REQUIRED)
pkg_check_modules(EGL egl REQUIRED)
Expand All @@ -78,15 +79,8 @@ if (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-local-typedefs")
endif (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS)

include_directories(
${Boost_INCLUDE_DIRS}
${DBUS_INCLUDE_DIRS}
${DBUS_CPP_INCLUDE_DIRS}
${GLog_INCLUDE_DIR}
${PROCESS_CPP_INCLUDE_DIRS}
${PROPERTIES_CPP_INCLUDE_DIRS}

include/
add_definitions(
-DQT_NO_KEYWORDS
)

add_subdirectory(include)
Expand Down
9 changes: 6 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ Priority: optional
Section: libs
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Build-Depends: cmake,
dbus-test-runner <!nocheck>,
debhelper (>= 9),
dh-apparmor,
doxygen <!nodoc>,
google-mock <!nocheck>,
graphviz <!nodoc>,
gstreamer1.0-plugins-good,
libapparmor-dev,
libboost-dev (>=1.53),
libboost-filesystem-dev (>=1.53),
libboost-log-dev (>=1.53),
Expand All @@ -19,17 +18,21 @@ Build-Depends: cmake,
libdbus-cpp-dev (>= 4.3.0),
libgoogle-glog-dev,
libhybris-dev (>=0.1.0+git20131207+e452e83-0ubuntu30),
libprocess-cpp-dev,
libproperties-cpp-dev,
libgstreamer1.0-dev,
libgstreamer-plugins-base1.0-dev,
lsb-release,
pkg-config,
libpulse-dev,
libpulse-mainloop-glib0,
qtbase5-dev,
libtelepathy-qt5-dev,
libegl1-mesa-dev,
libgl1-mesa-dev,
python3-dbus <!nocheck>,
python3-dbusmock <!nocheck>,
python3-gi <!nocheck>,
python3-pytest <!nocheck>,
Standards-Version: 3.9.6
Homepage: https://launchpad.net/media-hub
# If you aren't a member of ~phablet-team but need to upload packaging changes,
Expand Down
4 changes: 4 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ major=$(shell echo $(full_version) | cut -d'.' -f1)
minor=$(shell echo $(full_version) | cut -d'.' -f2)
patch=$(shell echo $(full_version) | cut -d'.' -f3)

ifneq (,$(findstring coverage,$(DEB_BUILD_OPTIONS)))
CONFIGURE_FLAGS += -DCMAKE_BUILD_TYPE=Coverage
endif

ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
CONFIGURE_FLAGS += -DENABLE_TESTS=OFF
endif
Expand Down
66 changes: 45 additions & 21 deletions src/core/media/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pkg_check_modules(PC_GSTREAMER_1_0 REQUIRED gstreamer-1.0)
pkg_check_modules(PC_GSTREAMER_PBUTILS_1_0 REQUIRED gstreamer-pbutils-1.0)
pkg_check_modules(PC_PULSE_AUDIO REQUIRED libpulse)
pkg_check_modules(PC_PULSE_AUDIO REQUIRED libpulse libpulse-mainloop-glib)
pkg_check_modules(APPARMOR REQUIRED libapparmor)
include_directories(${PC_GSTREAMER_1_0_INCLUDE_DIRS} ${HYBRIS_MEDIA_CFLAGS} ${PC_PULSE_AUDIO_INCLUDE_DIRS})

# We compile with all symbols visible by default. For the shipping library, we strip
Expand All @@ -12,6 +13,9 @@ file(GLOB MPRIS_HEADERS mpris/*.h)

message(STATUS ${MEDIA_HUB_HEADERS})

SET (CMAKE_INCLUDE_CURRENT_DIR ON)
SET (CMAKE_AUTOMOC ON)

add_subdirectory(telephony)

add_library(
Expand All @@ -29,7 +33,20 @@ target_link_libraries(
${DBUS_LIBRARIES}
${DBUS_CPP_LDFLAGS}
${PC_GSTREAMER_1_0_LIBRARIES}
Qt5::Core
)

target_include_directories(media-hub-common PUBLIC
${Boost_INCLUDE_DIRS}
${DBUS_INCLUDE_DIRS}
${DBUS_CPP_INCLUDE_DIRS}
${GLog_INCLUDE_DIR}
${PROCESS_CPP_INCLUDE_DIRS}
${PROPERTIES_CPP_INCLUDE_DIRS}

${PROJECT_SOURCE_DIR}/include/
)

set_target_properties(
media-hub-common

Expand Down Expand Up @@ -62,6 +79,11 @@ add_library(
video/platform_default_sink.cpp
)

target_include_directories(media-hub-client PUBLIC
${PROJECT_SOURCE_DIR}/include/
${PROJECT_SOURCE_DIR}/src/
)

set_target_properties(
media-hub-client

Expand Down Expand Up @@ -96,18 +118,15 @@ install(
add_library(
media-hub-service

${MEDIA_HUB_HEADERS}
${MPRIS_HEADERS}
logging.cpp

logger/logger.cpp
dbus_property_notifier.cpp

client_death_observer.cpp
hashed_keyed_player_store.cpp
dbus_client_death_observer.cpp
hybris_client_death_observer.cpp
stub_client_death_observer.cpp
cover_art_resolver.cpp
engine.cpp
metadata.cpp
track_metadata.cpp

apparmor/context.cpp
apparmor/ubuntu.cpp
Expand All @@ -126,6 +145,8 @@ add_library(
gstreamer/engine.cpp
gstreamer/playbin.cpp

mpris/media_player2.cpp

player_skeleton.cpp
player_implementation.cpp
service_skeleton.cpp
Expand All @@ -137,23 +158,23 @@ add_library(
target_link_libraries(
media-hub-service

media-hub-client
media-hub-common
call-monitor
${Boost_LDFLAGS}
${Boost_LIBRARIES}
${DBUS_LIBRARIES}
${DBUS_CPP_LDFLAGS}
${GLog_LIBRARY}
${APPARMOR_LIBRARIES}
${PC_GSTREAMER_1_0_LIBRARIES}
${PC_GSTREAMER_PBUTILS_1_0_LIBRARIES}
${PROCESS_CPP_LDFLAGS}
${GIO_LIBRARIES}
${HYBRIS_MEDIA_LIBRARIES}
${PC_PULSE_AUDIO_LIBRARIES}
Qt5::Core
Qt5::DBus
)

include_directories(${PROJECT_SOURCE_DIR}/src/ ${HYBRIS_MEDIA_CFLAGS} ${PC_GSTREAMER_1_0_INCLUDE_DIRS})
target_include_directories(media-hub-service PRIVATE
${PROJECT_SOURCE_DIR}/src/
${APPARMOR_INCLUDE_DIRS}
${HYBRIS_MEDIA_CFLAGS}
${PC_GSTREAMER_1_0_INCLUDE_DIRS}
)

add_executable(
media-hub-server
Expand All @@ -166,16 +187,19 @@ target_link_libraries(
media-hub-server

media-hub-service
media-hub-client
call-monitor

${DBUS_LIBRARIES}
${DBUS_CPP_LDFLAGS}
${GLog_LIBRARY}
${PC_GSTREAMER_1_0_LIBRARIES}
${HYBRIS_MEDIA_LIBRARIES}
)

target_include_directories(media-hub-server PRIVATE
${PROJECT_SOURCE_DIR}/src/
)

enable_coverage_report(
TARGETS media-hub-server media-hub-service)

install(
TARGETS media-hub-server
DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
6 changes: 3 additions & 3 deletions src/core/media/apparmor/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

namespace apparmor = core::ubuntu::media::apparmor;

apparmor::Context::Context(const std::string& name) : name{name}
apparmor::Context::Context(const QString &name) : name{name}
{
if (name.empty()) throw std::runtime_error
if (name.isEmpty()) throw std::runtime_error
{
"apparmor::Context cannot be created for empty name."
};
}

const std::string& apparmor::Context::str() const
const QString &apparmor::Context::str() const
{
return name;
}
9 changes: 4 additions & 5 deletions src/core/media/apparmor/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#ifndef CORE_UBUNTU_MEDIA_APPARMOR_AUTHENTICATOR_H_
#define CORE_UBUNTU_MEDIA_APPARMOR_AUTHENTICATOR_H_

#include <memory>
#include <string>
#include <QString>

namespace core
{
Expand All @@ -36,13 +35,13 @@ class Context
public:
// Constructs a new Context instance for the given raw name.
// Throws std::logic_error for empty names.
explicit Context(const std::string& name);
explicit Context(const QString &name);
virtual ~Context() = default;
// Returns the raw string describing the context.
const std::string& str() const;
const QString &str() const;

private:
const std::string name;
const QString name;
};
}
}
Expand Down
94 changes: 0 additions & 94 deletions src/core/media/apparmor/dbus.h

This file was deleted.