Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLMC
Manage
Activity
Members
Labels
Plan
Issues
26
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLMC
Commits
634af2e0
Commit
634af2e0
authored
8 years ago
by
luyikei
Committed by
Hugo Beauzée-Luyssen
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Media: Mark WITH_GUI on Widget-related code
Signed-off-by:
Hugo Beauzée-Luyssen
<
hugo@beauzee.fr
>
parent
fd7d8fb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Media/Media.cpp
+8
-0
8 additions, 0 deletions
src/Media/Media.cpp
src/Media/Media.h
+4
-1
4 additions, 1 deletion
src/Media/Media.h
with
12 additions
and
1 deletion
src/Media/Media.cpp
+
8
−
0
View file @
634af2e0
...
@@ -55,13 +55,17 @@ const QString Media::AudioExtensions = "*.a52 *.aac *.ac3 *.aiff *.amr *.aob *
...
@@ -55,13 +55,17 @@ const QString Media::AudioExtensions = "*.a52 *.aac *.ac3 *.aiff *.amr *.aob *
"*.wma *.wv *.xa *.xm"
;
"*.wma *.wv *.xa *.xm"
;
const
QString
Media
::
streamPrefix
=
"stream://"
;
const
QString
Media
::
streamPrefix
=
"stream://"
;
#ifdef WITH_GUI
QPixmap
*
Media
::
defaultSnapshot
=
nullptr
;
QPixmap
*
Media
::
defaultSnapshot
=
nullptr
;
#endif
Media
::
Media
(
const
QString
&
path
)
Media
::
Media
(
const
QString
&
path
)
:
m_source
(
nullptr
)
:
m_source
(
nullptr
)
,
m_fileInfo
(
nullptr
)
,
m_fileInfo
(
nullptr
)
,
m_baseClip
(
nullptr
)
,
m_baseClip
(
nullptr
)
#ifdef WITH_GUI
,
m_snapshotImage
(
nullptr
)
,
m_snapshotImage
(
nullptr
)
#endif
{
{
setFilePath
(
path
);
setFilePath
(
path
);
}
}
...
@@ -131,12 +135,14 @@ Media::onMetaDataComputed()
...
@@ -131,12 +135,14 @@ Media::onMetaDataComputed()
m_fileType
=
Image
;
m_fileType
=
Image
;
else
else
m_fileType
=
Video
;
m_fileType
=
Video
;
#ifdef WITH_GUI
if
(
m_source
->
snapshot
()
!=
nullptr
)
if
(
m_source
->
snapshot
()
!=
nullptr
)
{
{
Q_ASSERT
(
m_snapshotImage
==
nullptr
);
Q_ASSERT
(
m_snapshotImage
==
nullptr
);
m_snapshotImage
=
new
QImage
(
m_source
->
snapshot
(),
320
,
180
,
QImage
::
Format_RGB32
);
m_snapshotImage
=
new
QImage
(
m_source
->
snapshot
(),
320
,
180
,
QImage
::
Format_RGB32
);
emit
snapshotAvailable
();
emit
snapshotAvailable
();
}
}
#endif
}
}
else
if
(
m_source
->
hasAudio
()
)
else
if
(
m_source
->
hasAudio
()
)
m_fileType
=
Audio
;
m_fileType
=
Audio
;
...
@@ -169,6 +175,7 @@ Media::setFilePath( const QString &filePath )
...
@@ -169,6 +175,7 @@ Media::setFilePath( const QString &filePath )
MetaDataManager
::
instance
()
->
computeMediaMetadata
(
this
);
MetaDataManager
::
instance
()
->
computeMediaMetadata
(
this
);
}
}
#ifdef WITH_GUI
QPixmap
&
QPixmap
&
Media
::
snapshot
()
Media
::
snapshot
()
{
{
...
@@ -187,3 +194,4 @@ Media::snapshot()
...
@@ -187,3 +194,4 @@ Media::snapshot()
Media
::
defaultSnapshot
=
new
QPixmap
(
":/images/vlmc"
);
Media
::
defaultSnapshot
=
new
QPixmap
(
":/images/vlmc"
);
return
*
Media
::
defaultSnapshot
;
return
*
Media
::
defaultSnapshot
;
}
}
#endif
This diff is collapsed.
Click to expand it.
src/Media/Media.h
+
4
−
1
View file @
634af2e0
...
@@ -99,9 +99,10 @@ public:
...
@@ -99,9 +99,10 @@ public:
QVariant
toVariant
()
const
;
QVariant
toVariant
()
const
;
#ifdef WITH_GUI
// This has to be called from the GUI thread.
// This has to be called from the GUI thread.
QPixmap
&
snapshot
();
QPixmap
&
snapshot
();
#endif
protected
:
protected
:
Backend
::
ISource
*
m_source
;
Backend
::
ISource
*
m_source
;
QString
m_mrl
;
QString
m_mrl
;
...
@@ -110,9 +111,11 @@ protected:
...
@@ -110,9 +111,11 @@ protected:
QString
m_fileName
;
QString
m_fileName
;
Clip
*
m_baseClip
;
Clip
*
m_baseClip
;
#ifdef WITH_GUI
static
QPixmap
*
defaultSnapshot
;
static
QPixmap
*
defaultSnapshot
;
QPixmap
m_snapshot
;
QPixmap
m_snapshot
;
QImage
*
m_snapshotImage
;
QImage
*
m_snapshotImage
;
#endif
signals
:
signals
:
void
metaDataComputed
();
void
metaDataComputed
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment