Merge local changes.
This commit is contained in:
		
						commit
						750f032c4b
					
				
					 3 changed files with 27 additions and 26 deletions
				
			
		| 
						 | 
					@ -19,6 +19,7 @@ import gobject
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import xmpp
 | 
					import xmpp
 | 
				
			||||||
import farsight, gst
 | 
					import farsight, gst
 | 
				
			||||||
 | 
					from glib import GError
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import gajim
 | 
					import gajim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,12 +36,12 @@ class JingleRTPContent(JingleContent):
 | 
				
			||||||
		self._dtmf_running = False
 | 
							self._dtmf_running = False
 | 
				
			||||||
		self.farsight_media = {'audio': farsight.MEDIA_TYPE_AUDIO,
 | 
							self.farsight_media = {'audio': farsight.MEDIA_TYPE_AUDIO,
 | 
				
			||||||
								'video': farsight.MEDIA_TYPE_VIDEO}[media]
 | 
													'video': farsight.MEDIA_TYPE_VIDEO}[media]
 | 
				
			||||||
		self.got_codecs = False
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		self.candidates_ready = False # True when local candidates are prepared
 | 
							self.candidates_ready = False # True when local candidates are prepared
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		self.callbacks['session-initiate'] += [self.__on_remote_codecs]
 | 
							self.callbacks['session-initiate'] += [self.__on_remote_codecs]
 | 
				
			||||||
		self.callbacks['content-add'] += [self.__on_remote_codecs]
 | 
							self.callbacks['content-add'] += [self.__on_remote_codecs]
 | 
				
			||||||
 | 
							self.callbacks['description-info'] += [self.__on_remote_codecs]
 | 
				
			||||||
		self.callbacks['content-accept'] += [self.__on_remote_codecs,
 | 
							self.callbacks['content-accept'] += [self.__on_remote_codecs,
 | 
				
			||||||
			self.__on_content_accept]
 | 
								self.__on_content_accept]
 | 
				
			||||||
		self.callbacks['session-accept'] += [self.__on_remote_codecs,
 | 
							self.callbacks['session-accept'] += [self.__on_remote_codecs,
 | 
				
			||||||
| 
						 | 
					@ -177,8 +178,6 @@ class JingleRTPContent(JingleContent):
 | 
				
			||||||
		"""
 | 
							"""
 | 
				
			||||||
		Get peer codecs from what we get from peer
 | 
							Get peer codecs from what we get from peer
 | 
				
			||||||
		"""
 | 
							"""
 | 
				
			||||||
		if self.got_codecs:
 | 
					 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		codecs = []
 | 
							codecs = []
 | 
				
			||||||
		for codec in content.getTag('description').iterTags('payload-type'):
 | 
							for codec in content.getTag('description').iterTags('payload-type'):
 | 
				
			||||||
| 
						 | 
					@ -197,7 +196,6 @@ class JingleRTPContent(JingleContent):
 | 
				
			||||||
			# glib.GError: There was no intersection between the remote codecs and
 | 
								# glib.GError: There was no intersection between the remote codecs and
 | 
				
			||||||
			# the local ones
 | 
								# the local ones
 | 
				
			||||||
			self.p2pstream.set_remote_codecs(codecs)
 | 
								self.p2pstream.set_remote_codecs(codecs)
 | 
				
			||||||
			self.got_codecs = True
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def iter_codecs(self):
 | 
						def iter_codecs(self):
 | 
				
			||||||
		codecs = self.p2psession.get_property('codecs')
 | 
							codecs = self.p2psession.get_property('codecs')
 | 
				
			||||||
| 
						 | 
					@ -252,18 +250,21 @@ class JingleAudio(JingleRTPContent):
 | 
				
			||||||
		self.p2psession.set_codec_preferences(codecs)
 | 
							self.p2psession.set_codec_preferences(codecs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		# the local parts
 | 
							# the local parts
 | 
				
			||||||
 | 
							# TODO: Add queues?
 | 
				
			||||||
		try:
 | 
							try:
 | 
				
			||||||
			self.sink = gst.parse_bin_from_description(gajim.config.get('audio_output_device'), True)
 | 
								src_bin = gst.parse_bin_from_description('%s ! audioconvert'
 | 
				
			||||||
		except:
 | 
									% gajim.config.get('audio_input_device'), True)
 | 
				
			||||||
			self.session.connection.dispatch('ERROR', (_("Audio configuration error"),
 | 
							except GError:
 | 
				
			||||||
				_("Couldn't setup audio output. Check your audio configuration.")))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		try:
 | 
					 | 
				
			||||||
			src_bin = gst.parse_bin_from_description(gajim.config.get('audio_input_device'), True)
 | 
					 | 
				
			||||||
		except:
 | 
					 | 
				
			||||||
			self.session.connection.dispatch('ERROR', (_("Audio configuration error"),
 | 
								self.session.connection.dispatch('ERROR', (_("Audio configuration error"),
 | 
				
			||||||
				_("Couldn't setup audio input. Check your audio configuration.")))
 | 
									_("Couldn't setup audio input. Check your audio configuration.")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							try:
 | 
				
			||||||
 | 
								self.sink = gst.parse_bin_from_description('audioconvert ! %s'
 | 
				
			||||||
 | 
									% gajim.config.get('audio_output_device'), True)
 | 
				
			||||||
 | 
							except GError:
 | 
				
			||||||
 | 
								self.session.connection.dispatch('ERROR', (_("Audio configuration error"),
 | 
				
			||||||
 | 
									_("Couldn't setup audio output. Check your audio configuration.")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		self.mic_volume = src_bin.get_by_name('gajim_vol')
 | 
							self.mic_volume = src_bin.get_by_name('gajim_vol')
 | 
				
			||||||
		self.mic_volume.set_property('volume', 1)
 | 
							self.mic_volume.set_property('volume', 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -291,24 +292,26 @@ class JingleVideo(JingleRTPContent):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		# the local parts
 | 
							# the local parts
 | 
				
			||||||
		try:
 | 
							try:
 | 
				
			||||||
			src_bin = gst.parse_bin_from_description(gajim.config.get('video_input_device'), True)
 | 
								src_bin = gst.parse_bin_from_description('%s ! videoscale ! ffmpegcolorspace'
 | 
				
			||||||
		except:
 | 
									% gajim.config.get('video_input_device'), True)
 | 
				
			||||||
 | 
							except GError:
 | 
				
			||||||
			self.session.connection.dispatch('ERROR', (_("Video configuration error"),
 | 
								self.session.connection.dispatch('ERROR', (_("Video configuration error"),
 | 
				
			||||||
				_("Couldn't setup video input. Check your video configuration.")))
 | 
									_("Couldn't setup video input. Check your video configuration.")))
 | 
				
			||||||
		caps = gst.element_factory_make('capsfilter')
 | 
							#caps = gst.element_factory_make('capsfilter')
 | 
				
			||||||
		caps.set_property('caps', gst.caps_from_string('video/x-raw-yuv, width=320, height=240'))
 | 
							#caps.set_property('caps', gst.caps_from_string('video/x-raw-yuv, width=320, height=240'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		self.pipeline.add(src_bin, caps)
 | 
							self.pipeline.add(src_bin)#, caps)
 | 
				
			||||||
		src_bin.link(caps)
 | 
							#src_bin.link(caps)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		try:
 | 
							try:
 | 
				
			||||||
			self.sink = gst.parse_bin_from_description(gajim.config.get('video_output_device'), True)
 | 
								self.sink = gst.parse_bin_from_description('videoscale ! ffmpegcolorspace ! %s'
 | 
				
			||||||
		except:
 | 
									% gajim.config.get('video_output_device'), True)
 | 
				
			||||||
 | 
							except GError:
 | 
				
			||||||
			self.session.connection.dispatch('ERROR', (_("Video configuration error"),
 | 
								self.session.connection.dispatch('ERROR', (_("Video configuration error"),
 | 
				
			||||||
				_("Couldn't setup video output. Check your video configuration.")))
 | 
									_("Couldn't setup video output. Check your video configuration.")))
 | 
				
			||||||
		self.pipeline.add(self.sink)
 | 
							self.pipeline.add(self.sink)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		caps.get_pad('src').link(self.p2psession.get_property('sink-pad'))
 | 
							src_bin.get_pad('src').link(self.p2psession.get_property('sink-pad'))
 | 
				
			||||||
		self.p2pstream.connect('src-pad-added', self._on_src_pad_added)
 | 
							self.p2pstream.connect('src-pad-added', self._on_src_pad_added)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		# The following is needed for farsight to process ICE requests:
 | 
							# The following is needed for farsight to process ICE requests:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,7 @@ Handles Jingle sessions (XEP 0166)
 | 
				
			||||||
# * security preconditions
 | 
					# * security preconditions
 | 
				
			||||||
# * actions:
 | 
					# * actions:
 | 
				
			||||||
#   - content-modify
 | 
					#   - content-modify
 | 
				
			||||||
#   - description-info, session-info
 | 
					#   - session-info
 | 
				
			||||||
#   - security-info
 | 
					#   - security-info
 | 
				
			||||||
#   - transport-accept, transport-reject
 | 
					#   - transport-accept, transport-reject
 | 
				
			||||||
#   - Tie-breaking
 | 
					#   - Tie-breaking
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,11 +78,9 @@ class VideoInputManager(DeviceManager):
 | 
				
			||||||
		self.detect_element('videotestsrc', _('Video test'),
 | 
							self.detect_element('videotestsrc', _('Video test'),
 | 
				
			||||||
			'%s is-live=true')
 | 
								'%s is-live=true')
 | 
				
			||||||
		# Auto src
 | 
							# Auto src
 | 
				
			||||||
		self.detect_element('autovideosrc', _('Autodetect'),
 | 
							self.detect_element('autovideosrc', _('Autodetect'))
 | 
				
			||||||
			'%s ! videoscale ! ffmpegcolorspace')
 | 
					 | 
				
			||||||
		# V4L2 src ; TODO: Figure out why it doesn't work
 | 
							# V4L2 src ; TODO: Figure out why it doesn't work
 | 
				
			||||||
		self.detect_element('v4l2src', _('V4L2: %s'),
 | 
							self.detect_element('v4l2src', _('V4L2: %s'))
 | 
				
			||||||
			'%s ! videoscale ! ffmpegcolorspace')
 | 
					 | 
				
			||||||
		# Funny things, just to test...
 | 
							# Funny things, just to test...
 | 
				
			||||||
		# self.devices['GOOM'] = 'audiotestsrc ! goom'
 | 
							# self.devices['GOOM'] = 'audiotestsrc ! goom'
 | 
				
			||||||
		# self.devices['screen'] = 'ximagesrc'
 | 
							# self.devices['screen'] = 'ximagesrc'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue