Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
luyikei
VLMC
Commits
5212f16f
Commit
5212f16f
authored
Jun 24, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some "compactibility sleep" for windows. Basically, a #ifdef...
Removed some debug texts
parent
2c2c3c81
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
46 deletions
+49
-46
src/Media.cpp
src/Media.cpp
+0
-3
src/MetaDataManager.cpp
src/MetaDataManager.cpp
+4
-2
src/Workflow/ClipWorkflow.cpp
src/Workflow/ClipWorkflow.cpp
+2
-10
src/Workflow/TrackWorkflow.cpp
src/Workflow/TrackWorkflow.cpp
+4
-20
src/gui/RenderPreviewWidget.cpp
src/gui/RenderPreviewWidget.cpp
+2
-10
src/vlmc.h
src/vlmc.h
+35
-0
vlmc.pro
vlmc.pro
+2
-1
No files found.
src/Media.cpp
View file @
5212f16f
...
...
@@ -83,7 +83,6 @@ void Media::flushVolatileParameters()
QString
defaultValue
;
foreach
(
defaultValue
,
m_volatileParameters
)
{
qDebug
()
<<
"Restoring volatile parameter"
<<
defaultValue
;
m_vlcMedia
->
addOption
(
defaultValue
.
toStdString
().
c_str
()
);
}
m_volatileParameters
.
clear
();
...
...
@@ -91,14 +90,12 @@ void Media::flushVolatileParameters()
void
Media
::
addVolatileParam
(
const
QString
&
param
,
const
QString
&
defaultValue
)
{
qDebug
()
<<
"Adding volatile parameter:"
<<
param
<<
". Will be restored to:"
<<
defaultValue
;
m_vlcMedia
->
addOption
(
param
.
toStdString
().
c_str
()
);
m_volatileParameters
.
append
(
defaultValue
);
}
void
Media
::
addConstantParam
(
const
QString
&
param
)
{
qDebug
()
<<
"Adding constant parameter:"
<<
param
;
m_vlcMedia
->
addOption
(
param
.
toStdString
().
c_str
()
);
}
...
...
src/MetaDataManager.cpp
View file @
5212f16f
...
...
@@ -26,6 +26,8 @@
*/
#include <QtDebug>
#include "vlmc.h"
#include "MetaDataManager.h"
#include "Library.h"
...
...
@@ -80,7 +82,7 @@ void MetaDataManager::run()
m_mediaPlayer
->
play
();
m_currentClip
->
flushVolatileParameters
();
}
us
leep
(
1
0000
);
S
leep
MS
(
1
);
}
return
;
}
...
...
@@ -112,7 +114,7 @@ void MetaDataManager::getMetaData()
m_currentClip
->
setWidth
(
m_mediaPlayer
->
getWidth
()
);
m_currentClip
->
setHeight
(
m_mediaPlayer
->
getHeight
()
);
qDebug
()
<<
"length ="
<<
m_currentClip
->
getLength
();
//
qDebug() << "length =" << m_currentClip->getLength();
//Setting time for snapshot :
if
(
m_currentClip
->
getFileType
()
==
Media
::
Video
)
{
...
...
src/Workflow/ClipWorkflow.cpp
View file @
5212f16f
...
...
@@ -22,11 +22,7 @@
#include <QtDebug>
#ifdef Q_WS_WIN
// Used for Sleep()
#include <Windows.h>
#endif
#include "vlmc.h"
#include "ClipWorkflow.h"
int
g_debugId
=
0
;
...
...
@@ -197,11 +193,7 @@ ClipWorkflow::State ClipWorkflow::getState() const
void
ClipWorkflow
::
startRender
()
{
while
(
isReady
()
==
false
)
#ifdef Q_WS_WIN
Sleep
(
1
);
#else
usleep
(
50
);
#endif
SleepMS
(
1
);
m_mediaPlayer
->
play
();
setState
(
Rendering
);
}
...
...
src/Workflow/TrackWorkflow.cpp
View file @
5212f16f
...
...
@@ -22,11 +22,7 @@
#include <QtDebug>
#ifdef Q_WS_WIN
// Used for Sleep()
#include <Windows.h>
#endif
#include "vlmc.h"
#include "TrackWorkflow.h"
TrackWorkflow
::
TrackWorkflow
(
unsigned
int
trackId
)
:
...
...
@@ -84,11 +80,7 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
cw
->
getStateLock
()
->
unlock
();
while
(
cw
->
isRendering
()
==
true
)
{
#ifdef Q_WS_WIN
Sleep
(
1
);
#else
usleep
(
100
);
#endif
SleepMS
(
100
);
}
//This way we can trigger the appropriate if just below.
//by restoring the initial state of the function, and just pretend that
...
...
@@ -177,11 +169,7 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
{
cw
->
getStateLock
()
->
unlock
();
while
(
cw
->
isRendering
()
==
true
)
#ifdef Q_WS_WIN
Sleep
(
1
);
#else
usleep
(
100
);
#endif
SleepMS
(
1
);
cw
->
queryStateChange
(
ClipWorkflow
::
Stopping
);
cw
->
wake
();
cw
->
stop
();
...
...
@@ -190,11 +178,7 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
{
cw
->
getStateLock
()
->
unlock
();
while
(
cw
->
isReady
()
==
false
)
#ifdef Q_WS_WIN
Sleep
(
1
);
#else
usleep
(
20
);
#endif
SleepMS
(
1
);
cw
->
stop
();
}
else
...
...
src/gui/RenderPreviewWidget.cpp
View file @
5212f16f
...
...
@@ -23,11 +23,7 @@
#include <QtDebug>
#include <QThread>
#ifdef Q_WS_WIN
// Used for Sleep()
#include <Windows.h>
#endif
#include "vlmc.h"
#include "RenderPreviewWidget.h"
#include "Timeline.h"
...
...
@@ -136,11 +132,7 @@ void RenderPreviewWidget::nextFrame()
bool
framePlayed
=
false
;
while
(
framePlayed
==
false
)
{
#ifdef Q_WS_WIN
Sleep
(
1
);
#else
usleep
(
50
);
#endif
SleepMS
(
50
);
QReadLocker
lock
(
m_framePlayedLock
);
framePlayed
=
m_framePlayed
;
}
...
...
src/vlmc.h
0 → 100644
View file @
5212f16f
/*****************************************************************************
* vlmc.h : contains the definition for every macro and prototypes used
* used program wide.
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLMC_H
#define VLMC_H
#include <QtGlobal>
#ifdef Q_OS_UNIX
#define SleepMS( x ) usleep( (x) * 1000 )
#else
#define SleepMS( x ) Sleep( x )
#endif
#endif // VLMC_H
vlmc.pro
View file @
5212f16f
...
...
@@ -86,7 +86,8 @@ HEADERS += src/gui/MainWindow.h \
src
/
API
/
Module
.
h
\
src
/
API
/
ModuleManager
.
h
\
src
/
API
/
vlmc_module_internal
.
h
\
src
/
WorkflowFileRenderer
.
h
src
/
WorkflowFileRenderer
.
h
\
src
/
vlmc
.
h
FORMS
+=
src
/
gui
/
ui
/
MainWindow
.
ui
\
src
/
gui
/
ui
/
PreviewWidget
.
ui
\
src
/
gui
/
ui
/
Preferences
.
ui
\
...
...
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