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
13b55fc8
Commit
13b55fc8
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
MediaRecorder: avoid unneeded processing when disabled
Change-Id: I73b549126ce325b8643a1194da7cafadf25a0c9b
parent
62cdae01
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/media/media_recorder.cpp
+16
-0
16 additions, 0 deletions
src/media/media_recorder.cpp
with
16 additions
and
0 deletions
src/media/media_recorder.cpp
+
16
−
0
View file @
13b55fc8
...
...
@@ -84,6 +84,8 @@ struct MediaRecorder::StreamObserver : public Observer<std::shared_ptr<MediaFram
void
update
(
Observable
<
std
::
shared_ptr
<
MediaFrame
>>*
/*ob*/
,
const
std
::
shared_ptr
<
MediaFrame
>&
m
)
override
{
if
(
not
isEnabled
)
return
;
#ifdef ENABLE_VIDEO
if
(
info
.
isVideo
)
{
std
::
shared_ptr
<
VideoFrame
>
framePtr
;
...
...
@@ -139,6 +141,7 @@ struct MediaRecorder::StreamObserver : public Observer<std::shared_ptr<MediaFram
observablesFrames_
.
erase
(
it
);
}
bool
isEnabled
=
false
;
private
:
std
::
function
<
void
(
const
std
::
shared_ptr
<
MediaFrame
>&
)
>
cb_
;
std
::
unique_ptr
<
MediaFilter
>
videoRotationFilter_
{};
...
...
@@ -201,6 +204,12 @@ MediaRecorder::startRecording()
JAMI_DBG
()
<<
"Start recording '"
<<
getPath
()
<<
"'"
;
if
(
initRecord
()
>=
0
)
{
isRecording_
=
true
;
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
mutexStreamSetup_
);
for
(
auto
&
media
:
streams_
)
{
media
.
second
->
isEnabled
=
true
;
}
}
// start thread after isRecording_ is set to true
dht
::
ThreadPool
::
computation
().
run
([
rec
=
shared_from_this
()]
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
rec
->
encoderMtx_
);
...
...
@@ -249,6 +258,12 @@ MediaRecorder::stopRecording()
if
(
isRecording_
)
{
JAMI_DBG
()
<<
"Stop recording '"
<<
getPath
()
<<
"'"
;
isRecording_
=
false
;
{
std
::
lock_guard
<
std
::
mutex
>
lk
(
mutexStreamSetup_
);
for
(
auto
&
media
:
streams_
)
{
media
.
second
->
isEnabled
=
false
;
}
}
emitSignal
<
libjami
::
CallSignal
::
RecordPlaybackStopped
>
(
getPath
());
}
}
...
...
@@ -287,6 +302,7 @@ MediaRecorder::addStream(const MediaStream& ms)
});
}
}
it
->
second
->
isEnabled
=
isRecording_
;
if
(
ms
.
isVideo
)
setupVideoOutput
();
...
...
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