From f8200ccf30669b6d35ab546fcda3124cab8ed9b8 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Thu, 19 Jul 2012 23:25:13 +0200 Subject: [PATCH] core,librenderer: Move renderer-only stuff to library --- po/POTFILES.in | 13 +-- po/POTFILES.skip | 101 +++++++++++++++++++++ src/librygel-core/filelist.am | 9 +- src/librygel-core/rygel-connection-manager.vala | 2 +- src/librygel-core/rygel-gst-utils.vala | 20 ---- src/librygel-renderer/filelist.am | 10 +- .../rygel-av-transport.vala | 0 .../rygel-changelog.vala | 0 src/librygel-renderer/rygel-gst-utils.vala | 51 +++++++++++ .../rygel-media-player.vala | 0 .../rygel-media-renderer-plugin.vala | 0 .../rygel-rendering-control.vala | 0 .../rygel-sink-connection-manager.vala | 0 .../rygel-volume.vala | 0 src/plugins/mpris/Makefile.am | 9 +- 15 files changed, 176 insertions(+), 39 deletions(-) rename src/{librygel-core => librygel-renderer}/rygel-av-transport.vala (100%) rename src/{librygel-core => librygel-renderer}/rygel-changelog.vala (100%) create mode 100644 src/librygel-renderer/rygel-gst-utils.vala rename src/{librygel-core => librygel-renderer}/rygel-media-player.vala (100%) rename src/{librygel-core => librygel-renderer}/rygel-media-renderer-plugin.vala (100%) rename src/{librygel-core => librygel-renderer}/rygel-rendering-control.vala (100%) rename src/{librygel-core => librygel-renderer}/rygel-sink-connection-manager.vala (100%) rename src/{librygel-core => librygel-renderer}/rygel-volume.vala (100%) diff --git a/po/POTFILES.in b/po/POTFILES.in index a658e4d..d69ed17 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,8 +11,6 @@ data/xml/ContentDirectory.xml.in data/xml/MediaRenderer2.xml.in data/xml/MediaServer2.xml.in data/xml/RenderingControl2.xml.in -src/librygel-renderer/rygel-playbin-player.vala -src/librygel-renderer/rygel-playbin-plugin.vala src/plugins/external/rygel-external-container.vala src/plugins/external/rygel-external-icon-factory.vala src/plugins/external/rygel-external-interfaces.vala @@ -78,8 +76,6 @@ src/librygel-core/rygel-cmdline-config.vala src/librygel-core/rygel-configuration.vala src/librygel-core/rygel-connection-manager.vala src/librygel-core/rygel-content-directory.vala -src/librygel-core/rygel-av-transport.vala -src/librygel-core/rygel-rendering-control.vala src/librygel-core/rygel-gst-utils.vala src/librygel-core/rygel-http-byte-seek.vala src/librygel-core/rygel-http-get-handler.vala @@ -124,7 +120,6 @@ src/librygel-core/rygel-search-expression.vala src/librygel-core/rygel-search.vala src/librygel-core/rygel-simple-container.vala src/librygel-core/rygel-source-connection-manager.vala -src/librygel-core/rygel-sink-connection-manager.vala src/librygel-core/rygel-state-machine.vala src/librygel-core/rygel-subtitle-manager.vala src/librygel-core/rygel-subtitle.vala @@ -135,7 +130,13 @@ src/librygel-core/rygel-transcoder.vala src/librygel-core/rygel-user-config.vala src/librygel-core/rygel-wmv-transcoder.vala src/librygel-core/rygel-xbox-hacks.vala -src/librygel-core/rygel-changelog.vala +src/librygel-renderer/rygel-av-transport.vala +src/librygel-renderer/rygel-changelog.vala +src/librygel-renderer/rygel-gst-utils.vala +src/librygel-renderer/rygel-playbin-player.vala +src/librygel-renderer/rygel-playbin-plugin.vala +src/librygel-renderer/rygel-rendering-control.vala +src/librygel-renderer/rygel-sink-connection-manager.vala src/rygel/rygel-dbus-service.vala src/rygel/rygel-main.vala src/ui/rygel-media-pref-section.vala diff --git a/po/POTFILES.skip b/po/POTFILES.skip index 5b53b1e..be8398c 100644 --- a/po/POTFILES.skip +++ b/po/POTFILES.skip @@ -16,6 +16,107 @@ src/plugins/mediathek/rygel-mediathek-root-container.vala src/plugins/mediathek/rygel-mediathek-rss-container.vala src/plugins/mediathek/rygel-mediathek-soup-utils.vala src/plugins/mediathek/rygel-mediathek-video-item-factory.vala +src/librygel-core/rygel-aac-transcoder.c +src/librygel-core/rygel-audio-item.c +src/librygel-core/rygel-audio-transcoder.c +src/librygel-core/rygel-avc-transcoder.c +src/librygel-core/rygel-av-transport.c +src/librygel-core/rygel-browse.c +src/librygel-core/rygel-changelog.c +src/librygel-core/rygel-client-hacks.c +src/librygel-core/rygel-cmdline-config.c +src/librygel-core/rygel-configuration.c +src/librygel-core/rygel-connection-manager.c +src/librygel-core/rygel-content-directory.c +src/librygel-core/rygel-dbus-interface.c +src/librygel-core/rygel-dbus-thumbnailer.c +src/librygel-core/rygel-description-file.c +src/librygel-core/rygel-environment-config.c +src/librygel-core/rygel-free-desktop-interfaces.c +src/librygel-core/rygel-gst-utils.c +src/librygel-core/rygel-http-byte-seek.c +src/librygel-core/rygel-http-get.c +src/librygel-core/rygel-http-get-handler.c +src/librygel-core/rygel-http-gst-sink.c +src/librygel-core/rygel-http-identity-handler.c +src/librygel-core/rygel-http-item-uri.c +src/librygel-core/rygel-http-post.c +src/librygel-core/rygel-http-request.c +src/librygel-core/rygel-http-response.c +src/librygel-core/rygel-http-seek.c +src/librygel-core/rygel-http-server.c +src/librygel-core/rygel-http-time-seek.c +src/librygel-core/rygel-http-transcode-handler.c +src/librygel-core/rygel-icon-info.c +src/librygel-core/rygel-image-item.c +src/librygel-core/rygel-import-resource.c +src/librygel-core/rygel-item-creator.c +src/librygel-core/rygel-item-destroyer.c +src/librygel-core/rygel-item-removal-queue.c +src/librygel-core/rygel-l16-transcoder.c +src/librygel-core/rygel-log-handler.c +src/librygel-core/rygel-logical-expression.c +src/librygel-core/rygel-media-art-store.c +src/librygel-core/rygel-media-container.c +src/librygel-core/rygel-media-device.c +src/librygel-core/rygel-media-item.c +src/librygel-core/rygel-media-object.c +src/librygel-core/rygel-media-objects.c +src/librygel-core/rygel-media-player.c +src/librygel-core/rygel-media-query-action.c +src/librygel-core/rygel-media-receiver-registrar.c +src/librygel-core/rygel-media-renderer-plugin.c +src/librygel-core/rygel-media-server-plugin.c +src/librygel-core/rygel-meta-config.c +src/librygel-core/rygel-mp2ts-transcoder.c +src/librygel-core/rygel-mp3-transcoder.c +src/librygel-core/rygel-music-item.c +src/librygel-core/rygel-panasonic-hacks.c +src/librygel-core/rygel-photo-item.c +src/librygel-core/rygel-plugin.c +src/librygel-core/rygel-plugin-loader.c +src/librygel-core/rygel-relational-expression.c +src/librygel-core/rygel-rendering-control.c +src/librygel-core/rygel-resource-info.c +src/librygel-core/rygel-root-device.c +src/librygel-core/rygel-root-device-factory.c +src/librygel-core/rygel-searchable-container.c +src/librygel-core/rygel-search.c +src/librygel-core/rygel-search-criteria-parser.c +src/librygel-core/rygel-search-expression.c +src/librygel-core/rygel-simple-container.c +src/librygel-core/rygel-sink-connection-manager.c +src/librygel-core/rygel-source-connection-manager.c +src/librygel-core/rygel-state-machine.c +src/librygel-core/rygel-subtitle.c +src/librygel-core/rygel-subtitle-manager.c +src/librygel-core/rygel-thumbnail.c +src/librygel-core/rygel-thumbnailer.c +src/librygel-core/rygel-transcode-manager.c +src/librygel-core/rygel-transcoder.c +src/librygel-core/rygel-user-config.c +src/librygel-core/rygel-v1-hacks.c +src/librygel-core/rygel-video-item.c +src/librygel-core/rygel-video-transcoder.c +src/librygel-core/rygel-visual-item.c +src/librygel-core/rygel-volume.c +src/librygel-core/rygel-wmp-hacks.c +src/librygel-core/rygel-wmv-transcoder.c +src/librygel-core/rygel-writable-container.c +src/librygel-core/rygel-xbmc-hacks.c +src/librygel-core/rygel-xbox-hacks.c +src/librygel-core/rygel-xml-utils.c +src/librygel-renderer/rygel-av-transport.c +src/librygel-renderer/rygel-changelog.c +src/librygel-renderer/rygel-gst-utils.c +src/librygel-renderer/rygel-media-player.c +src/librygel-renderer/rygel-media-renderer-plugin.c +src/librygel-renderer/rygel-playbin-player.c +src/librygel-renderer/rygel-playbin-plugin.c +src/librygel-renderer/rygel-playbin-renderer.c +src/librygel-renderer/rygel-rendering-control.c +src/librygel-renderer/rygel-sink-connection-manager.c +src/librygel-renderer/rygel-volume.c src/plugins/external/rygel-external-album-art-factory.c src/plugins/external/rygel-external-container.c src/plugins/external/rygel-external-dummy-container.c diff --git a/src/librygel-core/filelist.am b/src/librygel-core/filelist.am index 6eba487..9506a05 100644 --- a/src/librygel-core/filelist.am +++ b/src/librygel-core/filelist.am @@ -1,5 +1,6 @@ LIBRYGEL_CORE_VAPI_SOURCE_FILES = \ rygel-cmdline-config.vala \ + rygel-connection-manager.vala \ rygel-root-device.vala \ rygel-root-device-factory.vala \ rygel-audio-item.vala \ @@ -10,7 +11,6 @@ LIBRYGEL_CORE_VAPI_SOURCE_FILES = \ rygel-logical-expression.vala \ rygel-media-art-store.vala \ rygel-media-objects.vala \ - rygel-media-renderer-plugin.vala \ rygel-meta-config.vala \ rygel-music-item.vala \ rygel-photo-item.vala \ @@ -31,7 +31,6 @@ LIBRYGEL_CORE_VAPI_SOURCE_FILES = \ rygel-search-expression.vala \ rygel-configuration.vala \ rygel-free-desktop-interfaces.vala \ - rygel-media-player.vala \ rygel-searchable-container.vala \ rygel-state-machine.vala \ rygel-visual-item.vala \ @@ -42,11 +41,7 @@ LIBRYGEL_CORE_NONVAPI_SOURCE_FILES = \ rygel-http-item-uri.vala \ rygel-environment-config.vala \ rygel-content-directory.vala \ - rygel-connection-manager.vala \ rygel-source-connection-manager.vala \ - rygel-sink-connection-manager.vala \ - rygel-av-transport.vala \ - rygel-rendering-control.vala \ rygel-transcode-manager.vala \ rygel-http-server.vala \ rygel-http-request.vala \ @@ -88,8 +83,6 @@ LIBRYGEL_CORE_NONVAPI_SOURCE_FILES = \ rygel-avc-transcoder.vala \ rygel-gst-utils.vala \ rygel-media-receiver-registrar.vala \ - rygel-changelog.vala \ - rygel-volume.vala \ rygel-description-file.vala LIBRYGEL_CORE_VALAFLAGS_PKG = \ diff --git a/src/librygel-core/rygel-connection-manager.vala b/src/librygel-core/rygel-connection-manager.vala index bdec807..0b8673a 100644 --- a/src/librygel-core/rygel-connection-manager.vala +++ b/src/librygel-core/rygel-connection-manager.vala @@ -28,7 +28,7 @@ using GUPnP; /** * Basic implementation of UPnP ConnectionManager service version 2. */ -internal class Rygel.ConnectionManager : Service { +public class Rygel.ConnectionManager : Service { public const string UPNP_ID = "urn:upnp-org:serviceId:ConnectionManager"; public const string UPNP_TYPE = "urn:schemas-upnp-org:service:ConnectionManager:2"; diff --git a/src/librygel-core/rygel-gst-utils.vala b/src/librygel-core/rygel-gst-utils.vala index 3d42b4d..bbef78b 100644 --- a/src/librygel-core/rygel-gst-utils.vala +++ b/src/librygel-core/rygel-gst-utils.vala @@ -42,26 +42,6 @@ internal abstract class Rygel.GstUtils { return element; } - public static ClockTime time_from_string (string str) { - uint64 hours, minutes, seconds; - - str.scanf ("%llu:%2llu:%2llu%*s", out hours, out minutes, out seconds); - - return (ClockTime) ((hours * 3600 + minutes * 60 + seconds) * - Gst.SECOND); - } - - public static string time_to_string (ClockTime time) { - uint64 hours, minutes, seconds; - - hours = time / Gst.SECOND / 3600; - seconds = time / Gst.SECOND % 3600; - minutes = seconds / 60; - seconds = seconds % 60; - - return "%llu:%.2llu:%.2llu".printf (hours, minutes, seconds); - } - public static Element? create_source_for_uri (string uri) { dynamic Element src = Element.make_from_uri (URIType.SRC, uri, null); if (src != null) { diff --git a/src/librygel-renderer/filelist.am b/src/librygel-renderer/filelist.am index 470efd9..bc87bb0 100644 --- a/src/librygel-renderer/filelist.am +++ b/src/librygel-renderer/filelist.am @@ -1,8 +1,16 @@ LIBRYGEL_RENDERER_VAPI_SOURCE_FILES = \ rygel-playbin-player.vala \ rygel-playbin-plugin.vala \ + rygel-media-renderer-plugin.vala \ + rygel-media-player.vala \ rygel-playbin-renderer.vala -LIBRYGEL_RENDERER_NONVAPI_SOURCE_FILES = +LIBRYGEL_RENDERER_NONVAPI_SOURCE_FILES = \ + rygel-av-transport.vala \ + rygel-rendering-control.vala \ + rygel-sink-connection-manager.vala \ + rygel-changelog.vala \ + rygel-gst-utils.vala \ + rygel-volume.vala LIBRYGEL_RENDERER_VALAFLAGS_PKG = diff --git a/src/librygel-core/rygel-av-transport.vala b/src/librygel-renderer/rygel-av-transport.vala similarity index 100% rename from src/librygel-core/rygel-av-transport.vala rename to src/librygel-renderer/rygel-av-transport.vala diff --git a/src/librygel-core/rygel-changelog.vala b/src/librygel-renderer/rygel-changelog.vala similarity index 100% rename from src/librygel-core/rygel-changelog.vala rename to src/librygel-renderer/rygel-changelog.vala diff --git a/src/librygel-renderer/rygel-gst-utils.vala b/src/librygel-renderer/rygel-gst-utils.vala new file mode 100644 index 0000000..ff512ae --- /dev/null +++ b/src/librygel-renderer/rygel-gst-utils.vala @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2009 Nokia Corporation. + * + * Author: Zeeshan Ali (Khattak) + * + * + * This file is part of Rygel. + * + * Rygel is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Rygel is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +using Gst; + +internal errordomain Rygel.GstError { + MISSING_PLUGIN, + LINK +} + +internal abstract class Rygel.GstUtils { + public static ClockTime time_from_string (string str) { + uint64 hours, minutes, seconds; + + str.scanf ("%llu:%2llu:%2llu%*s", out hours, out minutes, out seconds); + + return (ClockTime) ((hours * 3600 + minutes * 60 + seconds) * + Gst.SECOND); + } + + public static string time_to_string (ClockTime time) { + uint64 hours, minutes, seconds; + + hours = time / Gst.SECOND / 3600; + seconds = time / Gst.SECOND % 3600; + minutes = seconds / 60; + seconds = seconds % 60; + + return "%llu:%.2llu:%.2llu".printf (hours, minutes, seconds); + } +} diff --git a/src/librygel-core/rygel-media-player.vala b/src/librygel-renderer/rygel-media-player.vala similarity index 100% rename from src/librygel-core/rygel-media-player.vala rename to src/librygel-renderer/rygel-media-player.vala diff --git a/src/librygel-core/rygel-media-renderer-plugin.vala b/src/librygel-renderer/rygel-media-renderer-plugin.vala similarity index 100% rename from src/librygel-core/rygel-media-renderer-plugin.vala rename to src/librygel-renderer/rygel-media-renderer-plugin.vala diff --git a/src/librygel-core/rygel-rendering-control.vala b/src/librygel-renderer/rygel-rendering-control.vala similarity index 100% rename from src/librygel-core/rygel-rendering-control.vala rename to src/librygel-renderer/rygel-rendering-control.vala diff --git a/src/librygel-core/rygel-sink-connection-manager.vala b/src/librygel-renderer/rygel-sink-connection-manager.vala similarity index 100% rename from src/librygel-core/rygel-sink-connection-manager.vala rename to src/librygel-renderer/rygel-sink-connection-manager.vala diff --git a/src/librygel-core/rygel-volume.vala b/src/librygel-renderer/rygel-volume.vala similarity index 100% rename from src/librygel-core/rygel-volume.vala rename to src/librygel-renderer/rygel-volume.vala diff --git a/src/plugins/mpris/Makefile.am b/src/plugins/mpris/Makefile.am index 733ca48..4912094 100644 --- a/src/plugins/mpris/Makefile.am +++ b/src/plugins/mpris/Makefile.am @@ -2,14 +2,17 @@ include ../../../common.am plugin_LTLIBRARIES = librygel-mpris.la -AM_CFLAGS += -DG_LOG_DOMAIN='"MPRIS"' +AM_CFLAGS += -DG_LOG_DOMAIN='"MPRIS"' \ + -I$(top_builddir)/src/librygel-renderer librygel_mpris_la_SOURCES = \ rygel-mpris-player.vala \ rygel-mpris-plugin.vala \ rygel-mpris-plugin-factory.vala \ - rygel-mpris-interfaces.vala + rygel-mpris-interfaces.vala \ + $(top_builddir)/src/librygel-renderer/rygel-renderer-1.0.vapi librygel_mpris_la_VALAFLAGS = $(RYGEL_COMMON_PLUGIN_VALAFLAGS) -librygel_mpris_la_LIBADD = $(RYGEL_COMMON_LIBS) +librygel_mpris_la_LIBADD = $(RYGEL_COMMON_LIBS) \ + $(top_builddir)/src/librygel-renderer/librygel-renderer-1.0.la librygel_mpris_la_LDFLAGS = $(RYGEL_PLUGIN_LINKER_FLAGS) -- 2.7.4