Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
luyikei
VLMC
Commits
c20c851f
Commit
c20c851f
authored
Jun 02, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some attemps to resolve a graphic bug when changing position
parent
bc134e98
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
+33
-16
src/LibVLCpp/VLCMediaPlayer.cpp
src/LibVLCpp/VLCMediaPlayer.cpp
+1
-0
src/Workflow/ClipWorkflow.cpp
src/Workflow/ClipWorkflow.cpp
+23
-12
src/Workflow/TrackWorkflow.cpp
src/Workflow/TrackWorkflow.cpp
+9
-4
No files found.
src/LibVLCpp/VLCMediaPlayer.cpp
View file @
c20c851f
...
...
@@ -90,6 +90,7 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev
self
->
emit
timeChanged
();
break
;
case
libvlc_MediaPlayerPositionChanged
:
// qDebug() << "Position changed" << event->u.media_player_position_changed.new_position;
self
->
emit
positionChanged
();
break
;
//TODO: activate this when switching to VLC 1.1
...
...
src/Workflow/ClipWorkflow.cpp
View file @
c20c851f
...
...
@@ -56,9 +56,14 @@ ClipWorkflow::~ClipWorkflow()
unsigned
char
*
ClipWorkflow
::
getOutput
()
{
// qDebug() << "Getting output";
QReadLocker
lock
(
m_backBufferLock
);
if
(
m_usingBackBuffer
==
true
)
{
// qDebug() << "Returning frontbuffer";
return
m_buffer
;
}
// qDebug() << "Returning backbuffer";
return
m_backBuffer
;
}
...
...
@@ -68,25 +73,31 @@ void ClipWorkflow::checkStateChange()
QWriteLocker
lock2
(
m_stateLock
);
if
(
m_requiredState
!=
ClipWorkflow
::
None
)
{
qDebug
()
<<
"Setting required state : "
<<
m_requiredState
;
m_state
=
m_requiredState
;
m_requiredState
=
ClipWorkflow
::
None
;
}
}
void
ClipWorkflow
::
lock
(
ClipWorkflow
*
c
lipWorkflo
w
,
void
**
pp_ret
)
void
ClipWorkflow
::
lock
(
ClipWorkflow
*
cw
,
void
**
pp_ret
)
{
// qDebug() << "Locking in ClipWorkflow::lock";
QReadLocker
lock
(
clipWorkflo
w
->
m_backBufferLock
);
QReadLocker
lock
(
c
w
->
m_backBufferLock
);
if
(
clipWorkflow
->
m_usingBackBuffer
)
*
pp_ret
=
clipWorkflow
->
m_backBuffer
;
if
(
cw
->
m_usingBackBuffer
)
{
// qDebug() << "Using backbuffer";
*
pp_ret
=
cw
->
m_backBuffer
;
}
else
*
pp_ret
=
clipWorkflow
->
m_buffer
;
{
// qDebug() << "Using frontbuffer";
*
pp_ret
=
cw
->
m_buffer
;
}
}
void
ClipWorkflow
::
unlock
(
ClipWorkflow
*
cw
)
{
// qDebug() << "UnLocking in ClipWorkflow::unlock";
cw
->
m_stateLock
->
lockForWrite
();
if
(
cw
->
m_state
==
Rendering
)
...
...
@@ -94,21 +105,21 @@ void ClipWorkflow::unlock( ClipWorkflow* cw )
cw
->
m_state
=
Sleeping
;
cw
->
m_stateLock
->
unlock
();
// qDebug() << "Sleeping....";
QMutexLocker
lock
(
cw
->
m_condMutex
);
cw
->
m_waitCond
->
wait
(
cw
->
m_condMutex
);
cw
->
m_stateLock
->
lockForWrite
();
cw
->
m_state
=
Rendering
;
// qDebug() << "Waiking";
{
QWriteLocker
lock2
(
cw
->
m_backBufferLock
);
cw
->
m_usingBackBuffer
=
!
cw
->
m_usingBackBuffer
;
}
cw
->
m_stateLock
->
lockForWrite
();
cw
->
m_state
=
Rendering
;
}
else
qDebug
()
<<
cw
->
m_state
;
cw
->
m_stateLock
->
unlock
();
cw
->
checkStateChange
();
// qDebug() << "UnLocking in ClipWorkflow::unlock";
}
void
ClipWorkflow
::
setVmem
()
...
...
src/Workflow/TrackWorkflow.cpp
View file @
c20c851f
...
...
@@ -87,12 +87,16 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi
if
(
cw
->
getState
()
==
ClipWorkflow
::
Sleeping
)
{
cw
->
getStateLock
()
->
unlock
();
ret
=
cw
->
getOutput
();
if
(
needRepositioning
==
true
)
{
cw
->
setPosition
(
pos
);
}
ret
=
cw
->
getOutput
();
// qDebug() << "Waking renderer";
cw
->
wake
();
// qDebug() << "Awaken renderer";
//FIXME: sometimes, the renderer isn't awake soon enough, and we can
//pass though this function many times before the frame is actually rendered.
}
else
if
(
cw
->
getState
()
==
ClipWorkflow
::
Stopped
)
{
...
...
@@ -110,7 +114,7 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, bool needReposi
}
else
{
qDebug
()
<<
"Unexpected ClipWorkflow::State when rendering:"
<<
cw
->
getState
();
//
qDebug() << "Unexpected ClipWorkflow::State when rendering:" << cw->getState();
cw
->
getStateLock
()
->
unlock
();
}
return
ret
;
...
...
@@ -165,7 +169,7 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
}
else
{
qDebug
()
<<
"Unexpected ClipWorkflow::State when stopping :"
<<
cw
->
getState
();
//
qDebug() << "Unexpected ClipWorkflow::State when stopping :" << cw->getState();
cw
->
getStateLock
()
->
unlock
();
}
}
...
...
@@ -178,7 +182,7 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
static
qint64
lastFrame
=
0
;
bool
needRepositioning
;
needRepositioning
=
(
abs
(
currentFrame
-
lastFrame
)
>
3
)
?
true
:
false
;
needRepositioning
=
(
abs
(
currentFrame
-
lastFrame
)
>
1
)
?
true
:
false
;
while
(
it
!=
end
)
{
qint64
start
=
it
.
key
();
...
...
@@ -189,6 +193,7 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
{
if
(
needRepositioning
==
true
)
{
// qDebug() << "Repositionning to" << currentFrame << '(' << (float)( currentFrame - start ) / (float)(cw->getClip()->getLength()) << ')';
ret
=
renderClip
(
cw
,
true
,
(
(
float
)(
currentFrame
-
start
)
/
(
float
)(
cw
->
getClip
()
->
getLength
())
)
);
}
...
...
Write
Preview
Markdown
is supported
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