Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
36c6d857
Commit
36c6d857
authored
Apr 23, 2018
by
Philippe Gorley
Committed by
Sébastien Blin
Apr 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
media: fix compilation warnings
Change-Id: I86d2bfcf88a2a2b0eac50e4bb2b1c74359f84f76
parent
59d6bf50
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
8 deletions
+23
-8
src/media/audio/audio_rtp_session.cpp
src/media/audio/audio_rtp_session.cpp
+1
-1
src/media/libav_utils.cpp
src/media/libav_utils.cpp
+6
-0
src/media/media_encoder.cpp
src/media/media_encoder.cpp
+14
-5
src/media/media_encoder.h
src/media/media_encoder.h
+1
-1
src/media/video/video_sender.cpp
src/media/video/video_sender.cpp
+1
-1
No files found.
src/media/audio/audio_rtp_session.cpp
View file @
36c6d857
...
...
@@ -120,7 +120,7 @@ AudioSender::setup(SocketPair& socketPair)
/* Encoder setup */
RING_DBG
(
"audioEncoder_->openOutput %s"
,
dest_
.
c_str
());
audioEncoder_
->
setMuted
(
muteState_
);
audioEncoder_
->
openOutput
(
dest_
.
c_str
()
,
args_
);
audioEncoder_
->
openOutput
(
dest_
,
args_
);
audioEncoder_
->
setInitSeqVal
(
seqVal_
);
audioEncoder_
->
setIOContext
(
muxContext_
);
audioEncoder_
->
startIO
();
...
...
src/media/libav_utils.cpp
View file @
36c6d857
...
...
@@ -37,6 +37,7 @@
namespace
ring
{
namespace
libav_utils
{
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
// protect libav/ffmpeg access
static
int
avcodecManageMutex
(
void
**
data
,
enum
AVLockOp
op
)
...
...
@@ -70,6 +71,7 @@ avcodecManageMutex(void **data, enum AVLockOp op)
}
return
AVERROR
(
ret
);
}
#endif
static
constexpr
const
char
*
AVLOGLEVEL
=
"AVLOGLEVEL"
;
...
...
@@ -134,11 +136,15 @@ androidAvLogCb(void* ptr, int level, const char* fmt, va_list vl)
static
void
init_once
()
{
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_register_all
();
#endif
avdevice_register_all
();
avformat_network_init
();
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_lockmgr_register
(
avcodecManageMutex
);
#endif
if
(
getDebugMode
())
setAvLogLevel
();
...
...
src/media/media_encoder.cpp
View file @
36c6d857
...
...
@@ -123,21 +123,26 @@ MediaEncoder::getEncoderName() const
}
void
MediaEncoder
::
openOutput
(
const
char
*
filename
,
MediaEncoder
::
openOutput
(
const
std
::
string
&
filename
,
const
ring
::
MediaDescription
&
args
)
{
setOptions
(
args
);
AVOutputFormat
*
oformat
=
av_guess_format
(
"rtp"
,
filename
,
nullptr
);
AVOutputFormat
*
oformat
=
av_guess_format
(
"rtp"
,
filename
.
c_str
()
,
nullptr
);
if
(
!
oformat
)
{
RING_ERR
(
"Unable to find a suitable output format for %s"
,
filename
);
RING_ERR
(
"Unable to find a suitable output format for %s"
,
filename
.
c_str
()
);
throw
MediaEncoderException
(
"No output format"
);
}
outputCtx_
->
oformat
=
oformat
;
strncpy
(
outputCtx_
->
filename
,
filename
,
sizeof
(
outputCtx_
->
filename
));
// guarantee that buffer is NULL terminated
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100)
// c_str guarantees NULL termination
outputCtx_
->
url
=
av_strdup
(
filename
.
c_str
());
// must be compatible with av_free
#else
strncpy
(
outputCtx_
->
filename
,
filename
.
c_str
(),
sizeof
(
outputCtx_
->
filename
));
// in case our filename is longer than the space reserved for AVFormatContext.filename
outputCtx_
->
filename
[
sizeof
(
outputCtx_
->
filename
)
-
1
]
=
'\0'
;
#endif
/* find the video encoder */
if
(
args
.
codec
->
systemCodecInfo
.
avcodecId
==
AV_CODEC_ID_H263
)
...
...
@@ -265,7 +270,11 @@ MediaEncoder::startIO()
throw
MediaEncoderException
(
"Failed to write output file header"
);
}
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100)
av_dump_format
(
outputCtx_
,
0
,
outputCtx_
->
url
,
1
);
#else
av_dump_format
(
outputCtx_
,
0
,
outputCtx_
->
filename
,
1
);
#endif
}
#ifdef RING_VIDEO
...
...
src/media/media_encoder.h
View file @
36c6d857
...
...
@@ -63,7 +63,7 @@ public:
void
setInterruptCallback
(
int
(
*
cb
)(
void
*
),
void
*
opaque
);
void
setDeviceOptions
(
const
DeviceParams
&
args
);
void
openOutput
(
const
char
*
filename
,
const
MediaDescription
&
args
);
void
openOutput
(
const
std
::
string
&
filename
,
const
MediaDescription
&
args
);
void
startIO
();
void
setIOContext
(
const
std
::
unique_ptr
<
MediaIOHandle
>
&
ioctx
);
...
...
src/media/video/video_sender.cpp
View file @
36c6d857
...
...
@@ -44,7 +44,7 @@ VideoSender::VideoSender(const std::string& dest, const DeviceParams& dev,
{
videoEncoder_
->
setDeviceOptions
(
dev
);
keyFrameFreq_
=
dev
.
framerate
.
numerator
()
*
KEY_FRAME_PERIOD
;
videoEncoder_
->
openOutput
(
dest
.
c_str
()
,
args
);
videoEncoder_
->
openOutput
(
dest
,
args
);
videoEncoder_
->
setInitSeqVal
(
seqVal
);
videoEncoder_
->
setIOContext
(
muxContext_
);
videoEncoder_
->
startIO
();
...
...
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