Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
fdabb9b4
Commit
fdabb9b4
authored
Oct 11, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor is functionnal, synchronisation included.
parent
f01a7cba
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
17 deletions
+24
-17
src/GUI/Timeline.cpp
src/GUI/Timeline.cpp
+6
-6
src/GUI/Timeline.h
src/GUI/Timeline.h
+3
-3
src/Renderer/WorkflowRenderer.cpp
src/Renderer/WorkflowRenderer.cpp
+2
-3
src/Renderer/WorkflowRenderer.h
src/Renderer/WorkflowRenderer.h
+1
-1
src/Workflow/MainWorkflow.cpp
src/Workflow/MainWorkflow.cpp
+5
-3
src/Workflow/TrackHandler.cpp
src/Workflow/TrackHandler.cpp
+5
-0
src/Workflow/TrackHandler.h
src/Workflow/TrackHandler.h
+1
-0
src/Workflow/TrackWorkflow.h
src/Workflow/TrackWorkflow.h
+1
-1
No files found.
src/GUI/Timeline.cpp
View file @
fdabb9b4
...
...
@@ -58,9 +58,9 @@ Timeline::Timeline( QWidget *parent ) :
setDuration
(
0
);
connect
(
m_tracksView
->
horizontalScrollBar
(),
SIGNAL
(
valueChanged
(
int
)
),
m_tracksRuler
,
SLOT
(
moveRuler
(
int
)
)
);
connect
(
m_tracksView
,
SIGNAL
(
durationChanged
(
int
)
),
this
,
SLOT
(
setDuration
(
int
)
)
);
connect
(
m_mainWorkflow
,
SIGNAL
(
clipAdded
(
Clip
*
,
uint
,
qint64
)
),
this
,
SLOT
(
actionAddClip
(
Clip
*
,
uint
,
qint64
)
)
);
connect
(
m_mainWorkflow
,
SIGNAL
(
clipMoved
(
QUuid
,
uint
,
qint64
)
),
this
,
SLOT
(
actionMoveClip
(
QUuid
,
uint
,
qint64
)
)
);
connect
(
m_mainWorkflow
,
SIGNAL
(
clipRemoved
(
QUuid
,
uint
)
),
this
,
SLOT
(
actionRemoveClip
(
QUuid
,
uint
))
);
connect
(
m_mainWorkflow
,
SIGNAL
(
clipAdded
(
Clip
*
,
uint
,
qint64
,
TrackWorkflow
::
TrackType
)
),
this
,
SLOT
(
actionAddClip
(
Clip
*
,
uint
,
qint64
,
TrackWorkflow
::
TrackType
)
)
);
connect
(
m_mainWorkflow
,
SIGNAL
(
clipMoved
(
QUuid
,
uint
,
qint64
,
TrackWorkflow
::
TrackType
)
),
this
,
SLOT
(
actionMoveClip
(
QUuid
,
uint
,
qint64
,
TrackWorkflow
::
TrackType
)
)
);
connect
(
m_mainWorkflow
,
SIGNAL
(
clipRemoved
(
QUuid
,
uint
,
TrackWorkflow
::
TrackType
)
),
this
,
SLOT
(
actionRemoveClip
(
QUuid
,
uint
,
TrackWorkflow
::
TrackType
))
);
connect
(
m_mainWorkflow
,
SIGNAL
(
cleared
()
),
tracksView
(),
SLOT
(
clear
()
)
);
}
...
...
@@ -99,19 +99,19 @@ void Timeline::setTool( ToolButtons button )
tracksView
()
->
setTool
(
button
);
}
void
Timeline
::
actionAddClip
(
Clip
*
clip
,
unsigned
int
track
,
qint64
start
)
void
Timeline
::
actionAddClip
(
Clip
*
clip
,
unsigned
int
track
,
qint64
start
,
TrackWorkflow
::
TrackType
)
{
tracksView
()
->
addMediaItem
(
clip
,
track
,
start
);
}
void
Timeline
::
actionMoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
,
qint64
time
)
void
Timeline
::
actionMoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
,
qint64
time
,
TrackWorkflow
::
TrackType
)
{
tracksView
()
->
moveMediaItem
(
uuid
,
track
,
time
);
tracksView
()
->
updateDuration
();
tracksRuler
()
->
update
();
}
void
Timeline
::
actionRemoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
)
void
Timeline
::
actionRemoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
,
TrackWorkflow
::
TrackType
)
{
tracksView
()
->
removeMediaItem
(
uuid
,
track
);
}
src/GUI/Timeline.h
View file @
fdabb9b4
...
...
@@ -48,9 +48,9 @@ public slots:
void
changeZoom
(
int
factor
);
void
setDuration
(
int
duration
);
void
setTool
(
ToolButtons
button
);
void
actionAddClip
(
Clip
*
clip
,
unsigned
int
track
,
qint64
start
);
void
actionMoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
,
qint64
time
);
void
actionRemoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
);
void
actionAddClip
(
Clip
*
clip
,
unsigned
int
track
,
qint64
start
,
TrackWorkflow
::
TrackType
);
void
actionMoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
,
qint64
time
,
TrackWorkflow
::
TrackType
);
void
actionRemoveClip
(
const
QUuid
&
uuid
,
unsigned
int
track
,
TrackWorkflow
::
TrackType
);
protected:
virtual
void
changeEvent
(
QEvent
*
e
);
...
...
src/Renderer/WorkflowRenderer.cpp
View file @
fdabb9b4
...
...
@@ -93,10 +93,9 @@ void* WorkflowRenderer::lock( void* datas )
if
(
self
->
m_stopping
==
false
)
{
void
*
ret
=
self
->
m_mainWorkflow
->
getSynchroneOutput
();
self
->
m_lastFrame
=
static_cast
<
unsigned
char
*>
(
ret
);
return
ret
;
self
->
m_lastFrame
=
static_cast
<
MainWorkflow
::
OutputBuffers
*>
(
ret
);
}
return
self
->
m_lastFrame
;
return
self
->
m_lastFrame
->
video
;
}
void
WorkflowRenderer
::
unlock
(
void
*
datas
)
...
...
src/Renderer/WorkflowRenderer.h
View file @
fdabb9b4
...
...
@@ -72,7 +72,7 @@ class WorkflowRenderer : public GenericRenderer
bool
m_stopping
;
private:
unsigned
char
*
m_lastFrame
;
MainWorkflow
::
OutputBuffers
*
m_lastFrame
;
QStack
<
Actions
>
m_actions
;
QReadWriteLock
*
m_actionsLock
;
bool
m_pauseAsked
;
...
...
src/Workflow/MainWorkflow.cpp
View file @
fdabb9b4
...
...
@@ -47,7 +47,8 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_tracks
=
new
TrackHandler
*
[
2
];
for
(
unsigned
int
i
=
0
;
i
<
TrackWorkflow
::
NbType
;
++
i
)
{
TrackWorkflow
::
TrackType
trackType
=
(
i
==
0
?
TrackWorkflow
::
Video
:
TrackWorkflow
::
Audio
);
//FIXME after refactoring
TrackWorkflow
::
TrackType
trackType
=
(
i
==
0
?
TrackWorkflow
::
Video
:
TrackWorkflow
::
Video
);
m_tracks
[
i
]
=
new
TrackHandler
(
trackCount
,
trackType
);
connect
(
m_tracks
[
i
],
SIGNAL
(
tracksPaused
()
),
this
,
SLOT
(
tracksPaused
()
)
);
connect
(
m_tracks
[
i
],
SIGNAL
(
allTracksRenderCompleted
()
),
this
,
SLOT
(
tracksRenderCompleted
()
)
);
...
...
@@ -65,8 +66,8 @@ MainWorkflow::~MainWorkflow()
delete
m_renderMutex
;
delete
m_renderStartedLock
;
delete
[]
blackOutput
;
delete
m_tracks
[
0
];
delete
m_tracks
[
1
];
for
(
unsigned
int
i
=
0
;
i
<
TrackWorkflow
::
NbType
;
++
i
)
delete
m_tracks
[
i
];
delete
[]
m_tracks
;
}
...
...
@@ -207,6 +208,7 @@ MainWorkflow::OutputBuffers* MainWorkflow::getSynchroneOutput()
m_synchroneRenderWaitCondition
->
wait
(
m_synchroneRenderWaitConditionMutex
);
// qDebug() << "Got it";
m_synchroneRenderWaitConditionMutex
->
unlock
();
m_outputBuffers
->
video
=
m_tracks
[
TrackWorkflow
::
Video
]
->
getSynchroneOutput
();
return
m_outputBuffers
;
}
...
...
src/Workflow/TrackHandler.cpp
View file @
fdabb9b4
...
...
@@ -311,3 +311,8 @@ unsigned int TrackHandler::getTrackCount() const
{
return
m_trackCount
;
}
unsigned
char
*
TrackHandler
::
getSynchroneOutput
()
{
return
m_synchroneRenderingBuffer
;
}
src/Workflow/TrackHandler.h
View file @
fdabb9b4
...
...
@@ -56,6 +56,7 @@ class TrackHandler : public QObject
Clip
*
getClip
(
const
QUuid
&
uuid
,
unsigned
int
trackId
);
void
clear
();
void
setFullSpeedRender
(
bool
value
);
unsigned
char
*
getSynchroneOutput
();
bool
isPaused
()
const
;
bool
allTracksRendered
()
const
;
...
...
src/Workflow/TrackWorkflow.h
View file @
fdabb9b4
...
...
@@ -50,7 +50,7 @@ class TrackWorkflow : public QObject
enum
TrackType
{
Video
,
Audio
,
//
Audio,
NbType
};
TrackWorkflow
(
unsigned
int
trackId
,
TrackType
type
);
...
...
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