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
a4ce78b7
Commit
a4ce78b7
authored
6 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
rtp session: write to ringbuffer directly
Change-Id: I0de9d73d38e865f736e64c6a1adb1139d96cd641
parent
ef9d7bf2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/media/audio/audio_receive_thread.cpp
+3
-6
3 additions, 6 deletions
src/media/audio/audio_receive_thread.cpp
src/media/media_decoder.cpp
+0
-15
0 additions, 15 deletions
src/media/media_decoder.cpp
src/media/media_decoder.h
+0
-6
0 additions, 6 deletions
src/media/media_decoder.h
with
3 additions
and
27 deletions
src/media/audio/audio_receive_thread.cpp
+
3
−
6
View file @
a4ce78b7
...
@@ -92,14 +92,11 @@ AudioReceiveThread::setup()
...
@@ -92,14 +92,11 @@ AudioReceiveThread::setup()
void
void
AudioReceiveThread
::
process
()
AudioReceiveThread
::
process
()
{
{
AudioFormat
mainBuffFormat
=
Manager
::
instance
().
getRingBufferPool
().
getInternalAudioFormat
();
auto
decodedFrame
=
std
::
make_shared
<
AudioFrame
>
();
auto
decodedFrame
=
std
::
make_unique
<
AudioFrame
>
();
auto
sharedFrame
=
std
::
make_shared
<
AudioFrame
>
();
switch
(
audioDecoder_
->
decode
(
*
decodedFrame
))
{
switch
(
audioDecoder_
->
decode
(
*
decodedFrame
))
{
case
MediaDecoder
::
Status
::
FrameFinished
:
case
MediaDecoder
::
Status
::
FrameFinished
:
sharedFrame
->
copyFrom
(
*
decodedFrame
);
notify
(
std
::
static_pointer_cast
<
MediaFrame
>
(
decodedFrame
));
audioDecoder_
->
writeToRingBuffer
(
std
::
move
(
decodedFrame
),
*
ringbuffer_
,
mainBuffFormat
);
ringbuffer_
->
put
(
std
::
move
(
decodedFrame
));
notify
(
std
::
static_pointer_cast
<
MediaFrame
>
(
sharedFrame
));
return
;
return
;
case
MediaDecoder
::
Status
::
DecodeError
:
case
MediaDecoder
::
Status
::
DecodeError
:
RING_WARN
(
"decoding failure, trying to reset decoder..."
);
RING_WARN
(
"decoding failure, trying to reset decoder..."
);
...
...
This diff is collapsed.
Click to expand it.
src/media/media_decoder.cpp
+
0
−
15
View file @
a4ce78b7
...
@@ -466,21 +466,6 @@ MediaDecoder::getTimeBase() const
...
@@ -466,21 +466,6 @@ MediaDecoder::getTimeBase() const
int
MediaDecoder
::
getPixelFormat
()
const
int
MediaDecoder
::
getPixelFormat
()
const
{
return
decoderCtx_
->
pix_fmt
;
}
{
return
decoderCtx_
->
pix_fmt
;
}
void
MediaDecoder
::
writeToRingBuffer
(
std
::
unique_ptr
<
AudioFrame
>&&
decodedFrame
,
RingBuffer
&
rb
,
const
AudioFormat
outFormat
)
{
AudioFormat
format
(
decoderCtx_
->
sample_rate
,
decoderCtx_
->
channels
,
decoderCtx_
->
sample_fmt
);
if
(
format
!=
outFormat
)
{
if
(
not
resampler_
)
{
RING_DBG
(
"Creating audio resampler"
);
resampler_
.
reset
(
new
Resampler
);
}
decodedFrame
=
resampler_
->
resample
(
std
::
move
(
decodedFrame
),
outFormat
);
}
rb
.
put
(
std
::
move
(
decodedFrame
));
}
int
int
MediaDecoder
::
correctPixFmt
(
int
input_pix_fmt
)
{
MediaDecoder
::
correctPixFmt
(
int
input_pix_fmt
)
{
...
...
This diff is collapsed.
Click to expand it.
src/media/media_decoder.h
+
0
−
6
View file @
a4ce78b7
...
@@ -90,7 +90,6 @@ class MediaDecoder {
...
@@ -90,7 +90,6 @@ class MediaDecoder {
int
setupFromAudioData
();
int
setupFromAudioData
();
Status
decode
(
AudioFrame
&
);
Status
decode
(
AudioFrame
&
);
void
writeToRingBuffer
(
std
::
unique_ptr
<
AudioFrame
>&&
decodedFrame
,
RingBuffer
&
,
const
AudioFormat
);
int
getWidth
()
const
;
int
getWidth
()
const
;
int
getHeight
()
const
;
int
getHeight
()
const
;
...
@@ -115,7 +114,6 @@ class MediaDecoder {
...
@@ -115,7 +114,6 @@ class MediaDecoder {
AVCodecContext
*
decoderCtx_
=
nullptr
;
AVCodecContext
*
decoderCtx_
=
nullptr
;
AVFormatContext
*
inputCtx_
=
nullptr
;
AVFormatContext
*
inputCtx_
=
nullptr
;
AVStream
*
avStream_
=
nullptr
;
AVStream
*
avStream_
=
nullptr
;
std
::
unique_ptr
<
Resampler
>
resampler_
;
int
streamIndex_
=
-
1
;
int
streamIndex_
=
-
1
;
bool
emulateRate_
=
false
;
bool
emulateRate_
=
false
;
int64_t
startTime_
;
int64_t
startTime_
;
...
@@ -123,10 +121,6 @@ class MediaDecoder {
...
@@ -123,10 +121,6 @@ class MediaDecoder {
DeviceParams
inputParams_
;
DeviceParams
inputParams_
;
AudioBuffer
decBuff_
;
AudioBuffer
resamplingBuff_
;
void
extract
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
map
,
const
std
::
string
&
key
);
int
correctPixFmt
(
int
input_pix_fmt
);
int
correctPixFmt
(
int
input_pix_fmt
);
int
setupStream
(
AVMediaType
mediaType
);
int
setupStream
(
AVMediaType
mediaType
);
int
selectStream
(
AVMediaType
type
);
int
selectStream
(
AVMediaType
type
);
...
...
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