Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnome-network-displays
Commits
7d893b0b
Commit
7d893b0b
authored
May 06, 2019
by
Benjamin Berg
Browse files
Rename to GNOME Network Displays
Closes
#22
parent
9ceb1e8d
Changes
50
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
7d893b0b
This is an experimental
GNOME Screencaster
implement
ing
Wi-Fi Display (aka Miracast).
This is an experimental implement
ation 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.
...
...
data/meson.build
View file @
7d893b0b
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')
)
...
...
data/org.gnome.
Screencast
.appdata.xml.in
→
data/org.gnome.
NetworkDisplays
.appdata.xml.in
View file @
7d893b0b
<?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>
...
...
data/org.gnome.
Screencast
.desktop.in
→
data/org.gnome.
NetworkDisplays
.desktop.in
View file @
7d893b0b
[Desktop Entry]
Name=
gnome-screencast
Exec=gnome-
screencast
Name=
GNOME Network Displays
Exec=gnome-
network-displays
Terminal=false
Type=Application
Categories=GTK;
...
...
data/org.gnome.
Screencast
.gschema.xml
→
data/org.gnome.
NetworkDisplays
.gschema.xml
View file @
7d893b0b
<?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>
meson.build
View file @
7d893b0b
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')
po/POTFILES.in
View file @
7d893b0b
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
po/meson.build
View file @
7d893b0b
i18n.gettext('gnome-
screencast
', preset: 'glib')
i18n.gettext('gnome-
network-displays
', preset: 'glib')
src/gnome-
screencast
.gresource.xml
→
src/gnome-
network-displays
.gresource.xml
View file @
7d893b0b
<?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>
src/main.c
View file @
7d893b0b
...
...
@@ -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
...
...
src/meson.build
View file @
7d893b0b
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
)
src/
screencast
-dummy-provider.c
→
src/
nd
-dummy-provider.c
View file @
7d893b0b
/*
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
_
Screencast
DummyProvider
struct
_
Nd
DummyProvider
{
GObject
parent_instance
;
...
...
@@ -35,21 +35,21 @@ enum {
PROP_LAST
=
PROP_DISCOVER
,
};
static
void
screencast
_dummy_provider_provider_iface_init
(
Screencast
ProviderIface
*
iface
);
static
GList
*
screencast
_dummy_provider_provider_get_sinks
(
Screencast
Provider
*
provider
);
static
void
nd
_dummy_provider_provider_iface_init
(
Nd
ProviderIface
*
iface
);
static
GList
*
nd
_dummy_provider_provider_get_sinks
(
Nd
Provider
*
provider
);
G_DEFINE_TYPE_EXTENDED
(
Screencast
DummyProvider
,
screencast
_dummy_provider
,
G_TYPE_OBJECT
,
0
,
G_IMPLEMENT_INTERFACE
(
SCREENCAST
_TYPE_PROVIDER
,
screencast
_dummy_provider_provider_iface_init
);
G_DEFINE_TYPE_EXTENDED
(
Nd
DummyProvider
,
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
)
{
Screencast
DummyProvider
*
self
=
SCREENCAST
_DUMMY_PROVIDER
(
object
);
Nd
DummyProvider
*
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
)
{
Screencast
DummyProvider
*
self
=
SCREENCAST
_DUMMY_PROVIDER
(
object
);
Nd
DummyProvider
*
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
)
{
Screencast
DummyProvider
*
dummy_provider
=
SCREENCAST
_DUMMY_PROVIDER
(
object
);
Nd
DummyProvider
*
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
(
Screencast
DummyProviderClass
*
klass
)
nd
_dummy_provider_class_init
(
Nd
DummyProviderClass
*
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
(
Screencast
DummyProvider
*
dummy_provider
)
nd
_dummy_provider_init
(
Nd
DummyProvider
*
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
());
}
/******************************************************************
*
Screencast
Provider interface implementation
*
Nd
Provider interface implementation
******************************************************************/
static
void
screencast
_dummy_provider_provider_iface_init
(
Screencast
ProviderIface
*
iface
)
nd
_dummy_provider_provider_iface_init
(
Nd
ProviderIface
*
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
(
Screencast
Provider
*
provider
)
nd
_dummy_provider_provider_get_sinks
(
Nd
Provider
*
provider
)
{
Screencast
DummyProvider
*
dummy_provider
=
SCREENCAST
_DUMMY_PROVIDER
(
provider
);
Nd
DummyProvider
*
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
;
}
Screencast
DummyProvider
*
screencast
_dummy_provider_new
(
void
)
Nd
DummyProvider
*
nd
_dummy_provider_new
(
void
)
{
return
g_object_new
(
SCREENCAST
_TYPE_DUMMY_PROVIDER
,
return
g_object_new
(
ND
_TYPE_DUMMY_PROVIDER
,
NULL
);
}
src/nd-dummy-provider.h
0 → 100644
View file @
7d893b0b
#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
src/
screencast
-dummy-wfd-sink.c
→
src/
nd
-dummy-wfd-sink.c
View file @
7d893b0b
/*
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
_
Screencast
DummyWFDSink
struct
_
Nd
DummyWFDSink
{
GObject
parent_instance
;
GObject
parent_instance
;
Screencast
SinkState
state
;
Nd
SinkState
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
(
Screencast
SinkIface
*
iface
);
static
ScreencastSink
*
screencast
_dummy_wfd_sink_sink_start_stream
(
Screencast
Sink
*
sink
);
static
void
screencast
_dummy_wfd_sink_sink_stop_stream
(
Screencast
Sink
*
sink
);
static
void
nd
_dummy_wfd_sink_sink_iface_init
(
Nd
SinkIface
*
iface
);
static
NdSink
*
nd
_dummy_wfd_sink_sink_start_stream
(
Nd
Sink
*
sink
);
static
void
nd
_dummy_wfd_sink_sink_stop_stream
(
Nd
Sink
*
sink
);
G_DEFINE_TYPE_EXTENDED
(
Screencast
DummyWFDSink
,
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
(
Nd
DummyWFDSink
,
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
)
{
Screencast
DummyWFDSink
*
sink
=
SCREENCAST
_DUMMY_WFD_SINK
(
object
);
Nd
DummyWFDSink
*
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
(
Screencast
DummyWFDSinkClass
*
klass
)
nd
_dummy_wfd_sink_class_init
(
Nd
DummyWFDSinkClass
*
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
(
Screencast
DummyWFDSink
*
sink
)
nd
_dummy_wfd_sink_init
(
Nd
DummyWFDSink
*
sink
)
{
sink
->
state
=
SCREENCAST
_SINK_STATE_DISCONNECTED
;
sink
->
state
=
ND
_SINK_STATE_DISCONNECTED
;
}
/******************************************************************
*
Screencast
Sink interface implementation
*
Nd
Sink interface implementation
******************************************************************/
static
void
screencast
_dummy_wfd_sink_sink_iface_init
(
Screencast
SinkIface
*
iface
)
nd
_dummy_wfd_sink_sink_iface_init
(
Nd
SinkIface
*
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
(
Screencast
DummyWFDSink
*
sink
,
GstRTSPContext
*
ctx
,
WfdClient
*
client
)
play_request_cb
(
Nd
DummyWFDSink
*
sink
,
GstRTSPContext
*
ctx
,
WfdClient
*
client
)
{
g_debug
(
"
Screencast
WfdP2PSink: Got play request from client"
);
g_debug
(
"
Nd
WfdP2PSink: 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
(
Screencast
DummyWFDSink
*
sink
,
WfdClient
*
client
)
closed_cb
(
Nd
DummyWFDSink
*
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
(
Screencast
DummyWFDSink
*
sink
,
WfdClient
*
client
,
WfdServer
*
server
)
client_connected_cb
(
Nd
DummyWFDSink
*
sink
,
WfdClient
*
client
,
WfdServer
*
server
)
{
g_debug
(
"
Screencast
WfdP2PSink: Got client connection"
);
g_debug
(
"
Nd
WfdP2PSink: 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
(
Screencast
DummyWFDSink
*
sink
,
WfdServer
*
server
)
server_create_source_cb
(
Nd
DummyWFDSink
*
sink
,
WfdServer
*
server
)
{
GstElement
*
res
;
...
...
@@ -182,7 +182,7 @@ server_create_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
}
static
GstElement
*
server_create_audio_source_cb
(
Screencast
DummyWFDSink
*
sink
,
WfdServer
*
server
)
server_create_audio_source_cb
(
Nd
DummyWFDSink
*
sink
,
WfdServer
*
server
)
{
GstElement
*
res
;
...
...
@@ -191,12 +191,12 @@ server_create_audio_source_cb (ScreencastDummyWFDSink *sink, WfdServer *server)
return
res
;
}
static
Screencast
Sink
*
screencast
_dummy_wfd_sink_sink_start_stream
(
Screencast
Sink
*
sink
)
static
Nd
Sink
*
nd
_dummy_wfd_sink_sink_start_stream
(
Nd
Sink
*
sink
)
{
Screencast
DummyWFDSink
*
self
=
SCREENCAST
_DUMMY_WFD_SINK
(
sink
);
Nd
DummyWFDSink
*
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
(
"
Screencast
DummyWFDSink: You should now be able to connect to rtsp://localhost:7236/wfd1.0"
);
g_debug
(
"
Nd
DummyWFDSink: 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
(
Screencast
Sink
*
sink
)
nd
_dummy_wfd_sink_sink_stop_stream
(
Nd
Sink
*
sink
)
{
Screencast
DummyWFDSink
*
self
=
SCREENCAST
_DUMMY_WFD_SINK
(
sink
);
Nd
DummyWFDSink
*
self
=
ND
_DUMMY_WFD_SINK
(
sink
);
if
(
self
->
server_source_id
)