Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
luyikei
VLMC
Commits
43c4df35
Commit
43c4df35
authored
Jun 18, 2009
by
Hugo Beauzee-Luyssen
Committed by
Ludovic Fauvet
Jun 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Image are now handled in the library.
Snapshot is working, it just misses the workflow integration.
parent
316eb5d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
25 deletions
+48
-25
src/Media.cpp
src/Media.cpp
+5
-12
src/MetaDataManager.cpp
src/MetaDataManager.cpp
+38
-12
src/MetaDataManager.h
src/MetaDataManager.h
+4
-0
src/gui/LibraryWidget.cpp
src/gui/LibraryWidget.cpp
+1
-1
No files found.
src/Media.cpp
View file @
43c4df35
...
...
@@ -34,25 +34,18 @@ const QString Media::VideoExtensions = "*.mov *.avi *.mkv *.mpg *.mpeg *.wmv *
const
QString
Media
::
ImageExtensions
=
"*.gif *.png *.jpg"
;
const
QString
Media
::
AudioExtensions
=
"*.mp3 *.oga *.flac *.aac *.wav"
;
//Media::Media( const QString& mrl )
// : m_vlcMedia( NULL ), m_mrl( mrl ), m_snapshot( NULL ), m_length( 0 ),
// m_width( 0 ), m_height( 0 )
//{
// m_vlcMedia = new LibVLCpp::Media( mrl );
// m_uuid = QUuid::createUuid();
// //We avoid creating a fileInfo from the mrl since it can be "fake://" for invmem.
// m_fileInfo = NULL;
//}
Media
::
Media
(
const
QFileInfo
*
fileInfo
)
:
m_vlcMedia
(
NULL
),
m_snapshot
(
NULL
),
m_length
(
0
),
m_width
(
0
),
m_height
(
0
)
{
m_mrl
=
"file://"
+
fileInfo
->
absoluteFilePath
();
m_vlcMedia
=
new
LibVLCpp
::
Media
(
m_mrl
);
m_uuid
=
QUuid
::
createUuid
();
m_fileInfo
=
new
QFileInfo
(
*
fileInfo
);
setFileType
();
if
(
m_fileType
==
Media
::
Video
||
m_fileType
==
Media
::
Audio
)
m_mrl
=
"file://"
+
fileInfo
->
absoluteFilePath
();
else
m_mrl
=
"fake://"
+
fileInfo
->
absoluteFilePath
();
m_vlcMedia
=
new
LibVLCpp
::
Media
(
m_mrl
);
}
Media
::~
Media
()
...
...
src/MetaDataManager.cpp
View file @
43c4df35
...
...
@@ -67,15 +67,15 @@ void MetaDataManager::run()
m_currentClip
=
m_mediaList
.
front
();
m_mediaList
.
pop_front
();
//Disabling audio for this specific use of the media
m_currentClip
->
addParam
(
":no-audio"
);
m_currentClip
->
flushParameters
();
//And re-enable it to prevent the audio to be disabled anywhere else.
m_currentClip
->
addParam
(
":audio"
);
if
(
m_currentClip
->
getFileType
()
==
Media
::
Video
)
{
computeVideoMetaData
();
}
else
if
(
m_currentClip
->
getFileType
()
==
Media
::
Image
)
{
computeImageMetaData
();
}
m_mediaPlayer
->
setMedia
(
m_currentClip
->
getVLCMedia
()
);
//TODO: activate this when switching to VLC 1.1
// connect( m_mediaPlayer, SIGNAL( lengthChanged() ), this, SLOT( entrypointLengthChanged() ) );
connect
(
m_mediaPlayer
,
SIGNAL
(
playing
()
),
this
,
SLOT
(
entrypointPlaying
()
)
);
m_mediaPlayer
->
play
();
}
...
...
@@ -84,6 +84,25 @@ void MetaDataManager::run()
return
;
}
void
MetaDataManager
::
computeVideoMetaData
()
{
//Disabling audio for this specific use of the media
m_currentClip
->
addParam
(
":no-audio"
);
m_currentClip
->
flushParameters
();
//And re-enable it to prevent the audio to be disabled anywhere else.
m_currentClip
->
addParam
(
":audio"
);
//TODO: activate this when switching to VLC 1.1
// connect( m_mediaPlayer, SIGNAL( lengthChanged() ), this, SLOT( entrypointLengthChanged() ) );
}
void
MetaDataManager
::
computeImageMetaData
()
{
m_currentClip
->
addParam
(
":access=fake"
);
m_currentClip
->
addParam
(
":fake-duration=10000"
);
m_currentClip
->
flushParameters
();
}
void
MetaDataManager
::
getMetaData
()
{
m_mediaIsPlaying
=
false
;
...
...
@@ -96,14 +115,21 @@ void MetaDataManager::getMetaData()
m_currentClip
->
setWidth
(
m_mediaPlayer
->
getWidth
()
);
m_currentClip
->
setHeight
(
m_mediaPlayer
->
getHeight
()
);
qDebug
()
<<
"length ="
<<
m_currentClip
->
getLength
();
//Setting time for snapshot :
connect
(
m_mediaPlayer
,
SIGNAL
(
positionChanged
()
),
this
,
SLOT
(
renderSnapshot
()
)
);
m_mediaPlayer
->
setTime
(
m_mediaPlayer
->
getLength
()
/
3
);
if
(
m_currentClip
->
getFileType
()
==
Media
::
Video
)
{
connect
(
m_mediaPlayer
,
SIGNAL
(
positionChanged
()
),
this
,
SLOT
(
renderSnapshot
()
)
);
m_mediaPlayer
->
setTime
(
m_mediaPlayer
->
getLength
()
/
3
);
}
else
renderSnapshot
();
}
void
MetaDataManager
::
renderSnapshot
()
{
disconnect
(
m_mediaPlayer
,
SIGNAL
(
positionChanged
()
),
this
,
SLOT
(
renderSnapshot
()
)
);
if
(
m_currentClip
->
getFileType
()
==
Media
::
Video
)
disconnect
(
m_mediaPlayer
,
SIGNAL
(
positionChanged
()
),
this
,
SLOT
(
renderSnapshot
()
)
);
QTemporaryFile
tmp
;
tmp
.
setAutoRemove
(
false
);
tmp
.
open
();
...
...
@@ -113,7 +139,7 @@ void MetaDataManager::renderSnapshot()
//The slot should be triggered in this methode
m_mediaPlayer
->
takeSnapshot
(
m_tmpSnapshotFilename
.
toStdString
().
c_str
()
,
64
,
64
);
,
0
,
0
);
//Snapshot slot should has been called (but maybe not in next version...)
}
...
...
src/MetaDataManager.h
View file @
43c4df35
...
...
@@ -54,6 +54,10 @@ class MetaDataManager : public QThread, public Singleton<MetaDataManager>
~
MetaDataManager
();
virtual
void
run
();
void
computeVideoMetaData
();
void
computeImageMetaData
();
//AMEM part :
static
void
openSoundBuffer
(
void
*
datas
,
unsigned
int
*
freq
,
unsigned
int
*
nbChannels
,
unsigned
int
*
fourCCFormat
,
...
...
src/gui/LibraryWidget.cpp
View file @
43c4df35
...
...
@@ -125,7 +125,7 @@ void LibraryWidget::newMediaLoaded( Media* media )
{
//From here, the clip is const.
addMedia
(
media
);
m_ui
.
LibraryTabs
->
setCurrentIndex
(
1
);
m_ui
.
LibraryTabs
->
setCurrentIndex
(
(
int
)
media
->
getFileType
()
);
}
void
LibraryWidget
::
insertNewMediasFromFileDialog
(
QString
title
,
QString
filter
,
Media
::
FileType
fileType
)
...
...
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