Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
caf95ead
Commit
caf95ead
authored
6 years ago
by
streaps
Committed by
Philipp Hörist
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Jingle Audio: Update codecs
Fixes #9535
parent
3841ed51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/common/jingle_rtp.py
+27
-9
27 additions, 9 deletions
gajim/common/jingle_rtp.py
with
27 additions
and
9 deletions
gajim/common/jingle_rtp.py
+
27
−
9
View file @
caf95ead
...
@@ -301,8 +301,9 @@ class JingleRTPContent(JingleContent):
...
@@ -301,8 +301,9 @@ class JingleRTPContent(JingleContent):
attrs
=
{
attrs
=
{
'
name
'
:
codec
.
encoding_name
,
'
name
'
:
codec
.
encoding_name
,
'
id
'
:
codec
.
id
,
'
id
'
:
codec
.
id
,
'
channels
'
:
codec
.
channels
}
}
if
codec
.
channels
>
0
:
attrs
[
'
channels
'
]
=
codec
.
channels
if
codec
.
clock_rate
:
if
codec
.
clock_rate
:
attrs
[
'
clockrate
'
]
=
codec
.
clock_rate
attrs
[
'
clockrate
'
]
=
codec
.
clock_rate
if
codec
.
optional_params
:
if
codec
.
optional_params
:
...
@@ -350,18 +351,35 @@ class JingleAudio(JingleRTPContent):
...
@@ -350,18 +351,35 @@ class JingleAudio(JingleRTPContent):
def
setup_stream
(
self
):
def
setup_stream
(
self
):
JingleRTPContent
.
setup_stream
(
self
,
self
.
_on_src_pad_added
)
JingleRTPContent
.
setup_stream
(
self
,
self
.
_on_src_pad_added
)
# Configure SPEEX
# list of codecs that are explicitly allowed
# Workaround for psi (not needed since rev
allow_codecs
=
[
# 147aedcea39b43402fe64c533d1866a25449888a):
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
OPUS
'
,
# place 16kHz before 8kHz, as buggy psi versions will take in
Farstream
.
MediaType
.
AUDIO
,
48000
),
# account only the first codec
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
SPEEX
'
,
Farstream
.
MediaType
.
AUDIO
,
32000
),
codecs
=
[
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
SPEEX
'
,
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
SPEEX
'
,
Farstream
.
MediaType
.
AUDIO
,
16000
),
Farstream
.
MediaType
.
AUDIO
,
16000
),
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
G722
'
,
Farstream
.
MediaType
.
AUDIO
,
8000
),
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
SPEEX
'
,
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
SPEEX
'
,
Farstream
.
MediaType
.
AUDIO
,
8000
),
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
PCMA
'
,
Farstream
.
MediaType
.
AUDIO
,
8000
),
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_ANY
,
'
PCMU
'
,
Farstream
.
MediaType
.
AUDIO
,
8000
)]
Farstream
.
MediaType
.
AUDIO
,
8000
)]
self
.
p2psession
.
set_codec_preferences
(
codecs
)
# disable all other codecs
disable_codecs
=
[]
codecs_without_config
=
self
.
p2psession
.
props
.
codecs_without_config
allowed_encoding_names
=
[
c
.
encoding_name
for
c
in
allow_codecs
]
+
[
'
telephone-event
'
]
for
codec
in
codecs_without_config
:
if
codec
.
encoding_name
not
in
allowed_encoding_names
:
disable_codecs
.
append
(
Farstream
.
Codec
.
new
(
Farstream
.
CODEC_ID_DISABLE
,
codec
.
encoding_name
,
Farstream
.
MediaType
.
AUDIO
,
codec
.
clock_rate
))
self
.
p2psession
.
set_codec_preferences
(
allow_codecs
+
disable_codecs
)
# the local parts
# the local parts
# TODO: Add queues?
# TODO: Add queues?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment