Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdenlive
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scott Petrovic
kdenlive
Commits
f9fb419b
Commit
f9fb419b
authored
Dec 14, 2014
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enable thumbnailer (install directory might need a fix)
parent
65a9eb51
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
38 deletions
+34
-38
CMakeLists.txt
CMakeLists.txt
+1
-1
src/CMakeLists.txt
src/CMakeLists.txt
+0
-2
thumbnailer/CMakeLists.txt
thumbnailer/CMakeLists.txt
+10
-10
thumbnailer/mltpreview.cpp
thumbnailer/mltpreview.cpp
+13
-18
thumbnailer/mltpreview.desktop
thumbnailer/mltpreview.desktop
+7
-3
thumbnailer/mltpreview.h
thumbnailer/mltpreview.h
+3
-4
No files found.
CMakeLists.txt
View file @
f9fb419b
...
...
@@ -100,7 +100,7 @@ add_subdirectory(data)
#macro_optional_add_subdirectory(po)
add_subdirectory
(
renderer
)
add_subdirectory
(
src
)
#
add_subdirectory(thumbnailer)
add_subdirectory
(
thumbnailer
)
#add_subdirectory(testingArea)
...
...
src/CMakeLists.txt
View file @
f9fb419b
...
...
@@ -199,11 +199,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99")
# KDE definitions and include directories *must* always come first, Qt follows
# (to avoid breaking builds when KDE and/or Qt are installed to different
# prefixes).
add_definitions
(
${
KDE4_DEFINITIONS
}
)
include_directories
(
${
CMAKE_BINARY_DIR
}
${
KDE4_INCLUDES
}
# Adds Qt include directories too.
${
MLT_INCLUDE_DIR
}
${
MLTPP_INCLUDE_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/lib/external
...
...
thumbnailer/CMakeLists.txt
View file @
f9fb419b
set
(
westleypreview_SRCS westley
preview.cpp
)
set
(
mltpreview_SRCS mlt
preview.cpp
)
include_directories
(
${
KDE4_INCLUDES
}
${
MLT_INCLUDE_DIR
}
${
MLTPP_INCLUDE_DIR
}
)
kde4_add_plugin
(
westleypreview
${
westley
preview_SRCS
}
)
add_library
(
mltpreview MODULE
${
mlt
preview_SRCS
}
)
#include(${QT_USE_FILE})
target_link_libraries
(
westleypreview
${
KDE4_KIO_LIBS
}
${
QT_LIBRARIES
}
target_link_libraries
(
mltpreview
Qt5::Core
Qt5::Gui
KF5::KIOCore
KF5::KIOWidgets
${
MLT_LIBRARIES
}
${
MLTPP_LIBRARIES
}
)
install
(
TARGETS
westley
preview DESTINATION
${
PLUGIN_INSTALL_DIR
}
)
install
(
FILES
westley
preview.desktop DESTINATION
${
SERVICES_INSTALL_DIR
}
)
#FIXME: For some reason the plugin only seems to work if installed in $lib/qt5/plugins and not in $lib/plugins like KF5 recommands
install
(
TARGETS
mlt
preview DESTINATION
${
PLUGIN_INSTALL_DIR
}
)
install
(
FILES
mlt
preview.desktop DESTINATION
${
SERVICES_INSTALL_DIR
}
)
thumbnailer/mltpreview.cpp
View file @
f9fb419b
...
...
@@ -18,7 +18,7 @@
Boston, MA 02110-1301, USA.
***************************************************************************/
#include "
westley
preview.h"
#include "
mlt
preview.h"
#include <QFile>
#include <QImage>
...
...
@@ -27,22 +27,18 @@
#include <krandomsequence.h>
#include <QDebug>
#include <ktempdir.h>
#include <unistd.h>
#define DBG_AREA
//#include "config.h"
extern
"C"
{
KDE
_EXPORT
ThumbCreator
*
new_creator
()
{
Q_DECL
_EXPORT
ThumbCreator
*
new_creator
()
{
return
new
MltPreview
;
}
}
MltPreview
::
MltPreview
()
:
QObject
(),
ThumbCreator
()
MltPreview
::
MltPreview
()
{
Mlt
::
Factory
::
init
();
}
...
...
@@ -77,7 +73,6 @@ bool MltPreview::create(const QString &path, int width, int height, QImage &img)
}
//img = getFrame(producer, frame, width, height);
while
(
variance
<=
40
&&
ct
<
4
)
{
img
=
getFrame
(
producer
,
frame
,
wanted_width
,
wanted_height
);
variance
=
imageVariance
(
img
);
...
...
@@ -92,27 +87,27 @@ bool MltPreview::create(const QString &path, int width, int height, QImage &img)
QImage
MltPreview
::
getFrame
(
Mlt
::
Producer
*
producer
,
int
framepos
,
int
width
,
int
height
)
{
QImage
result
;
QImage
mltImage
(
width
,
height
,
QImage
::
Format_ARGB32_Premultiplied
)
;
if
(
producer
==
NULL
)
{
return
result
;
return
mltImage
;
}
producer
->
seek
(
framepos
);
Mlt
::
Frame
*
frame
=
producer
->
get_frame
();
if
(
frame
==
NULL
)
{
return
result
;
return
mltImage
;
}
mlt_image_format
format
=
mlt_image_rgb24a
;
uint8_t
*
data
=
frame
->
get_image
(
format
,
width
,
height
,
0
);
QImage
image
((
uchar
*
)
data
,
width
,
height
,
QImage
::
Format_ARGB32
);
if
(
!
image
.
isNull
())
{
result
=
image
.
rgbSwapped
().
convertToFormat
(
QImage
::
Format_RGB32
);
const
uchar
*
imagedata
=
frame
->
get_image
(
format
,
width
,
height
);
if
(
imagedata
!=
NULL
)
{
memcpy
(
mltImage
.
bits
(),
imagedata
,
width
*
height
*
4
);
mltImage
=
mltImage
.
rgbSwapped
();
}
delete
frame
;
return
result
;
return
mltImage
;
}
...
...
@@ -121,11 +116,11 @@ uint MltPreview::imageVariance(const QImage &image)
if
(
image
.
isNull
())
return
0
;
uint
delta
=
0
;
uint
avg
=
0
;
uint
bytes
=
image
.
numBytes
();
uint
bytes
=
image
.
byteCount
();
uint
STEPS
=
bytes
/
2
;
if
(
STEPS
<
1
)
return
0
;
QVarLengthArray
<
uchar
>
pivot
(
STEPS
);
kDebug
(
DBG_AREA
)
<<
"Using "
<<
STEPS
<<
" steps
\n
"
;
qDebug
(
)
<<
"Using "
<<
STEPS
<<
" steps
\n
"
;
const
uchar
*
bits
=
image
.
bits
();
// First pass: get pivots and taking average
for
(
uint
i
=
0
;
i
<
STEPS
;
i
++
){
...
...
thumbnailer/mltpreview.desktop
View file @
f9fb419b
...
...
@@ -37,7 +37,11 @@ Name[x-test]=xxMLT Playlistxx
Name[zh_CN]=MLT 播放列表
Name[zh_TW]=MLT 播放清單
X-KDE-ServiceTypes=ThumbCreator
CacheThumbnail=true
IgnoreMaximumSize=true
MimeType=video/mlt-playlist;application/x-kdenlive;application/x-kdenlivetitle;
X-KDE-Library=westleypreview
X-KDE-Library=mltpreview
CacheThumbnail=true
thumbnailer/mltpreview.h
View file @
f9fb419b
...
...
@@ -20,8 +20,8 @@
***************************************************************************/
#ifndef
WESTLEY
PREVIEW_H
#define
WESTLEY
PREVIEW_H
#ifndef
MLT
PREVIEW_H
#define
MLT
PREVIEW_H
#include <kio/thumbcreator.h>
...
...
@@ -29,9 +29,8 @@
#include <QObject>
class
MltPreview
:
public
QObject
,
public
ThumbCreator
class
MltPreview
:
public
ThumbCreator
{
Q_OBJECT
public:
MltPreview
();
virtual
~
MltPreview
();
...
...
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