Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
077791ba
Commit
077791ba
authored
Oct 18, 2019
by
Andreas Traczyk
Committed by
Ming Rui Zhang
Oct 18, 2019
Browse files
Options
Downloads
Patches
Plain Diff
video: allow force reconnection to frame update/stop signals
Change-Id: Ic792b5e159cc1aba72b1a84b580b35c8ec4e006f
parent
5617b29b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
rendermanager.cpp
+27
-20
27 additions, 20 deletions
rendermanager.cpp
rendermanager.h
+8
-1
8 additions, 1 deletion
rendermanager.h
with
35 additions
and
21 deletions
rendermanager.cpp
+
27
−
20
View file @
077791ba
...
@@ -38,7 +38,7 @@ FrameWrapper::~FrameWrapper()
...
@@ -38,7 +38,7 @@ FrameWrapper::~FrameWrapper()
}
}
void
void
FrameWrapper
::
connectRendering
()
FrameWrapper
::
connect
Start
Rendering
()
{
{
QObject
::
disconnect
(
renderConnections_
.
started
);
QObject
::
disconnect
(
renderConnections_
.
started
);
renderConnections_
.
started
=
QObject
::
connect
(
renderConnections_
.
started
=
QObject
::
connect
(
...
@@ -48,6 +48,27 @@ FrameWrapper::connectRendering()
...
@@ -48,6 +48,27 @@ FrameWrapper::connectRendering()
&
FrameWrapper
::
slotRenderingStarted
);
&
FrameWrapper
::
slotRenderingStarted
);
}
}
void
FrameWrapper
::
startRendering
()
{
renderer_
=
const_cast
<
video
::
Renderer
*>
(
&
avModel_
.
getRenderer
(
id_
));
QObject
::
disconnect
(
renderConnections_
.
updated
);
QObject
::
disconnect
(
renderConnections_
.
stopped
);
renderConnections_
.
updated
=
QObject
::
connect
(
&
avModel_
,
&
AVModel
::
frameUpdated
,
this
,
&
FrameWrapper
::
slotFrameUpdated
);
renderConnections_
.
stopped
=
QObject
::
connect
(
&
avModel_
,
&
AVModel
::
rendererStopped
,
this
,
&
FrameWrapper
::
slotRenderingStopped
);
}
QImage
*
QImage
*
FrameWrapper
::
getFrame
()
FrameWrapper
::
getFrame
()
{
{
...
@@ -67,22 +88,7 @@ FrameWrapper::slotRenderingStarted(const std::string& id)
...
@@ -67,22 +88,7 @@ FrameWrapper::slotRenderingStarted(const std::string& id)
return
;
return
;
}
}
QObject
::
disconnect
(
renderConnections_
.
updated
);
startRendering
();
QObject
::
disconnect
(
renderConnections_
.
stopped
);
renderer_
=
const_cast
<
video
::
Renderer
*>
(
&
avModel_
.
getRenderer
(
id_
));
renderConnections_
.
updated
=
QObject
::
connect
(
&
avModel_
,
&
AVModel
::
frameUpdated
,
this
,
&
FrameWrapper
::
slotFrameUpdated
);
renderConnections_
.
stopped
=
QObject
::
connect
(
&
avModel_
,
&
AVModel
::
rendererStopped
,
this
,
&
FrameWrapper
::
slotRenderingStopped
);
isRendering_
=
true
;
isRendering_
=
true
;
...
@@ -123,6 +129,7 @@ FrameWrapper::slotFrameUpdated(const std::string& id)
...
@@ -123,6 +129,7 @@ FrameWrapper::slotFrameUpdated(const std::string& id)
);
);
}
}
}
}
emit
frameUpdated
(
id
);
emit
frameUpdated
(
id
);
}
}
...
@@ -177,7 +184,7 @@ RenderManager::RenderManager(AVModel& avModel)
...
@@ -177,7 +184,7 @@ RenderManager::RenderManager(AVModel& avModel)
emit
previewRenderingStopped
();
emit
previewRenderingStopped
();
});
});
previewFrameWrapper_
->
connectRendering
();
previewFrameWrapper_
->
connect
Start
Rendering
();
}
}
RenderManager
::~
RenderManager
()
RenderManager
::~
RenderManager
()
...
@@ -243,7 +250,7 @@ RenderManager::addDistantRenderer(const std::string& id)
...
@@ -243,7 +250,7 @@ RenderManager::addDistantRenderer(const std::string& id)
// check if a FrameWrapper with this id exists
// check if a FrameWrapper with this id exists
auto
dfwIt
=
distantFrameWrapperMap_
.
find
(
id
);
auto
dfwIt
=
distantFrameWrapperMap_
.
find
(
id
);
if
(
dfwIt
!=
distantFrameWrapperMap_
.
end
())
{
if
(
dfwIt
!=
distantFrameWrapperMap_
.
end
())
{
dfwIt
->
second
->
connec
tRendering
();
dfwIt
->
second
->
star
tRendering
();
}
else
{
}
else
{
auto
dfw
=
std
::
make_unique
<
FrameWrapper
>
(
avModel_
,
id
);
auto
dfw
=
std
::
make_unique
<
FrameWrapper
>
(
avModel_
,
id
);
...
@@ -265,7 +272,7 @@ RenderManager::addDistantRenderer(const std::string& id)
...
@@ -265,7 +272,7 @@ RenderManager::addDistantRenderer(const std::string& id)
});
});
// connect FrameWrapper to avmodel
// connect FrameWrapper to avmodel
dfw
->
connectRendering
();
dfw
->
connect
Start
Rendering
();
// add to map
// add to map
distantFrameWrapperMap_
.
insert
(
std
::
make_pair
(
id
,
std
::
move
(
dfw
)));
distantFrameWrapperMap_
.
insert
(
std
::
make_pair
(
id
,
std
::
move
(
dfw
)));
...
...
This diff is collapsed.
Click to expand it.
rendermanager.h
+
8
−
1
View file @
077791ba
...
@@ -51,7 +51,14 @@ public:
...
@@ -51,7 +51,14 @@ public:
/**
/**
* Reconnect the started rendering connection for this object.
* Reconnect the started rendering connection for this object.
*/
*/
void
connectRendering
();
void
connectStartRendering
();
/**
* Get a pointer to the renderer and reconnect the update/stopped
* rendering connections for this object.
*/
void
startRendering
();
/**
/**
* Get the most recently rendered frame as a QImage.
* Get the most recently rendered frame as a QImage.
* @return the rendered image of this object's id
* @return the rendered image of this object's id
...
...
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