Commit 7d893b0b authored by Benjamin Berg's avatar Benjamin Berg
Browse files

Rename to GNOME Network Displays

Closes #22
parent 9ceb1e8d
This is an experimental GNOME Screencaster implementing Wi-Fi Display (aka Miracast).
This is an experimental implementation of Wi-Fi Display (aka Miracast).
The application will stream the selected monitor if the mutter screencast
portal is available. If it is unavailable, a fallback to X11 based frame
......@@ -18,7 +18,7 @@ Mutter currently has an issue when streaming from a multi-monitor setup. See
Testing
=======
For testing purposes you can run with SCREENCAST_DUMMY=1 set. In that case, a dummy
For testing purposes you can run with ND_DUMMY=1 set. In that case, a dummy
sink will be provided that allows connecting on localhost using any RTSP capable
client to test WFD streaming.
......
desktop_file = i18n.merge_file(
input: 'org.gnome.Screencast.desktop.in',
output: 'org.gnome.Screencast.desktop',
input: 'org.gnome.NetworkDisplays.desktop.in',
output: 'org.gnome.NetworkDisplays.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
......@@ -15,8 +15,8 @@ if desktop_utils.found()
endif
appstream_file = i18n.merge_file(
input: 'org.gnome.Screencast.appdata.xml.in',
output: 'org.gnome.Screencast.appdata.xml',
input: 'org.gnome.NetworkDisplays.appdata.xml.in',
output: 'org.gnome.NetworkDisplays.appdata.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
......@@ -29,7 +29,7 @@ if appstream_util.found()
)
endif
install_data('org.gnome.Screencast.gschema.xml',
install_data('org.gnome.NetworkDisplays.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)
......
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gnome.Screencast.desktop</id>
<id>org.gnome.NetworkDisplays.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>GNOME Screencast</name>
<name>GNOME Network Displays</name>
<summary>Stream the desktop to Wi-Fi Display capable devices</summary>
<url type="homepage">https://github.com/benzea/gnome-screencast</url>
<translation type="gettext">gnome-screencast</translation>
<translation type="gettext">gnome-network-displays</translation>
<screenshots>
<screenshot>
<image>https://raw.githubusercontent.com/benzea/gnome-screencast/master/data/appdata/device-list.png</image>
......@@ -14,7 +14,7 @@
</screenshots>
<description>
<p>
GNOME-Screencast allows you to cast your desktop to a remote display. Currently
GNOME Newtork Displays allows you to cast your desktop to a remote display. Currently
implemented is support for casting to Wi-Fi Display capable devices (a.k.a. Miracast).
</p>
</description>
......
[Desktop Entry]
Name=gnome-screencast
Exec=gnome-screencast
Name=GNOME Network Displays
Exec=gnome-network-displays
Terminal=false
Type=Application
Categories=GTK;
......
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="gnome-screencast">
<schema id="org.gnome.Screencast" path="/org/gnome/screencast/">
<schemalist gettext-domain="gnome-network-displays">
<schema id="org.gnome.NetworkDisplays" path="/org/gnome/network-displays/">
</schema>
</schemalist>
project('gnome-screencast', 'c', version: '0.1.0',
project('gnome-network-displays', 'c', version: '0.1.0',
meson_version: '>= 0.42.0',
)
......@@ -7,10 +7,10 @@ i18n = import('i18n')
config_h = configuration_data()
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set_quoted('GETTEXT_PACKAGE', 'gnome-screencast')
config_h.set_quoted('GETTEXT_PACKAGE', 'gnome-network-displays')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
configure_file(
output: 'gnome-screencast-config.h',
output: 'gnome-network-displays-config.h',
configuration: config_h,
)
add_project_arguments([
......@@ -21,4 +21,4 @@ subdir('data')
subdir('src')
subdir('po')
meson.add_install_script('build-aux/meson/postinstall.py')
\ No newline at end of file
meson.add_install_script('build-aux/meson/postinstall.py')
data/org.gnome.Screencast.desktop.in
data/org.gnome.Screencast.appdata.xml.in
data/org.gnome.Screencast.gschema.xml
src/gnome-screencast-window.ui
data/org.gnome.NetworkDisplays.desktop.in
data/org.gnome.NetworkDisplays.appdata.xml.in
data/org.gnome.NetworkDisplays.gschema.xml
src/nd-window.ui
src/main.c
src/gnome-screencast-window.c
src/nd-window.c
i18n.gettext('gnome-screencast', preset: 'glib')
i18n.gettext('gnome-network-displays', preset: 'glib')
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/screencast">
<file>gnome-screencast-window.ui</file>
<file>screencast-sink-row.ui</file>
<file>nd-window.ui</file>
<file>nd-sink-row.ui</file>
</gresource>
</gresources>
......@@ -18,8 +18,8 @@
#include <glib/gi18n.h>
#include <gst/gst.h>
#include "gnome-screencast-config.h"
#include "gnome-screencast-window.h"
#include "gnome-network-displays-config.h"
#include "nd-window.h"
static void
on_activate (GtkApplication *app)
......@@ -36,7 +36,7 @@ on_activate (GtkApplication *app)
window = gtk_application_get_active_window (app);
if (window == NULL)
{
window = g_object_new (GNOME_SCREENCAST_TYPE_WINDOW,
window = g_object_new (ND_TYPE_WINDOW,
"application", app,
"default-width", 600,
"default-height", 300,
......@@ -66,7 +66,7 @@ main (int argc,
* application windows, integration with the window manager/compositor, and
* desktop features such as file opening and single-instance applications.
*/
app = gtk_application_new ("org.gnome.gnome-screencast", G_APPLICATION_FLAGS_NONE);
app = gtk_application_new ("org.gnome.NetworkDisplays", G_APPLICATION_FLAGS_NONE);
/*
* We connect to the activate signal to create a window when the application
......
subdir('wfd')
gnome_screencast_sources = [
gnome_nd_sources = [
'main.c',
'gnome-screencast-window.c',
'screencast-sink-list.c',
'screencast-sink-row.c',
'screencast-sink.c',
'screencast-provider.c',
'screencast-meta-sink.c',
'screencast-meta-provider.c',
'screencast-wfd-p2p-sink.c',
'screencast-wfd-p2p-provider.c',
'screencast-wfd-p2p-registry.c',
'screencast-dummy-provider.c',
'screencast-dummy-wfd-sink.c',
'screencast-portal.c',
'screencast-pulseaudio.c',
'nd-window.c',
'nd-sink-list.c',
'nd-sink-row.c',
'nd-sink.c',
'nd-provider.c',
'nd-meta-sink.c',
'nd-meta-provider.c',
'nd-wfd-p2p-sink.c',
'nd-wfd-p2p-provider.c',
'nd-wfd-p2p-registry.c',
'nd-dummy-provider.c',
'nd-dummy-wfd-sink.c',
'nd-screencast-portal.c',
'nd-pulseaudio.c',
]
enum_headers = files('screencast-sink.h')
enum_headers = files('nd-sink.h')
gnome_screencast_sources += gnome.mkenums_simple(
'screencast-enum-types',
gnome_nd_sources += gnome.mkenums_simple(
'nd-enum-types',
sources: enum_headers,
)
gnome_screencast_deps = [
gnome_nd_deps = [
dependency('gio-2.0', version: '>= 2.50'),
dependency('gtk+-3.0', version: '>= 3.22'),
dependency('libnm', version: '>= 1.15'),
......@@ -34,16 +34,16 @@ gnome_screencast_deps = [
dependency('libpulse-mainloop-glib'),
]
gnome_screencast_deps += wfd_server_deps
gnome_nd_deps += wfd_server_deps
gnome_screencast_sources += gnome.compile_resources('gnome-screencast-resources',
'gnome-screencast.gresource.xml',
gnome_nd_sources += gnome.compile_resources('gnome-nd-resources',
'gnome-network-displays.gresource.xml',
c_name: 'gnome_screencast'
)
executable('gnome-screencast',
gnome_screencast_sources,
dependencies: gnome_screencast_deps,
executable('gnome-network-displays',
gnome_nd_sources,
dependencies: gnome_nd_deps,
install: true,
link_with: wfd_server,
)
\ No newline at end of file
)
/* screencast-dummy-provider.c
/* nd-dummy-provider.c
*
* Copyright 2018 Benjamin Berg <bberg@redhat.com>
*
......@@ -16,11 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gnome-screencast-config.h"
#include "screencast-dummy-provider.h"
#include "screencast-dummy-wfd-sink.h"
#include "gnome-network-displays-config.h"
#include "nd-dummy-provider.h"
#include "nd-dummy-wfd-sink.h"
struct _ScreencastDummyProvider
struct _NdDummyProvider
{
GObject parent_instance;
......@@ -35,21 +35,21 @@ enum {
PROP_LAST = PROP_DISCOVER,
};
static void screencast_dummy_provider_provider_iface_init (ScreencastProviderIface *iface);
static GList * screencast_dummy_provider_provider_get_sinks (ScreencastProvider *provider);
static void nd_dummy_provider_provider_iface_init (NdProviderIface *iface);
static GList * nd_dummy_provider_provider_get_sinks (NdProvider *provider);
G_DEFINE_TYPE_EXTENDED (ScreencastDummyProvider, screencast_dummy_provider, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (SCREENCAST_TYPE_PROVIDER,
screencast_dummy_provider_provider_iface_init);
G_DEFINE_TYPE_EXTENDED (NdDummyProvider, nd_dummy_provider, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (ND_TYPE_PROVIDER,
nd_dummy_provider_provider_iface_init);
)
static void
screencast_dummy_provider_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
nd_dummy_provider_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ScreencastDummyProvider *self = SCREENCAST_DUMMY_PROVIDER (object);
NdDummyProvider *self = ND_DUMMY_PROVIDER (object);
switch (prop_id)
{
......@@ -64,12 +64,12 @@ screencast_dummy_provider_get_property (GObject *object,
}
static void
screencast_dummy_provider_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
nd_dummy_provider_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ScreencastDummyProvider *self = SCREENCAST_DUMMY_PROVIDER (object);
NdDummyProvider *self = ND_DUMMY_PROVIDER (object);
switch (prop_id)
{
......@@ -85,50 +85,50 @@ screencast_dummy_provider_set_property (GObject *object,
}
static void
screencast_dummy_provider_finalize (GObject *object)
nd_dummy_provider_finalize (GObject *object)
{
ScreencastDummyProvider *dummy_provider = SCREENCAST_DUMMY_PROVIDER (object);
NdDummyProvider *dummy_provider = ND_DUMMY_PROVIDER (object);
g_clear_pointer (&dummy_provider->sinks, g_ptr_array_unref);
G_OBJECT_CLASS (screencast_dummy_provider_parent_class)->finalize (object);
G_OBJECT_CLASS (nd_dummy_provider_parent_class)->finalize (object);
}
static void
screencast_dummy_provider_class_init (ScreencastDummyProviderClass *klass)
nd_dummy_provider_class_init (NdDummyProviderClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = screencast_dummy_provider_get_property;
object_class->set_property = screencast_dummy_provider_set_property;
object_class->finalize = screencast_dummy_provider_finalize;
object_class->get_property = nd_dummy_provider_get_property;
object_class->set_property = nd_dummy_provider_set_property;
object_class->finalize = nd_dummy_provider_finalize;
g_object_class_override_property (object_class, PROP_DISCOVER, "discover");
}
static void
screencast_dummy_provider_init (ScreencastDummyProvider *dummy_provider)
nd_dummy_provider_init (NdDummyProvider *dummy_provider)
{
dummy_provider->discover = TRUE;
dummy_provider->sinks = g_ptr_array_new_with_free_func (g_object_unref);
g_ptr_array_add (dummy_provider->sinks, screencast_dummy_wfd_sink_new ());
g_ptr_array_add (dummy_provider->sinks, nd_dummy_wfd_sink_new ());
}
/******************************************************************
* ScreencastProvider interface implementation
* NdProvider interface implementation
******************************************************************/
static void
screencast_dummy_provider_provider_iface_init (ScreencastProviderIface *iface)
nd_dummy_provider_provider_iface_init (NdProviderIface *iface)
{
iface->get_sinks = screencast_dummy_provider_provider_get_sinks;
iface->get_sinks = nd_dummy_provider_provider_get_sinks;
}
static GList *
screencast_dummy_provider_provider_get_sinks (ScreencastProvider *provider)
nd_dummy_provider_provider_get_sinks (NdProvider *provider)
{
ScreencastDummyProvider *dummy_provider = SCREENCAST_DUMMY_PROVIDER (provider);
NdDummyProvider *dummy_provider = ND_DUMMY_PROVIDER (provider);
GList *res = NULL;
for (gint i = 0; i < dummy_provider->sinks->len; i++)
......@@ -137,9 +137,9 @@ screencast_dummy_provider_provider_get_sinks (ScreencastProvider *provider)
return res;
}
ScreencastDummyProvider *
screencast_dummy_provider_new (void)
NdDummyProvider *
nd_dummy_provider_new (void)
{
return g_object_new (SCREENCAST_TYPE_DUMMY_PROVIDER,
return g_object_new (ND_TYPE_DUMMY_PROVIDER,
NULL);
}
#pragma once
#include <nd-provider.h>
G_BEGIN_DECLS
#define ND_TYPE_DUMMY_PROVIDER (nd_dummy_provider_get_type ())
G_DECLARE_FINAL_TYPE (NdDummyProvider, nd_dummy_provider, ND, DUMMY_PROVIDER, GObject)
NdDummyProvider * nd_dummy_provider_new (void);
G_END_DECLS
/* screencast-dummy-wfd-sink.c
/* nd-dummy-wfd-sink.c
*
* Copyright 2018 Benjamin Berg <bberg@redhat.com>
*
......@@ -16,19 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "gnome-screencast-config.h"
#include "screencast-dummy-wfd-sink.h"
#include "gnome-network-displays-config.h"
#include "nd-dummy-wfd-sink.h"
#include "wfd/wfd-server.h"
#include "wfd/wfd-client.h"
struct _ScreencastDummyWFDSink
struct _NdDummyWFDSink
{
GObject parent_instance;
GObject parent_instance;
ScreencastSinkState state;
NdSinkState state;
WfdServer *server;
guint server_source_id;
WfdServer *server;
guint server_source_id;
};
enum {
......@@ -44,23 +44,23 @@ enum {
PROP_LAST = PROP_DISPLAY_NAME,
};
static void screencast_dummy_wfd_sink_sink_iface_init (ScreencastSinkIface *iface);
static ScreencastSink * screencast_dummy_wfd_sink_sink_start_stream (ScreencastSink *sink);
static void screencast_dummy_wfd_sink_sink_stop_stream (ScreencastSink *sink);
static void nd_dummy_wfd_sink_sink_iface_init (NdSinkIface *iface);
static NdSink * nd_dummy_wfd_sink_sink_start_stream (NdSink *sink);
static void nd_dummy_wfd_sink_sink_stop_stream (NdSink *sink);
G_DEFINE_TYPE_EXTENDED (ScreencastDummyWFDSink, screencast_dummy_wfd_sink, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (SCREENCAST_TYPE_SINK,
screencast_dummy_wfd_sink_sink_iface_init);
G_DEFINE_TYPE_EXTENDED (NdDummyWFDSink, nd_dummy_wfd_sink, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (ND_TYPE_SINK,
nd_dummy_wfd_sink_sink_iface_init);
)
static void
screencast_dummy_wfd_sink_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
nd_dummy_wfd_sink_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ScreencastDummyWFDSink *sink = SCREENCAST_DUMMY_WFD_SINK (object);
NdDummyWFDSink *sink = ND_DUMMY_WFD_SINK (object);
switch (prop_id)
{
......@@ -94,20 +94,20 @@ screencast_dummy_wfd_sink_get_property (GObject *object,
}
void
screencast_dummy_wfd_sink_finalize (GObject *object)
nd_dummy_wfd_sink_finalize (GObject *object)
{
screencast_dummy_wfd_sink_sink_stop_stream (SCREENCAST_SINK (object));
nd_dummy_wfd_sink_sink_stop_stream (ND_SINK (object));
G_OBJECT_CLASS (screencast_dummy_wfd_sink_parent_class)->finalize (object);
G_OBJECT_CLASS (nd_dummy_wfd_sink_parent_class)->finalize (object);
}
static void
screencast_dummy_wfd_sink_class_init (ScreencastDummyWFDSinkClass *klass)
nd_dummy_wfd_sink_class_init (NdDummyWFDSinkClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = screencast_dummy_wfd_sink_get_property;
object_class->finalize = screencast_dummy_wfd_sink_finalize;
object_class->get_property = nd_dummy_wfd_sink_get_property;
object_class->finalize = nd_dummy_wfd_sink_finalize;
g_object_class_override_property (object_class, PROP_DISPLAY_NAME, "display-name");
g_object_class_override_property (object_class, PROP_MATCHES, "matches");
......@@ -116,45 +116,45 @@ screencast_dummy_wfd_sink_class_init (ScreencastDummyWFDSinkClass *klass)
}
static void
screencast_dummy_wfd_sink_init (ScreencastDummyWFDSink *sink)
nd_dummy_wfd_sink_init (NdDummyWFDSink *sink)
{
sink->state = SCREENCAST_SINK_STATE_DISCONNECTED;
sink->state = ND_SINK_STATE_DISCONNECTED;
}
/******************************************************************
* ScreencastSink interface implementation
* NdSink interface implementation
******************************************************************/
static void
screencast_dummy_wfd_sink_sink_iface_init (ScreencastSinkIface *iface)
nd_dummy_wfd_sink_sink_iface_init (NdSinkIface *iface)
{
iface->start_stream = screencast_dummy_wfd_sink_sink_start_stream;
iface->stop_stream = screencast_dummy_wfd_sink_sink_stop_stream;
iface->start_stream = nd_dummy_wfd_sink_sink_start_stream;
iface->stop_stream = nd_dummy_wfd_sink_sink_stop_stream;
}
static void
play_request_cb (ScreencastDummyWFDSink *sink, GstRTSPContext *ctx, WfdClient *client)
play_request_cb (NdDummyWFDSink *sink, GstRTSPContext *ctx, WfdClient *client)
{
g_debug ("ScreencastWfdP2PSink: Got play request from client");
g_debug ("NdWfdP2PSink: Got play request from client");
sink->state = SCREENCAST_SINK_STATE_STREAMING;
sink->state = ND_SINK_STATE_STREAMING;
g_object_notify (G_OBJECT (sink), "state");
}
static void
closed_cb (ScreencastDummyWFDSink *sink, WfdClient *client)
closed_cb (NdDummyWFDSink *sink, WfdClient *client)
{
/* Connection was closed, do a clean shutdown*/
screencast_dummy_wfd_sink_sink_stop_stream (SCREENCAST_SINK (sink));
nd_dummy_wfd_sink_sink_stop_stream (ND_SINK (sink));
}
static void
client_connected_cb (ScreencastDummyWFDSink *sink, WfdClient *client, WfdServer *server)
client_connected_cb (NdDummyWFDSink *sink, WfdClient *client, WfdServer *server)
{
g_debug ("ScreencastWfdP2PSink: Got client connection");
g_debug ("NdWfdP2PSink: Got client connection");
g_signal_handlers_disconnect_by_func (sink->server, client_connected_cb, sink);
sink->state = SCREENCAST_SINK_STATE_WAIT_STREAMING;
sink->state = ND_SINK_STATE_WAIT_STREAMING;
g_object_notify (G_OBJECT (sink), "state");
/* XXX: connect to further events. */
......@@ -172,7 +172,7 @@ client_connected_cb (ScreencastDummyWFDSink *sink, WfdClient *client, WfdServer
}
static GstElement *
server_create_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
server_create_source_cb (NdDummyWFDSink *sink, WfdServer *server)
{
GstElement *res;
......@@ -182,7 +182,7 @@ server_create_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
}
static GstElement *
server_create_audio_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
server_create_audio_source_cb (NdDummyWFDSink *sink, WfdServer *server)
{
GstElement *res;
......@@ -191,12 +191,12 @@ server_create_audio_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
return res;
}
static ScreencastSink *
screencast_dummy_wfd_sink_sink_start_stream (ScreencastSink *sink)
static NdSink *
nd_dummy_wfd_sink_sink_start_stream (NdSink *sink)
{
ScreencastDummyWFDSink *self = SCREENCAST_DUMMY_WFD_SINK (sink);
NdDummyWFDSink *self = ND_DUMMY_WFD_SINK (sink);
g_return_val_if_fail (self->state == SCREENCAST_SINK_STATE_DISCONNECTED, NULL);
g_return_val_if_fail (self->state == ND_SINK_STATE_DISCONNECTED, NULL);
g_assert (self->server == NULL);
......@@ -205,14 +205,14 @@ screencast_dummy_wfd_sink_sink_start_stream (ScreencastSink *sink)
if (self->server_source_id == 0)
{
self->state = SCREENCAST_SINK_STATE_ERROR;
self->state = ND_SINK_STATE_ERROR;
g_object_notify (G_OBJECT (self), "state");
g_clear_object (&self->server);
return NULL;
}
g_debug ("ScreencastDummyWFDSink: You should now be able to connect to rtsp://localhost:7236/wfd1.0");
g_debug ("NdDummyWFDSink: You should now be able to connect to rtsp://localhost:7236/wfd1.0");
g_signal_connect_object (self->server,
"client-connected",
......@@ -232,16 +232,16 @@ screencast_dummy_wfd_sink_sink_start_stream (ScreencastSink *sink)
self,
G_CONNECT_SWAPPED);
self->state = SCREENCAST_SINK_STATE_WAIT_SOCKET;
self->state = ND_SINK_STATE_WAIT_SOCKET;
g_object_notify (G_OBJECT (self), "state");
return g_object_ref (sink);
}
void
screencast_dummy_wfd_sink_sink_stop_stream (ScreencastSink *sink)
nd_dummy_wfd_sink_sink_stop_stream (NdSink *sink)
{
ScreencastDummyWFDSink *self = SCREENCAST_DUMMY_WFD_SINK (sink);
NdDummyWFDSink *self = ND_DUMMY_WFD_SINK (sink);
if (self->server_source_id)