Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
64027bb0
Commit
64027bb0
authored
Nov 19, 2016
by
Jean-Baptiste Mardelle
Browse files
Do not cache supported codecs / formats
Fix slideshow image count message when no image found
parent
f4917838
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/dialogs/renderwidget.cpp
View file @
64027bb0
...
...
@@ -92,6 +92,9 @@ enum JOBSTATUS {
ABORTEDJOB
};
static
QStringList
acodecsList
;
static
QStringList
vcodecsList
;
static
QStringList
supportedFormats
;
RenderJobItem
::
RenderJobItem
(
QTreeWidget
*
parent
,
const
QStringList
&
strings
,
int
type
)
:
QTreeWidgetItem
(
parent
,
strings
,
type
),
...
...
@@ -312,6 +315,7 @@ RenderWidget::RenderWidget(const QString &projectfolder, bool enableProxy, const
QDBusConnectionInterface
*
interface
=
QDBusConnection
::
sessionBus
().
interface
();
if
(
!
interface
||
(
!
interface
->
isServiceRegistered
(
QStringLiteral
(
"org.kde.ksmserver"
))
&&
!
interface
->
isServiceRegistered
(
QStringLiteral
(
"org.gnome.SessionManager"
))))
m_view
.
shutdown
->
setEnabled
(
false
);
checkCodecs
();
refreshView
();
focusFirstVisibleItem
();
adjustSize
();
...
...
@@ -1429,14 +1433,6 @@ void RenderWidget::refreshView()
QIcon
brokenIcon
=
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"dialog-close"
));
QIcon
warningIcon
=
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"dialog-warning"
));
QStringList
formatsList
;
QStringList
vcodecsList
;
QStringList
acodecsList
;
if
(
!
KdenliveSettings
::
bypasscodeccheck
())
{
formatsList
=
KdenliveSettings
::
supportedformats
();
vcodecsList
=
KdenliveSettings
::
videocodecs
();
acodecsList
=
KdenliveSettings
::
audiocodecs
();
}
KColorScheme
scheme
(
palette
().
currentColorGroup
(),
KColorScheme
::
Window
);
const
QColor
disabled
=
scheme
.
foreground
(
KColorScheme
::
InactiveText
).
color
();
const
QColor
disabledbg
=
scheme
.
background
(
KColorScheme
::
NegativeBackground
).
color
();
...
...
@@ -1474,13 +1470,13 @@ void RenderWidget::refreshView()
}
// Make sure the selected profile uses an installed avformat codec / format
if
(
!
f
ormats
List
.
isEmpty
())
{
if
(
!
supportedF
ormats
.
isEmpty
())
{
QString
format
;
if
(
std
.
startsWith
(
QLatin1String
(
"f="
)))
format
=
std
.
section
(
QStringLiteral
(
"f="
),
1
,
1
);
else
if
(
std
.
contains
(
QStringLiteral
(
" f="
)))
format
=
std
.
section
(
QStringLiteral
(
" f="
),
1
,
1
);
if
(
!
format
.
isEmpty
())
{
format
=
format
.
section
(
' '
,
0
,
0
).
toLower
();
if
(
!
f
ormats
List
.
contains
(
format
))
{
if
(
!
supportedF
ormats
.
contains
(
format
))
{
item
->
setData
(
0
,
ErrorRole
,
i18n
(
"Unsupported video format: %1"
,
format
));
item
->
setIcon
(
0
,
brokenIcon
);
item
->
setForeground
(
0
,
disabled
);
...
...
@@ -1817,7 +1813,6 @@ void RenderWidget::parseFile(const QString &exportFile, bool editable)
QString
extension
;
QDomNodeList
groups
=
doc
.
elementsByTagName
(
QStringLiteral
(
"group"
));
QTreeWidgetItem
*
item
=
NULL
;
const
QStringList
acodecsList
=
KdenliveSettings
::
audiocodecs
();
bool
replaceVorbisCodec
=
false
;
if
(
acodecsList
.
contains
(
QStringLiteral
(
"libvorbis"
)))
replaceVorbisCodec
=
true
;
bool
replaceLibfaacCodec
=
false
;
...
...
@@ -2547,3 +2542,28 @@ void RenderWidget::adjustSpeed(int speedIndex)
}
}
}
void
RenderWidget
::
checkCodecs
()
{
Mlt
::
Profile
p
;
Mlt
::
Consumer
*
consumer
=
new
Mlt
::
Consumer
(
p
,
"avformat"
);;
if
(
consumer
)
{
consumer
->
set
(
"vcodec"
,
"list"
);
consumer
->
set
(
"acodec"
,
"list"
);
consumer
->
set
(
"f"
,
"list"
);
consumer
->
start
();
vcodecsList
.
clear
();
Mlt
::
Properties
vcodecs
((
mlt_properties
)
consumer
->
get_data
(
"vcodec"
));
for
(
int
i
=
0
;
i
<
vcodecs
.
count
();
++
i
)
vcodecsList
<<
QString
(
vcodecs
.
get
(
i
));
acodecsList
.
clear
();
Mlt
::
Properties
acodecs
((
mlt_properties
)
consumer
->
get_data
(
"acodec"
));
for
(
int
i
=
0
;
i
<
acodecs
.
count
();
++
i
)
acodecsList
<<
QString
(
acodecs
.
get
(
i
));
supportedFormats
.
clear
();
Mlt
::
Properties
formats
((
mlt_properties
)
consumer
->
get_data
(
"f"
));
for
(
int
i
=
0
;
i
<
formats
.
count
();
++
i
)
supportedFormats
<<
QString
(
formats
.
get
(
i
));
delete
consumer
;
}
}
src/dialogs/renderwidget.h
View file @
64027bb0
...
...
@@ -211,6 +211,7 @@ private:
bool
saveProfile
(
QDomElement
newprofile
);
/** @brief Create a rendering profile from MLT preset. */
QTreeWidgetItem
*
loadFromMltPreset
(
const
QString
groupName
,
const
QString
path
,
const
QString
profileName
);
void
checkCodecs
();
signals:
void
abortProcess
(
const
QString
&
url
);
...
...
src/dialogs/wizard.cpp
View file @
64027bb0
...
...
@@ -54,6 +54,9 @@ const int mltVersionRevision = MLT_MIN_PATCH_VERSION;
static
const
char
kdenlive_version
[]
=
KDENLIVE_VERSION
;
static
QStringList
acodecsList
;
static
QStringList
vcodecsList
;
MyWizardPage
::
MyWizardPage
(
QWidget
*
parent
)
:
QWizardPage
(
parent
)
,
m_isComplete
(
false
)
...
...
@@ -363,21 +366,12 @@ void Wizard::checkMltComponents()
consumer
->
set
(
"acodec"
,
"list"
);
consumer
->
set
(
"f"
,
"list"
);
consumer
->
start
();
QStringList
result
;
Mlt
::
Properties
vcodecs
((
mlt_properties
)
consumer
->
get_data
(
"vcodec"
));
for
(
int
i
=
0
;
i
<
vcodecs
.
count
();
++
i
)
result
<<
QString
(
vcodecs
.
get
(
i
));
KdenliveSettings
::
setVideocodecs
(
result
);
result
.
clear
();
vcodecsList
<<
QString
(
vcodecs
.
get
(
i
));
Mlt
::
Properties
acodecs
((
mlt_properties
)
consumer
->
get_data
(
"acodec"
));
for
(
int
i
=
0
;
i
<
acodecs
.
count
();
++
i
)
result
<<
QString
(
acodecs
.
get
(
i
));
KdenliveSettings
::
setAudiocodecs
(
result
);
result
.
clear
();
Mlt
::
Properties
formats
((
mlt_properties
)
consumer
->
get_data
(
"f"
));
for
(
int
i
=
0
;
i
<
formats
.
count
();
++
i
)
result
<<
QString
(
formats
.
get
(
i
));
KdenliveSettings
::
setSupportedformats
(
result
);
acodecsList
<<
QString
(
acodecs
.
get
(
i
));
checkMissingCodecs
();
delete
consumer
;
}
...
...
@@ -413,8 +407,6 @@ void Wizard::checkMltComponents()
void
Wizard
::
checkMissingCodecs
()
{
const
QStringList
acodecsList
=
KdenliveSettings
::
audiocodecs
();
const
QStringList
vcodecsList
=
KdenliveSettings
::
videocodecs
();
bool
replaceVorbisCodec
=
false
;
if
(
acodecsList
.
contains
(
QStringLiteral
(
"libvorbis"
)))
replaceVorbisCodec
=
true
;
bool
replaceLibfaacCodec
=
false
;
...
...
src/kdenlivesettings.kcfg
View file @
64027bb0
...
...
@@ -762,21 +762,6 @@
<default></default>
</entry>
<entry
name=
"audiocodecs"
type=
"StringList"
>
<label>
Available avformat audio codecs.
</label>
<default></default>
</entry>
<entry
name=
"videocodecs"
type=
"StringList"
>
<label>
Available avformat video codecs.
</label>
<default></default>
</entry>
<entry
name=
"supportedformats"
type=
"StringList"
>
<label>
Available avformat formats.
</label>
<default></default>
</entry>
<entry
name=
"hastitleproducer"
type=
"Bool"
>
<label>
Is MLT compiled with Qt4 Kdenlive title support.
</label>
<default>
true
</default>
...
...
src/project/dialogs/slideshowclip.cpp
View file @
64027bb0
...
...
@@ -273,7 +273,11 @@ void SlideshowClip::parseFolder()
}
m_count
=
m_view
.
icon_list
->
count
();
m_view
.
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setEnabled
(
m_count
>
0
);
m_view
.
label_info
->
setText
(
i18np
(
"1 image found"
,
"%1 images found"
,
m_count
));
if
(
m_count
==
0
)
{
m_view
.
label_info
->
setText
(
i18n
(
"No image found"
));
}
else
{
m_view
.
label_info
->
setText
(
i18np
(
"1 image found"
,
"%1 images found"
,
m_count
));
}
if
(
m_view
.
show_thumbs
->
isChecked
())
slotGenerateThumbs
();
m_view
.
icon_list
->
setCurrentRow
(
0
);
}
...
...
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