Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
e7fe15c7
Commit
e7fe15c7
authored
Jan 07, 2010
by
Vincent Carrubba
Browse files
Use new in/out methods of the effects engine
parent
cda38969
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/EffectsEngine/EffectsEngine.cpp
View file @
e7fe15c7
...
...
@@ -27,7 +27,7 @@
#include
<iostream>
EffectsEngine
::
EffectsEngine
(
void
)
:
m_patch
(
NULL
),
m_bypassPatch
(
NULL
)
EffectsEngine
::
EffectsEngine
(
void
)
:
m_patch
(
NULL
),
m_bypassPatch
(
NULL
)
,
m_enabled
(
true
),
m_processedInBypassPatch
(
false
)
{
//
//
...
...
@@ -168,16 +168,41 @@ EffectNode const * EffectsEngine::operator*( void ) const
//
//
const
LightVideoFrame
&
EffectsEngine
::
getVideoOutput
(
quint32
outId
)
const
void
EffectsEngine
::
setVideoInput
(
quint32
inId
,
const
LightVideoFrame
&
frame
)
{
return
(
*
m_patch
->
getInternalStaticVideoInput
(
outId
));
QWriteLocker
wl
(
&
m_rwl
);
if
(
m_enabled
==
true
)
{
m_processedInBypassPatch
=
false
;
(
*
m_patch
->
getInternalStaticVideoOutput
(
inId
))
<<
frame
;
}
else
{
m_processedInBypassPatch
=
true
;
(
*
m_bypassPatch
->
getInternalStaticVideoOutput
(
inId
))
<<
frame
;
}
}
void
EffectsEngine
::
setVideoInput
(
quint32
inId
,
const
LightVideoFrame
&
frame
)
EffectsEngine
::
render
(
void
)
{
(
*
m_patch
->
getInternalStaticVideoOutput
(
inId
))
<<
frame
;
QWriteLocker
wl
(
&
m_rwl
);
if
(
m_processedInBypassPatch
==
false
)
m_patch
->
render
();
else
m_bypassPatch
->
render
();
}
const
LightVideoFrame
&
EffectsEngine
::
getVideoOutput
(
quint32
outId
)
const
{
QReadLocker
rl
(
&
m_rwl
);
if
(
m_processedInBypassPatch
==
false
)
return
(
*
m_patch
->
getInternalStaticVideoInput
(
outId
));
return
(
*
m_bypassPatch
->
getInternalStaticVideoInput
(
outId
));
}
// BYPASSING
...
...
@@ -185,11 +210,13 @@ EffectsEngine::setVideoInput( quint32 inId, const LightVideoFrame & frame )
void
EffectsEngine
::
enable
(
void
)
{
return
;
QWriteLocker
wl
(
&
m_rwl
);
m_enabled
=
true
;
}
void
EffectsEngine
::
disable
(
void
)
{
return
;
QWriteLocker
wl
(
&
m_rwl
);
m_enabled
=
false
;
}
src/EffectsEngine/EffectsEngine.h
View file @
e7fe15c7
...
...
@@ -54,6 +54,7 @@ class EffectsEngine
void
disable
(
void
);
const
LightVideoFrame
&
getVideoOutput
(
quint32
outId
)
const
;
void
render
(
void
);
void
setVideoInput
(
quint32
inId
,
const
LightVideoFrame
&
frame
);
private:
...
...
@@ -62,6 +63,8 @@ class EffectsEngine
EffectNodeFactory
m_enf
;
EffectNode
*
m_patch
;
EffectNode
*
m_bypassPatch
;
bool
m_enabled
;
bool
m_processedInBypassPatch
;
};
#endif // EFFECTSENGINE_H_
src/Workflow/MainWorkflow.cpp
View file @
e7fe15c7
...
...
@@ -218,8 +218,8 @@ MainWorkflow::OutputBuffers* MainWorkflow::getSynchroneOutput()
// qDebug() << "Waiting for sync output";
m_synchroneRenderWaitCondition
->
wait
(
m_synchroneRenderWaitConditionMutex
);
// qDebug() << "Got it";
(
*
m_effectEngine
)
->
render
();
LightVideoFrame
const
&
tmp
=
(
*
((
*
m_effectEngine
)
->
get
InternalStatic
Video
In
put
(
1
))
);
m_effectEngine
->
render
();
LightVideoFrame
const
&
tmp
=
m_effectEngine
->
getVideo
Out
put
(
1
);
if
(
tmp
->
nboctets
==
0
)
m_outputBuffers
->
video
=
MainWorkflow
::
blackOutput
;
else
...
...
src/Workflow/TrackHandler.cpp
View file @
e7fe15c7
...
...
@@ -112,7 +112,7 @@ void TrackHandler::getOutput( qint64 currentFrame )
m_tracks
[
i
]
->
simulateBlackOutputRender
();
}
else
(
*
((
*
m_effectEngine
)
->
g
et
InternalStatic
Video
Out
put
(
i
+
1
)))
<<
*
TrackHandler
::
nullOutput
;
m_effectEngine
->
s
etVideo
In
put
(
i
+
1
,
*
TrackHandler
::
nullOutput
)
;
continue
;
}
++
m_nbTracksToRender
;
...
...
@@ -303,9 +303,9 @@ void TrackHandler::tracksRenderCompleted( unsigned int trackId )
{
LightVideoFrame
*
buff
=
reinterpret_cast
<
LightVideoFrame
*>
(
m_tracks
[
trackId
]
->
getSynchroneOutput
()
);
if
(
buff
==
NULL
)
(
*
((
*
m_effectEngine
)
->
g
et
InternalStatic
Video
Out
put
(
trackId
+
1
)))
<<
*
TrackHandler
::
nullOutput
;
m_effectEngine
->
s
etVideo
In
put
(
trackId
+
1
,
*
TrackHandler
::
nullOutput
)
;
else
(
*
((
*
m_effectEngine
)
->
getInternalStatic
Video
Out
put
(
trackId
+
1
)))
<<
*
buff
;
m_effectEngine
->
set
Video
In
put
(
trackId
+
1
,
*
buff
)
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment