Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* move source and rename ServerSource to ClientConnection
* split audio into a mixin

git-svn-id: https://xpra.org/svn/Xpra/trunk@18560 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 23, 2018
1 parent 46f6fca commit 36360a2
Show file tree
Hide file tree
Showing 8 changed files with 537 additions and 483 deletions.
2 changes: 1 addition & 1 deletion src/xpra/server/mixins/window_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def add_windows_info(self, info, window_ids):
winfo.setdefault(wid, {}).update(self.get_window_info(window))

def get_window_info(self, window):
from xpra.server.source import make_window_metadata
from xpra.server.window.metadata import make_window_metadata
info = {}
for prop in window.get_property_names():
if prop=="icon" or prop is None:
Expand Down
10 changes: 5 additions & 5 deletions src/xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def drop_client(reason="unknown", *args):
def get_window_id(wid):
return self._window_to_id.get(wid)
bandwidth_limit = self.get_client_bandwidth_limit(proto)
ServerSourceClass = self.get_server_source_class()
ss = ServerSourceClass(proto, drop_client,
ClientConnectionClass = self.get_server_source_class()
ss = ClientConnectionClass(proto, drop_client,
self.idle_add, self.timeout_add, self.source_remove, self.setting_changed,
self.idle_timeout, self.idle_timeout_cb, self.idle_grace_timeout_cb,
self._socket_dir, self.unix_socket_paths, not is_request, self.dbus_control,
Expand All @@ -313,7 +313,7 @@ def get_window_id(wid):
self.speaker_codecs, self.microphone_codecs,
self.default_quality, self.default_min_quality,
self.default_speed, self.default_min_speed)
log("process_hello serversource=%s", ss)
log("process_hello clientconnection=%s", ss)
try:
ss.parse_hello(c, self.min_mmap_size)
except:
Expand Down Expand Up @@ -350,8 +350,8 @@ def notify_new_user(self, ss):


def get_server_source_class(self):
from xpra.server.source import ServerSource
return ServerSource
from xpra.server.source.client_connection import ClientConnection
return ClientConnection

def reset_window_filters(self):
self.window_filters = []
Expand Down
4 changes: 4 additions & 0 deletions src/xpra/server/source/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is part of Xpra.
# Copyright (C) 2018 Antoine Martin <antoine@devloop.org.uk>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.
485 changes: 485 additions & 0 deletions src/xpra/server/source/audio_mixin.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# This file is part of Xpra.
# Copyright (C) 2011 Serviware (Arthur Huillet, <ahuillet@serviware.com>)
# Copyright (C) 2010-2017 Antoine Martin <antoine@devloop.org.uk>
# Copyright (C) 2010-2018 Antoine Martin <antoine@devloop.org.uk>
# Copyright (C) 2008 Nathaniel Smith <njs@pobox.com>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.
Expand Down
6 changes: 3 additions & 3 deletions src/xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class WindowSource(object):
We create a Window Source for each window we send pixels for.
The UI thread calls 'damage' for screen updates,
we eventually call 'ServerSource.call_in_encode_thread' to queue the damage compression,
we eventually call 'ClientConnection.call_in_encode_thread' to queue the damage compression,
the function can then submit the packet using the 'queue_damage_packet' callback.
(also by 'send_window_icon' and clibpoard packets)
Expand Down Expand Up @@ -121,7 +121,7 @@ def __init__(self,
self.compressed_wrapper = compressed_wrapper #callback utility for making compressed wrappers
self.wid = wid
self.window = window #only to be used from the UI thread!
self.global_statistics = statistics #shared/global statistics from ServerSource
self.global_statistics = statistics #shared/global statistics from ClientConnection
self.statistics = WindowPerformanceStatistics()
self.av_sync = av_sync
self.av_sync_delay = av_sync_delay
Expand Down Expand Up @@ -173,7 +173,7 @@ def __init__(self,
self.window_dimensions = ww, wh
self.mapped_at = None
self.fullscreen = not self.is_tray and window.get("fullscreen")
self.scaling_control = default_encoding_options.intget("scaling.control", 1) #ServerSource sets defaults with the client's scaling.control value
self.scaling_control = default_encoding_options.intget("scaling.control", 1) #ClientConnection sets defaults with the client's scaling.control value
self.scaling = None
self.maximized = False #set by the client!
self.iconic = False
Expand Down
8 changes: 4 additions & 4 deletions src/xpra/x11/x11_source.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# This file is part of Xpra.
# Copyright (C) 2015 Antoine Martin <antoine@devloop.org.uk>
# Copyright (C) 2015-2018 Antoine Martin <antoine@devloop.org.uk>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

from xpra.server.source import ServerSource
from xpra.server.source.client_connection import ClientConnection
from xpra.gtk_common.gobject_compat import get_xid
from xpra.gtk_common.error import xsync
from xpra.x11.gtk_x11.prop import prop_get, get_python_type
Expand All @@ -28,13 +28,13 @@ def get_x11_window_value(filter_object, window):
return v


class X11ServerSource(ServerSource):
class X11ServerSource(ClientConnection):
""" Adds the ability to filter windows using X11 properties """

def get_window_filter(self, object_name, property_name, operator, value):
if object_name.lower() not in ("x11window", "window"):
raise ValueError("invalid object name")
wf = ServerSource.get_window_filter(self, "window", property_name, operator, value)
wf = ClientConnection.get_window_filter(self, "window", property_name, operator, value)
if object_name.lower()=="x11window":
#same filter but use X11 properties:
def get_window_value(window):
Expand Down

0 comments on commit 36360a2

Please sign in to comment.