Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
48c24139
Commit
48c24139
authored
13 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#5954: Clean up getSessionMedia methods
parent
92d4dcbf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sflphone-common/src/sip/sdp.cpp
+32
-11
32 additions, 11 deletions
sflphone-common/src/sip/sdp.cpp
sflphone-common/src/sip/sdp.h
+6
-1
6 additions, 1 deletion
sflphone-common/src/sip/sdp.h
sflphone-common/src/sip/sipvoiplink.cpp
+15
-4
15 additions, 4 deletions
sflphone-common/src/sip/sipvoiplink.cpp
with
53 additions
and
16 deletions
sflphone-common/src/sip/sdp.cpp
+
32
−
11
View file @
48c24139
...
...
@@ -136,27 +136,48 @@ void Sdp::setActiveRemoteSdpSession (const pjmedia_sdp_session *sdp)
getRemoteSdpTelephoneEventFromOffer
(
sdp
);
}
AudioCodec
*
Sdp
::
get
SessionMedia
(
void
)
bool
Sdp
::
has
SessionMedia
(
void
)
{
std
::
vector
<
sdpMedia
*>
mediaList
=
getSessionMediaList
();
bool
listNotEmpty
;
int
nb_media
;
int
nb_codec
;
if
(
mediaList
.
size
()
>
0
)
{
listNotEmpty
=
true
;
}
else
{
listNotEmpty
=
false
;
}
return
listNotEmpty
;
}
AudioCodec
*
Sdp
::
getSessionMedia
(
void
)
throw
(
SdpException
)
{
int
nbMedia
;
int
nbCodec
;
sfl
::
Codec
*
codec
=
NULL
;
std
::
vector
<
sdpMedia
*>
media
_l
ist
;
std
::
vector
<
sdpMedia
*>
media
L
ist
;
_debug
(
"SDP: Get session media"
);
media
_l
ist
=
getSessionMediaList
();
nb
_m
edia
=
media
_l
ist
.
size
();
media
L
ist
=
getSessionMediaList
();
nb
M
edia
=
media
L
ist
.
size
();
if
(
nb_media
>
0
)
{
nb_codec
=
media_list
[
0
]
->
get_media_codec_list
().
size
();
if
(
nbMedia
<=
0
)
{
_error
(
"SDP: Error: No media in session description"
);
throw
SdpException
(
"No media description for this SDP"
);
}
if
(
nb_codec
>
0
)
{
codec
=
media_list
[
0
]
->
get_media_codec_list
()
[
0
];
}
nbCodec
=
mediaList
[
0
]
->
get_media_codec_list
().
size
();
if
(
nbCodec
<=
0
)
{
_error
(
"SDP: Error: No codec description for this media"
);
throw
SdpException
(
"No codec description for this media"
);
}
codec
=
mediaList
[
0
]
->
get_media_codec_list
()
[
0
];
return
static_cast
<
AudioCodec
*>
(
codec
);
}
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sdp.h
+
6
−
1
View file @
48c24139
...
...
@@ -149,10 +149,15 @@ class Sdp
}
/**
* Return wether or not the media have been determined for this sdp session
*/
bool
hasSessionMedia
(
void
);
/**
* Return the codec of the first media after negociation
*/
AudioCodec
*
getSessionMedia
(
void
);
AudioCodec
*
getSessionMedia
(
void
)
throw
(
SdpException
)
;
/*
* On building an invite outside a dialog, build the local offer and create the
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/sip/sipvoiplink.cpp
+
15
−
4
View file @
48c24139
...
...
@@ -1347,20 +1347,31 @@ std::string
SIPVoIPLink
::
getCurrentCodecName
()
{
SIPCall
*
call
;
SIPCall
*
call
=
NULL
;
sfl
::
Codec
*
ac
=
NULL
;
std
::
string
name
=
""
;
call
=
getSIPCall
(
Manager
::
instance
().
getCurrentCallId
());
if
(
call
==
NULL
)
{
_error
(
"UserAgent: Error: No current call"
);
// return empty string
return
name
;
}
if
(
call
)
{
if
(
call
->
getLocalSDP
()
->
hasSessionMedia
()
)
{
ac
=
call
->
getLocalSDP
()
->
getSessionMedia
();
}
else
{
return
name
;
}
if
(
ac
)
{
name
=
ac
->
getMimeSubtype
(
);
if
(
ac
==
NULL
)
{
_error
(
"UserAgent: Error: No codec initialized for this session"
);
}
name
=
ac
->
getMimeSubtype
();
return
name
;
}
...
...
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