Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
f462eeba
Commit
f462eeba
authored
10 years ago
by
Guillaume Roguez
Browse files
Options
Downloads
Patches
Plain Diff
video: missing fixes to renderer
Refs #70057
parent
435cf9e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/private/shmrenderer.cpp
+31
-31
31 additions, 31 deletions
src/private/shmrenderer.cpp
with
31 additions
and
31 deletions
src/private/shmrenderer.cpp
+
31
−
31
View file @
f462eeba
...
...
@@ -138,44 +138,44 @@ Video::ShmRenderer::~ShmRenderer()
bool
Video
::
ShmRendererPrivate
::
renderToBitmap
()
{
QMutexLocker
locker
{
q_ptr
->
mutex
()};
QMutexLocker
locker
{
q_ptr
->
mutex
()};
#ifdef Q_OS_LINUX
auto
&
renderer
=
static_cast
<
Video
::
Renderer
*>
(
q_ptr
)
->
d_ptr
;
auto
&
frame
=
renderer
->
otherFrame
();
if
(
frame
.
isEmpty
())
return
false
;
if
(
!
q_ptr
->
isRendering
())
return
false
;
if
(
!
shmLock
())
return
false
;
if
(
!
shmLock
())
return
false
;
if
(
m_BufferGen
==
m_pShmArea
->
frameGen
)
{
shmUnlock
();
if
(
m_BufferGen
==
m_pShmArea
->
frameGen
)
{
shmUnlock
();
// wait for a new frame, max 33ms
static
const
struct
timespec
timeout
=
{
0
,
33000000
};
if
(
::
sem_timedwait
(
&
m_pShmArea
->
frameGenMutex
,
&
timeout
)
<
0
)
return
false
;
// wait for a new frame, max 33ms
static
const
struct
timespec
timeout
=
{
0
,
33000000
};
if
(
::
sem_timedwait
(
&
m_pShmArea
->
frameGenMutex
,
&
timeout
)
<
0
)
return
false
;
if
(
!
shmLock
())
return
false
;
}
if
(
!
shmLock
())
return
false
;
}
// valid frame to render?
if
(
not
m_pShmArea
->
frameSize
)
return
false
;
// valid frame to render?
if
(
not
m_pShmArea
->
frameSize
)
return
false
;
if
(
!
resizeShm
())
{
qDebug
()
<<
"Could not resize shared memory"
;
return
false
;
}
if
(
!
resizeShm
())
{
qDebug
()
<<
"Could not resize shared memory"
;
return
false
;
}
if
((
unsigned
)
frame
.
size
()
!=
m_pShmArea
->
frameSize
)
frame
.
resize
(
m_pShmArea
->
frameSize
);
std
::
copy_n
(
m_pShmArea
->
data
+
m_pShmArea
->
readOffset
,
m_pShmArea
->
frameSize
,
frame
.
data
());
m_BufferGen
=
m_pShmArea
->
frameGen
;
renderer
->
updateFrameIndex
();
shmUnlock
();
auto
&
renderer
=
static_cast
<
Video
::
Renderer
*>
(
q_ptr
)
->
d_ptr
;
auto
&
frame
=
renderer
->
otherFrame
();
if
((
unsigned
)
frame
.
size
()
!=
m_pShmArea
->
frameSize
)
frame
.
resize
(
m_pShmArea
->
frameSize
);
std
::
copy_n
(
m_pShmArea
->
data
+
m_pShmArea
->
readOffset
,
m_pShmArea
->
frameSize
,
frame
.
data
());
m_BufferGen
=
m_pShmArea
->
frameGen
;
renderer
->
updateFrameIndex
();
shmUnlock
();
#ifdef DEBUG_FPS
auto
currentTime
=
std
::
chrono
::
system_clock
::
now
();
...
...
@@ -188,9 +188,9 @@ Video::ShmRendererPrivate::renderToBitmap()
}
#endif
return
true
;
return
true
;
#else
return
false
;
return
false
;
#endif
}
...
...
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