Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
129
Issues
129
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
0f6ffcac
Commit
0f6ffcac
authored
Jun 01, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dring/call: send video codec to client
Change-Id: I919aa2607b1d0dcc33b7b02f90b97b1b8fd1ef98
parent
18669df2
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
31 additions
and
57 deletions
+31
-57
src/call.h
src/call.h
+5
-2
src/client/configurationmanager.cpp
src/client/configurationmanager.cpp
+1
-1
src/dring/call_const.h
src/dring/call_const.h
+2
-0
src/media/audio/audio_sender.cpp
src/media/audio/audio_sender.cpp
+1
-1
src/media/media_encoder.cpp
src/media/media_encoder.cpp
+0
-18
src/media/media_encoder.h
src/media/media_encoder.h
+2
-2
src/media/rtp_session.h
src/media/rtp_session.h
+2
-0
src/media/video/video_rtp_session.cpp
src/media/video/video_rtp_session.cpp
+0
-7
src/media/video/video_rtp_session.h
src/media/video/video_rtp_session.h
+1
-7
src/media/video/video_sender.cpp
src/media/video/video_sender.cpp
+1
-7
src/media/video/video_sender.h
src/media/video/video_sender.h
+1
-6
src/sip/sipcall.cpp
src/sip/sipcall.cpp
+12
-5
src/sip/sipcall.h
src/sip/sipcall.h
+3
-1
No files found.
src/call.h
View file @
0f6ffcac
...
...
@@ -298,8 +298,11 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
void
onTextMessage
(
std
::
map
<
std
::
string
,
std
::
string
>&&
messages
);
virtual
bool
useVideoCodec
(
const
AccountVideoCodecInfo
*
/*codec*/
)
const
{
return
false
;
virtual
std
::
shared_ptr
<
AccountCodecInfo
>
getAudioCodec
()
const
{
return
{};
}
virtual
std
::
shared_ptr
<
AccountCodecInfo
>
getVideoCodec
()
const
{
return
{};
}
virtual
void
restartMediaSender
()
=
0
;
...
...
src/client/configurationmanager.cpp
View file @
0f6ffcac
...
...
@@ -505,7 +505,7 @@ setCodecDetails(const std::string& accountID,
JAMI_WARN
(
"parameters for %s changed "
,
foundCodec
->
systemCodecInfo
.
name
.
c_str
());
if
(
auto
call
=
jami
::
Manager
::
instance
().
getCurrentCall
())
{
if
(
call
->
useVideoCodec
(
foundCodec
.
get
())
)
{
if
(
call
->
getVideoCodec
()
==
foundCodec
)
{
JAMI_WARN
(
"%s running. Need to restart encoding"
,
foundCodec
->
systemCodecInfo
.
name
.
c_str
());
call
->
restartMediaSender
();
...
...
src/dring/call_const.h
View file @
0f6ffcac
...
...
@@ -58,6 +58,8 @@ constexpr static char AUDIO_MUTED [] = "AUDIO_MUTED" ;
constexpr
static
char
VIDEO_MUTED
[]
=
"VIDEO_MUTED"
;
constexpr
static
char
VIDEO_SOURCE
[]
=
"VIDEO_SOURCE"
;
constexpr
static
char
AUDIO_ONLY
[]
=
"AUDIO_ONLY"
;
constexpr
static
char
AUDIO_CODEC
[]
=
"AUDIO_CODEC"
;
constexpr
static
char
VIDEO_CODEC
[]
=
"VIDEO_CODEC"
;
}
...
...
src/media/audio/audio_sender.cpp
View file @
0f6ffcac
...
...
@@ -83,7 +83,7 @@ AudioSender::setup(SocketPair& socketPair)
return
false
;
}
Smartools
::
getInstance
().
setLocalAudioCodec
(
audioEncoder_
->
get
EncoderName
());
Smartools
::
getInstance
().
setLocalAudioCodec
(
audioEncoder_
->
get
AudioCodec
());
#ifdef DEBUG_SDP
audioEncoder_
->
print_sdp
();
...
...
src/media/media_encoder.cpp
View file @
0f6ffcac
...
...
@@ -134,15 +134,6 @@ MediaEncoder::getLastSeqValue()
return
0
;
}
std
::
string
MediaEncoder
::
getEncoderName
()
const
{
if
(
videoOpts_
.
isValid
())
return
videoCodec_
;
else
return
audioCodec_
;
}
void
MediaEncoder
::
openOutput
(
const
std
::
string
&
filename
,
const
std
::
string
&
format
)
{
...
...
@@ -700,15 +691,6 @@ MediaEncoder::extractProfileLevelID(const std::string ¶meters,
JAMI_DBG
(
"Using profile %x and level %d"
,
ctx
->
profile
,
ctx
->
level
);
}
bool
MediaEncoder
::
useCodec
(
const
jami
::
AccountCodecInfo
*
codec
)
const
noexcept
{
if
(
codec
->
systemCodecInfo
.
mediaType
==
MEDIA_VIDEO
)
return
videoCodec_
==
codec
->
systemCodecInfo
.
name
;
else
return
audioCodec_
==
codec
->
systemCodecInfo
.
name
;
}
#ifdef RING_ACCEL
void
MediaEncoder
::
enableAccel
(
bool
enableAccel
)
...
...
src/media/media_encoder.h
View file @
0f6ffcac
...
...
@@ -96,9 +96,9 @@ public:
void
setInitSeqVal
(
uint16_t
seqVal
);
uint16_t
getLastSeqValue
();
std
::
string
getEncoderName
()
const
;
bool
useCodec
(
const
AccountCodecInfo
*
codec
)
const
noexcept
;
const
std
::
string
&
getAudioCodec
()
const
{
return
audioCodec_
;
}
const
std
::
string
&
getVideoCodec
()
const
{
return
videoCodec_
;
}
#ifdef RING_ACCEL
void
enableAccel
(
bool
enableAccel
);
...
...
src/media/rtp_session.h
View file @
0f6ffcac
...
...
@@ -58,6 +58,8 @@ public:
virtual
void
initRecorder
(
std
::
shared_ptr
<
MediaRecorder
>&
rec
)
=
0
;
virtual
void
deinitRecorder
(
std
::
shared_ptr
<
MediaRecorder
>&
rec
)
=
0
;
std
::
shared_ptr
<
AccountCodecInfo
>
getCodec
()
const
{
return
send_
.
codec
;
}
protected:
std
::
recursive_mutex
mutex_
;
std
::
unique_ptr
<
SocketPair
>
socketPair_
;
...
...
src/media/video/video_rtp_session.cpp
View file @
0f6ffcac
...
...
@@ -336,13 +336,6 @@ void VideoRtpSession::exitConference()
conference_
=
nullptr
;
}
bool
VideoRtpSession
::
useCodec
(
const
jami
::
AccountVideoCodecInfo
*
codec
)
const
{
return
sender_
->
useCodec
(
codec
);
}
float
VideoRtpSession
::
checkPeerPacketLoss
()
{
...
...
src/media/video/video_rtp_session.h
View file @
0f6ffcac
...
...
@@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __VIDEO_RTP_SESSION_H__
#define __VIDEO_RTP_SESSION_H__
#pragma once
#include "media/rtp_session.h"
#include "media/media_device.h"
...
...
@@ -92,9 +91,6 @@ public:
}
void
setChangeOrientationCallback
(
std
::
function
<
void
(
int
)
>
cb
);
bool
useCodec
(
const
AccountVideoCodecInfo
*
codec
)
const
;
void
initRecorder
(
std
::
shared_ptr
<
MediaRecorder
>&
rec
)
override
;
void
deinitRecorder
(
std
::
shared_ptr
<
MediaRecorder
>&
rec
)
override
;
...
...
@@ -158,5 +154,3 @@ private:
};
}}
// namespace jami::video
#endif // __VIDEO_RTP_SESSION_H__
src/media/video/video_sender.cpp
View file @
0f6ffcac
...
...
@@ -60,7 +60,7 @@ VideoSender::VideoSender(const std::string& dest, const DeviceParams& dev,
videoEncoder_
->
setIOContext
(
muxContext_
->
getContext
());
// Send local video codec in SmartInfo
Smartools
::
getInstance
().
setLocalVideoCodec
(
videoEncoder_
->
get
EncoderName
());
Smartools
::
getInstance
().
setLocalVideoCodec
(
videoEncoder_
->
get
VideoCodec
());
// Send the resolution in smartInfo
Smartools
::
getInstance
().
setResolution
(
"local"
,
dev
.
width
,
dev
.
height
);
...
...
@@ -135,12 +135,6 @@ VideoSender::getLastSeqValue()
return
videoEncoder_
->
getLastSeqValue
();
}
bool
VideoSender
::
useCodec
(
const
jami
::
AccountVideoCodecInfo
*
codec
)
const
{
return
videoEncoder_
->
useCodec
(
codec
);
}
void
VideoSender
::
setChangeOrientationCallback
(
std
::
function
<
void
(
int
)
>
cb
)
{
...
...
src/media/video/video_sender.h
View file @
0f6ffcac
...
...
@@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __VIDEO_SENDER_H__
#define __VIDEO_SENDER_H__
#pragma once
#include "noncopyable.h"
#include "media_encoder.h"
...
...
@@ -60,8 +59,6 @@ public:
uint16_t
getLastSeqValue
();
bool
useCodec
(
const
AccountVideoCodecInfo
*
codec
)
const
;
void
setChangeOrientationCallback
(
std
::
function
<
void
(
int
)
>
cb
);
private:
...
...
@@ -85,5 +82,3 @@ private:
std
::
function
<
void
(
int
)
>
changeOrientationCallback_
;
};
}}
// namespace jami::video
#endif // __VIDEO_SENDER_H__
src/sip/sipcall.cpp
View file @
0f6ffcac
...
...
@@ -873,14 +873,19 @@ SIPCall::getAllRemoteCandidates()
return
rem_candidates
;
}
bool
SIPCall
::
useVideoCodec
(
const
AccountVideoCodecInfo
*
codec
)
const
std
::
shared_ptr
<
AccountCodecInfo
>
SIPCall
::
getVideoCodec
(
)
const
{
#ifdef ENABLE_VIDEO
if
(
videortp_
->
isSending
())
return
videortp_
->
useCodec
(
codec
);
return
videortp_
->
getCodec
();
#endif
return
false
;
return
{};
}
std
::
shared_ptr
<
AccountCodecInfo
>
SIPCall
::
getAudioCodec
()
const
{
return
avformatrtp_
->
getCodec
();
}
void
...
...
@@ -1210,6 +1215,8 @@ SIPCall::getDetails() const
#ifdef ENABLE_VIDEO
// If Video is not enabled return an empty string
details
.
emplace
(
DRing
::
Call
::
Details
::
VIDEO_SOURCE
,
acc
.
isVideoEnabled
()
?
mediaInput_
:
""
);
if
(
auto
codec
=
videortp_
->
getCodec
())
details
.
emplace
(
DRing
::
Call
::
Details
::
VIDEO_CODEC
,
codec
->
systemCodecInfo
.
name
);
#endif
#if HAVE_RINGNS
...
...
src/sip/sipcall.h
View file @
0f6ffcac
...
...
@@ -109,7 +109,9 @@ public: // overridden
void
removeCall
()
override
;
void
muteMedia
(
const
std
::
string
&
mediaType
,
bool
isMuted
)
override
;
void
restartMediaSender
()
override
;
bool
useVideoCodec
(
const
AccountVideoCodecInfo
*
codec
)
const
override
;
std
::
shared_ptr
<
AccountCodecInfo
>
getAudioCodec
()
const
override
;
std
::
shared_ptr
<
AccountCodecInfo
>
getVideoCodec
()
const
override
;
void
sendKeyframe
()
override
;
std
::
map
<
std
::
string
,
std
::
string
>
getDetails
()
const
override
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment