Philipp Hörist pushed to branch master at gajim / gajim
Commits:
9 changed files:
- gajim/common/app.py
- gajim/common/helpers.py
- gajim/common/jingle_rtp.py
- gajim/common/modules/jingle.py
- gajim/common/multimedia_helpers.py
- gajim/dev/ipython_view.py
- gajim/gtk/features.py
- gajim/gtk/gstreamer.py
- gajim/gtk/preferences.py
Changes:
| ... | ... | @@ -198,6 +198,8 @@ _dependencies = { |
| 198 | 198 |
'AVAHI': False,
|
| 199 | 199 |
'PYBONJOUR': False,
|
| 200 | 200 |
'FARSTREAM': False,
|
| 201 |
+ 'GST': False,
|
|
| 202 |
+ 'AV': False,
|
|
| 201 | 203 |
'GEOCLUE': False,
|
| 202 | 204 |
'UPNP': False,
|
| 203 | 205 |
'PYCURL': False,
|
| ... | ... | @@ -248,28 +250,28 @@ def detect_dependencies(): |
| 248 | 250 |
except Exception:
|
| 249 | 251 |
pass
|
| 250 | 252 |
|
| 251 |
- # FARSTREAM
|
|
| 252 | 253 |
try:
|
| 253 |
- if os.name == 'nt':
|
|
| 254 |
- root_path = Path(sys.executable).parents[1]
|
|
| 255 |
- fs_plugin_path = str(root_path / 'lib' / 'farstream-0.2')
|
|
| 256 |
- gst_plugin_path = str(root_path / 'lib' / 'gstreamer-1.0')
|
|
| 257 |
- os.environ['FS_PLUGIN_PATH'] = fs_plugin_path
|
|
| 258 |
- os.environ['GST_PLUGIN_PATH'] = gst_plugin_path
|
|
| 259 |
- gi.require_version('Farstream', '0.2')
|
|
| 260 |
- from gi.repository import Farstream
|
|
| 261 | 254 |
gi.require_version('Gst', '1.0')
|
| 262 | 255 |
from gi.repository import Gst
|
| 263 |
- try:
|
|
| 264 |
- Gst.init(None)
|
|
| 265 |
- conference = Gst.ElementFactory.make('fsrtpconference', None)
|
|
| 266 |
- conference.new_session(Farstream.MediaType.AUDIO)
|
|
| 267 |
- except Exception as error:
|
|
| 268 |
- log('gajim').info(error)
|
|
| 256 |
+ _dependencies['GST'] = True
|
|
| 257 |
+ except Exception:
|
|
| 258 |
+ pass
|
|
| 259 |
+ |
|
| 260 |
+ try:
|
|
| 261 |
+ gi.require_version('Farstream', '0.2')
|
|
| 262 |
+ from gi.repository import Farstream
|
|
| 269 | 263 |
_dependencies['FARSTREAM'] = True
|
| 270 |
- except (ImportError, ValueError):
|
|
| 264 |
+ except Exception:
|
|
| 271 | 265 |
pass
|
| 272 | 266 |
|
| 267 |
+ try:
|
|
| 268 |
+ Gst.init(None)
|
|
| 269 |
+ conference = Gst.ElementFactory.make('fsrtpconference', None)
|
|
| 270 |
+ conference.new_session(Farstream.MediaType.AUDIO)
|
|
| 271 |
+ _dependencies['AV'] = True
|
|
| 272 |
+ except Exception as error:
|
|
| 273 |
+ log('gajim').info(error)
|
|
| 274 |
+ |
|
| 273 | 275 |
# GEOCLUE
|
| 274 | 276 |
try:
|
| 275 | 277 |
gi.require_version('Geoclue', '2.0')
|
| ... | ... | @@ -1048,7 +1048,7 @@ def update_optional_features(account=None): |
| 1048 | 1048 |
features.append(nbxmpp.NS_BOOKMARKS_2 + '+notify')
|
| 1049 | 1049 |
elif app.connections[account_].get_module('Bookmarks').using_bookmark_1:
|
| 1050 | 1050 |
features.append(nbxmpp.NS_BOOKMARKS + '+notify')
|
| 1051 |
- if app.is_installed('FARSTREAM'):
|
|
| 1051 |
+ if app.is_installed('AV'):
|
|
| 1052 | 1052 |
features.append(nbxmpp.NS_JINGLE_RTP)
|
| 1053 | 1053 |
features.append(nbxmpp.NS_JINGLE_RTP_AUDIO)
|
| 1054 | 1054 |
features.append(nbxmpp.NS_JINGLE_RTP_VIDEO)
|
| ... | ... | @@ -21,10 +21,15 @@ import socket |
| 21 | 21 |
from collections import deque
|
| 22 | 22 |
|
| 23 | 23 |
import nbxmpp
|
| 24 |
-from gi.repository import Farstream
|
|
| 25 |
-from gi.repository import Gst
|
|
| 24 |
+ |
|
| 26 | 25 |
from gi.repository import GLib
|
| 27 | 26 |
|
| 27 |
+try:
|
|
| 28 |
+ from gi.repository import Farstream
|
|
| 29 |
+ from gi.repository import Gst
|
|
| 30 |
+except Exception:
|
|
| 31 |
+ pass
|
|
| 32 |
+ |
|
| 28 | 33 |
from gajim.common import app
|
| 29 | 34 |
from gajim.common.i18n import _
|
| 30 | 35 |
from gajim.common.jingle_transport import JingleTransportICEUDP
|
| ... | ... | @@ -43,8 +43,7 @@ from gajim.common.jingle_session import JingleStates |
| 43 | 43 |
from gajim.common.jingle_ft import JingleFileTransfer
|
| 44 | 44 |
from gajim.common.jingle_transport import JingleTransportSocks5
|
| 45 | 45 |
from gajim.common.jingle_transport import JingleTransportIBB
|
| 46 |
-if app.is_installed('FARSTREAM'):
|
|
| 47 |
- from gajim.common.jingle_rtp import JingleAudio, JingleVideo
|
|
| 46 |
+from gajim.common.jingle_rtp import JingleAudio, JingleVideo
|
|
| 48 | 47 |
|
| 49 | 48 |
logger = logging.getLogger('gajim.c.m.jingle')
|
| 50 | 49 |
|
| ... | ... | @@ -16,11 +16,12 @@ |
| 16 | 16 |
|
| 17 | 17 |
import logging
|
| 18 | 18 |
|
| 19 |
-import gi
|
|
| 20 |
-gi.require_version('Gst', '1.0')
|
|
| 21 |
-from gi.repository import Gst # pylint: disable=wrong-import-position
|
|
| 19 |
+try:
|
|
| 20 |
+ from gi.repository import Gst
|
|
| 21 |
+except Exception:
|
|
| 22 |
+ pass
|
|
| 22 | 23 |
|
| 23 |
-from gajim.common.i18n import _ # pylint: disable=wrong-import-position
|
|
| 24 |
+from gajim.common.i18n import _
|
|
| 24 | 25 |
|
| 25 | 26 |
log = logging.getLogger('gajim.c.multimedia_helpers')
|
| 26 | 27 |
|
| ... | ... | @@ -69,13 +69,12 @@ from gi.repository import GObject |
| 69 | 69 |
from gi.repository import GLib
|
| 70 | 70 |
from gi.repository import Pango
|
| 71 | 71 |
|
| 72 |
-import IPython
|
|
| 73 |
- |
|
| 74 | 72 |
from pygments.token import Token
|
| 75 |
-# pylint: disable=ungrouped-imports
|
|
| 73 |
+ |
|
| 74 |
+import IPython
|
|
| 76 | 75 |
from IPython.core.displayhook import DisplayHook
|
| 77 | 76 |
from IPython.core.display_trap import DisplayTrap
|
| 78 |
-# pylint: enable=ungrouped-imports
|
|
| 77 |
+ |
|
| 79 | 78 |
|
| 80 | 79 |
|
| 81 | 80 |
class MyPromptDisplayHook(DisplayHook):
|
| ... | ... | @@ -91,7 +91,7 @@ class FeaturesDialog(Gtk.Dialog): |
| 91 | 91 |
|
| 92 | 92 |
return [
|
| 93 | 93 |
Feature(_('Audio / Video'),
|
| 94 |
- app.is_installed('FARSTREAM'),
|
|
| 94 |
+ app.is_installed('AV'),
|
|
| 95 | 95 |
_('Enables Gajim to provide Audio and Video chats'),
|
| 96 | 96 |
_('Requires: gir1.2-farstream-0.2, gir1.2-gstreamer-1.0, '
|
| 97 | 97 |
'gstreamer1.0-libav, gstreamer1.0-plugins-ugly'),
|
| 1 | 1 |
from typing import Tuple, Optional
|
| 2 | 2 |
|
| 3 |
-from gi.repository import Gst
|
|
| 4 | 3 |
from gi.repository import Gtk
|
| 5 | 4 |
|
| 6 |
-def create_gtk_widget() -> Tuple[Optional[Gst.Element], Optional[Gtk.Widget], Optional[str]]:
|
|
| 5 |
+try:
|
|
| 6 |
+ from gi.repository import Gst
|
|
| 7 |
+except Exception:
|
|
| 8 |
+ pass
|
|
| 9 |
+ |
|
| 10 |
+ |
|
| 11 |
+def create_gtk_widget() -> Tuple[Optional[Gst.Element],
|
|
| 12 |
+ Optional[Gtk.Widget],
|
|
| 13 |
+ Optional[str]]:
|
|
| 14 |
+ |
|
| 7 | 15 |
gtkglsink = Gst.ElementFactory.make('gtkglsink', None)
|
| 8 | 16 |
if gtkglsink is not None:
|
| 9 | 17 |
glsinkbin = Gst.ElementFactory.make('glsinkbin', None)
|
| ... | ... | @@ -19,6 +19,11 @@ from gi.repository import Gtk |
| 19 | 19 |
from gi.repository import Gdk
|
| 20 | 20 |
from gi.repository import Pango
|
| 21 | 21 |
|
| 22 |
+try:
|
|
| 23 |
+ from gi.repository import Gst
|
|
| 24 |
+except Exception:
|
|
| 25 |
+ pass
|
|
| 26 |
+ |
|
| 22 | 27 |
from gajim.common import app
|
| 23 | 28 |
from gajim.common import configpaths
|
| 24 | 29 |
from gajim.common import helpers
|
| ... | ... | @@ -28,6 +33,9 @@ from gajim.common.nec import NetworkEvent |
| 28 | 33 |
from gajim.common.i18n import _
|
| 29 | 34 |
from gajim.common.i18n import ngettext
|
| 30 | 35 |
from gajim.common.helpers import open_file
|
| 36 |
+from gajim.common.multimedia_helpers import AudioInputManager
|
|
| 37 |
+from gajim.common.multimedia_helpers import AudioOutputManager
|
|
| 38 |
+from gajim.common.multimedia_helpers import VideoInputManager
|
|
| 31 | 39 |
|
| 32 | 40 |
from gajim.chat_control_base import ChatControlBase
|
| 33 | 41 |
|
| ... | ... | @@ -40,14 +48,6 @@ from gajim.gtk.sounds import ManageSounds |
| 40 | 48 |
from gajim.gtk.const import ControlType
|
| 41 | 49 |
from gajim.gtk import gstreamer
|
| 42 | 50 |
|
| 43 |
-try:
|
|
| 44 |
- from gajim.common.multimedia_helpers import AudioInputManager, AudioOutputManager
|
|
| 45 |
- from gajim.common.multimedia_helpers import VideoInputManager
|
|
| 46 |
- from gi.repository import Gst # pylint: disable=ungrouped-imports
|
|
| 47 |
- HAS_GST = True
|
|
| 48 |
-except (ImportError, ValueError):
|
|
| 49 |
- HAS_GST = False
|
|
| 50 |
- |
|
| 51 | 51 |
if app.is_installed('GSPELL'):
|
| 52 | 52 |
from gi.repository import Gspell # pylint: disable=ungrouped-imports
|
| 53 | 53 |
|
| ... | ... | @@ -358,7 +358,7 @@ class Preferences(Gtk.ApplicationWindow): |
| 358 | 358 |
if config == value:
|
| 359 | 359 |
combobox.set_active(index)
|
| 360 | 360 |
|
| 361 |
- if HAS_GST and app.is_installed('FARSTREAM'):
|
|
| 361 |
+ if app.is_installed('AV'):
|
|
| 362 | 362 |
create_av_combobox('audio_input', AudioInputManager().get_devices())
|
| 363 | 363 |
create_av_combobox('audio_output', AudioOutputManager().get_devices())
|
| 364 | 364 |
create_av_combobox('video_input', VideoInputManager().get_devices())
|