Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
7339c2bd
Commit
7339c2bd
authored
Jul 22, 2019
by
Philippe Gorley
Committed by
Adrien Béraud
Jul 22, 2019
Browse files
media: fix build warnings
Change-Id: I3b377854857eee866929d3c4228c21a3c81461cf
parent
780a9d57
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/media/audio/pulseaudio/audiostream.cpp
View file @
7339c2bd
...
...
@@ -36,7 +36,7 @@ AudioStream::AudioStream(pa_context *c,
const
PaDeviceInfos
*
infos
,
bool
ec
,
OnReady
onReady
)
:
audiostream_
(
0
),
mainloop_
(
m
),
onReady_
(
std
::
move
(
onReady
)
)
:
onReady_
(
std
::
move
(
onReady
)),
audiostream_
(
0
),
mainloop_
(
m
)
{
const
pa_channel_map
channel_map
=
infos
->
channel_map
;
...
...
src/media/libav_utils.cpp
View file @
7339c2bd
...
...
@@ -48,6 +48,7 @@ av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, A
side_data
->
buf
=
buf
;
side_data
->
data
=
side_data
->
buf
->
data
;
side_data
->
size
=
side_data
->
buf
->
size
;
return
side_data
;
}
#endif
}
...
...
src/media/media_encoder.cpp
View file @
7339c2bd
...
...
@@ -247,7 +247,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
// Streaming => VBV (constrained encoding) + CRF (Constant Rate Factor)
if
(
crf
==
SystemCodecInfo
::
DEFAULT_NO_QUALITY
)
crf
=
30
;
// good value for H264-720p@30
JAMI_DBG
(
"H264 encoder setup: crf=%u, maxrate=%u, bufsize=%u"
,
crf
,
maxBitrate
,
bufSize
);
JAMI_DBG
(
"H264 encoder setup: crf=%u, maxrate=%
l
u, bufsize=%
l
u"
,
crf
,
maxBitrate
,
bufSize
);
libav_utils
::
setDictValue
(
&
options_
,
"crf"
,
std
::
to_string
(
crf
));
av_opt_set_int
(
encoderCtx
,
"crf"
,
crf
,
AV_OPT_SEARCH_CHILDREN
);
encoderCtx
->
rc_buffer_size
=
bufSize
;
...
...
@@ -277,7 +277,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
av_opt_set_int
(
encoderCtx
,
"crf"
,
crf
,
AV_OPT_SEARCH_CHILDREN
);
JAMI_DBG
(
"Using quality factor %d"
,
crf
);
}
else
{
JAMI_DBG
(
"Using Max bitrate %
d
"
,
maxBitrate
);
JAMI_DBG
(
"Using Max bitrate %
lu
"
,
maxBitrate
);
}
}
else
if
(
systemCodecInfo
.
avcodecId
==
AV_CODEC_ID_MPEG4
)
{
// For MPEG4 :
...
...
@@ -285,11 +285,11 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
// Use CBR (set bitrate)
encoderCtx
->
rc_buffer_size
=
maxBitrate
;
encoderCtx
->
bit_rate
=
encoderCtx
->
rc_min_rate
=
encoderCtx
->
rc_max_rate
=
maxBitrate
;
JAMI_DBG
(
"Using Max bitrate %
d
"
,
maxBitrate
);
JAMI_DBG
(
"Using Max bitrate %
lu
"
,
maxBitrate
);
}
else
if
(
systemCodecInfo
.
avcodecId
==
AV_CODEC_ID_H263
)
{
encoderCtx
->
bit_rate
=
encoderCtx
->
rc_max_rate
=
maxBitrate
;
encoderCtx
->
rc_buffer_size
=
maxBitrate
;
JAMI_DBG
(
"Using Max bitrate %
d
"
,
maxBitrate
);
JAMI_DBG
(
"Using Max bitrate %
lu
"
,
maxBitrate
);
}
// add video stream to outputformat context
...
...
@@ -522,7 +522,7 @@ MediaEncoder::send(AVPacket& pkt, int streamIdx)
}
if
(
streamIdx
<
0
)
streamIdx
=
currentStreamIdx_
;
if
(
streamIdx
>=
0
and
streamIdx
<
encoders_
.
size
())
{
if
(
streamIdx
>=
0
and
static_cast
<
size_t
>
(
streamIdx
)
<
encoders_
.
size
())
{
auto
encoderCtx
=
encoders_
[
streamIdx
];
pkt
.
stream_index
=
streamIdx
;
if
(
pkt
.
pts
!=
AV_NOPTS_VALUE
)
...
...
Write
Preview
Supports
Markdown
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