Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
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
videolan
vlc
Commits
0d3e1643
Commit
0d3e1643
authored
Dec 24, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: sout_profiles: add video and audio filters (fix #7865)
parent
25316fbf
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
437 additions
and
318 deletions
+437
-318
modules/gui/qt4/components/sout/profile_selector.cpp
modules/gui/qt4/components/sout/profile_selector.cpp
+75
-0
modules/gui/qt4/components/sout/profile_selector.hpp
modules/gui/qt4/components/sout/profile_selector.hpp
+1
-0
modules/gui/qt4/ui/profiles.ui
modules/gui/qt4/ui/profiles.ui
+361
-318
No files found.
modules/gui/qt4/components/sout/profile_selector.cpp
View file @
0d3e1643
...
...
@@ -36,6 +36,7 @@
#include <QButtonGroup>
#include <QSpinBox>
#include <QUrl>
#include <QListWidgetItem>
#include <assert.h>
#include <vlc_modules.h>
...
...
@@ -246,6 +247,13 @@ void VLCProfileSelector::updateOptions( int i )
smrl
.
option
(
"vb"
,
value
.
toInt
()
);
}
HASHPICK
(
"video"
,
"filters"
);
if
(
!
value
.
isEmpty
()
)
{
QStringList
valuesList
=
QUrl
::
fromPercentEncoding
(
value
.
toAscii
()
).
split
(
";"
);
smrl
.
option
(
"vfilter"
,
QString
(
"{%1}"
).
arg
(
valuesList
.
join
(
","
)
)
);
}
/*if ( codec is h264 )*/
{
/* special handling */
...
...
@@ -304,6 +312,14 @@ void VLCProfileSelector::updateOptions( int i )
HASHPICK
(
"acodec"
,
"samplerate"
);
smrl
.
option
(
"samplerate"
,
value
.
toInt
()
);
HASHPICK
(
"audio"
,
"filters"
);
if
(
!
value
.
isEmpty
()
)
{
QStringList
valuesList
=
QUrl
::
fromPercentEncoding
(
value
.
toAscii
()
).
split
(
";"
);
smrl
.
option
(
"afilter"
,
QString
(
"{%1}"
).
arg
(
valuesList
.
join
(
","
)
)
);
}
}
else
{
HASHPICK
(
"audio"
,
"copy"
);
if
(
!
value
.
isEmpty
()
)
...
...
@@ -410,6 +426,7 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value
}
loadCapabilities
();
registerCodecs
();
registerFilters
();
QPushButton
*
saveButton
=
new
QPushButton
(
(
qs_name
.
isEmpty
()
)
?
qtr
(
"Create"
)
:
qtr
(
"Save"
)
);
...
...
@@ -454,6 +471,39 @@ void VLCProfileEditor::loadCapabilities()
module_list_free
(
p_all
);
}
inline
void
VLCProfileEditor
::
registerFilters
()
{
size_t
count
;
module_t
**
p_all
=
module_list_get
(
&
count
);
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
module_t
*
p_module
=
p_all
[
i
];
if
(
module_get_score
(
p_module
)
>
0
)
continue
;
QString
capability
=
module_get_capability
(
p_module
);
QListWidget
*
listWidget
=
NULL
;
QListWidgetItem
*
item
;
if
(
capability
==
"video filter2"
)
listWidget
=
ui
.
valueholder_video_filters
;
else
if
(
capability
==
"audio filter"
)
listWidget
=
ui
.
valueholder_audio_filters
;
if
(
!
listWidget
)
continue
;
item
=
new
QListWidgetItem
(
module_get_name
(
p_module
,
true
)
);
item
->
setCheckState
(
Qt
::
Unchecked
);
item
->
setToolTip
(
QString
(
module_get_help
(
p_module
)
)
);
item
->
setData
(
Qt
::
UserRole
,
QString
(
module_get_object
(
p_module
)
)
);
listWidget
->
addItem
(
item
);
}
module_list_free
(
p_all
);
ui
.
valueholder_video_filters
->
sortItems
();
ui
.
valueholder_audio_filters
->
sortItems
();
}
inline
void
VLCProfileEditor
::
registerCodecs
()
{
#define SETMUX( button, val, vid, aud, men, sub, stream, chaps ) \
...
...
@@ -631,6 +681,19 @@ void VLCProfileEditor::fillProfile( const QString& qs )
QLineEdit
*
box
=
qobject_cast
<
QLineEdit
*>
(
object
);
box
->
setText
(
QUrl
::
fromPercentEncoding
(
value
.
toAscii
()
)
);
}
else
if
(
object
->
inherits
(
"QListWidget"
)
)
{
QStringList
valuesList
=
QUrl
::
fromPercentEncoding
(
value
.
toAscii
()
).
split
(
";"
);
const
QListWidget
*
list
=
qobject_cast
<
const
QListWidget
*>
(
object
);
for
(
int
i
=
0
;
i
<
list
->
count
();
i
++
)
{
QListWidgetItem
*
item
=
list
->
item
(
i
);
if
(
valuesList
.
contains
(
item
->
data
(
Qt
::
UserRole
).
toString
()
)
)
item
->
setCheckState
(
Qt
::
Checked
);
else
item
->
setCheckState
(
Qt
::
Unchecked
);
}
}
}
}
}
...
...
@@ -752,6 +815,18 @@ QString VLCProfileEditor::transcodeValue()
const
QLineEdit
*
box
=
qobject_cast
<
const
QLineEdit
*>
(
object
);
value
=
QUrl
::
toPercentEncoding
(
box
->
text
(),
""
,
"_;"
);
}
else
if
(
object
->
inherits
(
"QListWidget"
)
)
{
const
QListWidget
*
list
=
qobject_cast
<
const
QListWidget
*>
(
object
);
QStringList
valuesList
;
for
(
int
i
=
0
;
i
<
list
->
count
();
i
++
)
{
const
QListWidgetItem
*
item
=
list
->
item
(
i
);
if
(
item
->
checkState
()
==
Qt
::
Checked
)
valuesList
.
append
(
item
->
data
(
Qt
::
UserRole
).
toString
()
);
}
value
=
QUrl
::
toPercentEncoding
(
valuesList
.
join
(
";"
),
""
,
"_;"
);
}
if
(
!
value
.
isEmpty
()
)
configuration
<<
QString
(
"%1_%2=%3"
)
...
...
modules/gui/qt4/components/sout/profile_selector.hpp
View file @
0d3e1643
...
...
@@ -74,6 +74,7 @@ public:
QStringList
qpcodecsList
;
private:
void
registerCodecs
();
void
registerFilters
();
void
fillProfile
(
const
QString
&
qs
);
void
fillProfileOldFormat
(
const
QString
&
qs
);
typedef
QSet
<
QString
>
resultset
;
...
...
modules/gui/qt4/ui/profiles.ui
View file @
0d3e1643
This diff is collapsed.
Click to expand it.
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