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
5df4fd43
Commit
5df4fd43
authored
Apr 07, 2010
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deactivating effect engine.
parent
68d60a4f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
65 deletions
+28
-65
src/Gui/MainWindow.cpp
src/Gui/MainWindow.cpp
+9
-9
src/Workflow/MainWorkflow.cpp
src/Workflow/MainWorkflow.cpp
+7
-19
src/Workflow/MainWorkflow.h
src/Workflow/MainWorkflow.h
+0
-9
src/Workflow/TrackHandler.cpp
src/Workflow/TrackHandler.cpp
+10
-17
src/Workflow/TrackHandler.h
src/Workflow/TrackHandler.h
+2
-11
No files found.
src/Gui/MainWindow.cpp
View file @
5df4fd43
...
...
@@ -505,15 +505,15 @@ void MainWindow::toolButtonClicked( int id )
emit
toolChanged
(
(
ToolButtons
)
id
);
}
void
MainWindow
::
on_actionBypass_effects_engine_toggled
(
bool
toggled
)
{
EffectsEngine
*
ee
;
ee
=
MainWorkflow
::
getInstance
()
->
getEffectsEngine
();
if
(
toggled
)
ee
->
enable
();
else
ee
->
disable
();
void
MainWindow
::
on_actionBypass_effects_engine_toggled
(
bool
)
{
//
EffectsEngine* ee;
//
//
ee = MainWorkflow::getInstance()->getEffectsEngine();
//
if (toggled)
//
ee->enable();
//
else
//
ee->disable();
return
;
}
...
...
src/Workflow/MainWorkflow.cpp
View file @
5df4fd43
...
...
@@ -47,16 +47,13 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_currentFrameLock
=
new
QReadWriteLock
;
m_renderStartedMutex
=
new
QMutex
;
m_effectEngine
=
new
EffectsEngine
;
m_effectEngine
->
disable
();
m_tracks
=
new
TrackHandler
*
[
MainWorkflow
::
NbTrackType
];
m_currentFrame
=
new
qint64
[
MainWorkflow
::
NbTrackType
];
for
(
unsigned
int
i
=
0
;
i
<
MainWorkflow
::
NbTrackType
;
++
i
)
{
MainWorkflow
::
TrackType
trackType
=
(
i
==
0
?
MainWorkflow
::
VideoTrack
:
MainWorkflow
::
AudioTrack
);
m_tracks
[
i
]
=
new
TrackHandler
(
trackCount
,
trackType
,
m_effectEngine
);
m_tracks
[
i
]
=
new
TrackHandler
(
trackCount
,
trackType
);
connect
(
m_tracks
[
i
],
SIGNAL
(
tracksEndReached
()
),
this
,
SLOT
(
tracksEndReached
()
)
);
m_currentFrame
[
i
]
=
0
;
...
...
@@ -66,7 +63,6 @@ MainWorkflow::MainWorkflow( int trackCount ) :
MainWorkflow
::~
MainWorkflow
()
{
delete
m_effectEngine
;
delete
m_renderStartedMutex
;
delete
m_currentFrameLock
;
delete
m_currentFrame
;
...
...
@@ -75,12 +71,6 @@ MainWorkflow::~MainWorkflow()
delete
[]
m_tracks
;
}
EffectsEngine
*
MainWorkflow
::
getEffectsEngine
()
{
return
m_effectEngine
;
}
void
MainWorkflow
::
addClip
(
Clip
*
clip
,
unsigned
int
trackId
,
qint64
start
,
MainWorkflow
::
TrackType
trackType
)
...
...
@@ -134,21 +124,19 @@ MainWorkflow::getOutput( TrackType trackType, bool paused )
{
QReadLocker
lock2
(
m_currentFrameLock
);
m_tracks
[
trackType
]
->
getOutput
(
m_currentFrame
[
VideoTrack
],
void
*
ret
=
m_tracks
[
trackType
]
->
getOutput
(
m_currentFrame
[
VideoTrack
],
m_currentFrame
[
trackType
],
paused
);
if
(
trackType
==
MainWorkflow
::
VideoTrack
)
{
m_effectEngine
->
render
();
const
LightVideoFrame
&
tmp
=
m_effectEngine
->
getVideoOutput
(
1
);
if
(
tmp
->
nboctets
==
0
)
m_outputBuffers
->
video
=
blackOutput
;
LightVideoFrame
*
frame
=
static_cast
<
LightVideoFrame
*>
(
ret
);
if
(
frame
==
NULL
)
m_outputBuffers
->
video
=
MainWorkflow
::
blackOutput
;
else
m_outputBuffers
->
video
=
&
tmp
;
m_outputBuffers
->
video
=
frame
;
}
else
{
m_outputBuffers
->
audio
=
m_tracks
[
MainWorkflow
::
AudioTrack
]
->
getTmpAudioBuffer
();
m_outputBuffers
->
audio
=
static_cast
<
AudioClipWorkflow
::
AudioSample
*>
(
ret
);
}
}
return
m_outputBuffers
;
...
...
src/Workflow/MainWorkflow.h
View file @
5df4fd43
...
...
@@ -123,13 +123,6 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
* \param paused The paused state of the renderer
*/
OutputBuffers
*
getOutput
(
TrackType
trackType
,
bool
paused
);
/**
* \brief Returns the effect engine instance used by the workflow
*
* \return The effect engine instance used by the workflow
*/
EffectsEngine
*
getEffectsEngine
();
/**
* \brief Set the workflow position by the desired frame
* \param currentFrame: The desired frame to render from
...
...
@@ -386,8 +379,6 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
/// Pre-allocated buffer, that will contain every computed outputs.
OutputBuffers
*
m_outputBuffers
;
/// Effect engine instance.
EffectsEngine
*
m_effectEngine
;
/// Width used for the render
quint32
m_width
;
/// Height used for the render
...
...
src/Workflow/TrackHandler.cpp
View file @
5df4fd43
...
...
@@ -31,12 +31,10 @@
LightVideoFrame
*
TrackHandler
::
nullOutput
=
NULL
;
TrackHandler
::
TrackHandler
(
unsigned
int
nbTracks
,
MainWorkflow
::
TrackType
trackType
,
EffectsEngine
*
effectsEngine
)
:
TrackHandler
::
TrackHandler
(
unsigned
int
nbTracks
,
MainWorkflow
::
TrackType
trackType
)
:
m_trackCount
(
nbTracks
),
m_trackType
(
trackType
),
m_length
(
0
),
m_effectEngine
(
effectsEngine
)
m_length
(
0
)
{
TrackHandler
::
nullOutput
=
new
LightVideoFrame
();
...
...
@@ -113,29 +111,23 @@ TrackHandler::getLength() const
return
m_length
;
}
void
void
*
TrackHandler
::
getOutput
(
qint64
currentFrame
,
qint64
subFrame
,
bool
paused
)
{
m_tmpAudioBuffer
=
NULL
;
for
(
unsigned
int
i
=
0
;
i
<
m_trackCount
;
++
i
)
for
(
int
i
=
m_trackCount
-
1
;
i
>=
0
;
--
i
)
{
if
(
m_trackType
==
MainWorkflow
::
VideoTrack
)
{
if
(
m_tracks
[
i
].
activated
()
==
false
)
{
m_effectEngine
->
setVideoInput
(
i
+
1
,
*
TrackHandler
::
nullOutput
);
}
continue
;
else
{
void
*
ret
=
m_tracks
[
i
]
->
getOutput
(
currentFrame
,
subFrame
,
paused
);
StackedBuffer
<
LightVideoFrame
*>
*
buff
=
reinterpret_cast
<
StackedBuffer
<
LightVideoFrame
*>*>
(
ret
);
if
(
ret
==
NULL
)
m_effectEngine
->
setVideoInput
(
i
+
1
,
*
TrackHandler
::
nullOutput
)
;
continue
;
else
{
StackedBuffer
<
LightVideoFrame
*>*
stackedBuffer
=
reinterpret_cast
<
StackedBuffer
<
LightVideoFrame
*>*>
(
ret
);
m_effectEngine
->
setVideoInput
(
i
+
1
,
*
(
stackedBuffer
->
get
()
)
);
}
return
buff
->
get
();
}
}
else
...
...
@@ -150,10 +142,11 @@ TrackHandler::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
StackedBuffer
<
AudioClipWorkflow
::
AudioSample
*>*
stackedBuffer
=
reinterpret_cast
<
StackedBuffer
<
AudioClipWorkflow
::
AudioSample
*>*>
(
ret
);
if
(
stackedBuffer
!=
NULL
)
m_tmpAudioBuffer
=
stackedBuffer
->
get
();
return
stackedBuffer
->
get
();
}
}
}
return
NULL
;
}
void
...
...
src/Workflow/TrackHandler.h
View file @
5df4fd43
...
...
@@ -27,10 +27,6 @@
#include "Toggleable.hpp"
#include "MainWorkflow.h"
//TEMPORARY:
#include "AudioClipWorkflow.h"
class
EffectEngine
;
class
TrackWorkflow
;
class
QXmlStreamWriter
;
...
...
@@ -39,7 +35,7 @@ class TrackHandler : public QObject
{
Q_OBJECT
public:
TrackHandler
(
unsigned
int
nbTracks
,
MainWorkflow
::
TrackType
trackType
,
EffectsEngine
*
effectsEngine
);
TrackHandler
(
unsigned
int
nbTracks
,
MainWorkflow
::
TrackType
trackType
);
~
TrackHandler
();
void
addClip
(
Clip
*
clip
,
unsigned
int
trackId
,
qint64
start
);
...
...
@@ -56,7 +52,7 @@ class TrackHandler : public QObject
* track, it will be different.
* \param paused The renderer paused state
*/
void
getOutput
(
qint64
currentFrame
,
qint64
subFrame
,
void
*
getOutput
(
qint64
currentFrame
,
qint64
subFrame
,
bool
paused
);
void
activateAll
();
qint64
getClipPosition
(
const
QUuid
&
uuid
,
unsigned
int
trackId
)
const
;
...
...
@@ -69,9 +65,6 @@ class TrackHandler : public QObject
Clip
*
getClip
(
const
QUuid
&
uuid
,
unsigned
int
trackId
);
void
clear
();
//FIXME: remove this. This should go by the effect engine.
AudioClipWorkflow
::
AudioSample
*
getTmpAudioBuffer
()
{
return
m_tmpAudioBuffer
;
}
bool
endIsReached
()
const
;
void
save
(
QXmlStreamWriter
&
project
)
const
;
...
...
@@ -109,8 +102,6 @@ class TrackHandler : public QObject
qint64
m_length
;
unsigned
int
m_highestTrackNumber
;
bool
m_endReached
;
EffectsEngine
*
m_effectEngine
;
AudioClipWorkflow
::
AudioSample
*
m_tmpAudioBuffer
;
private
slots
:
...
...
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