Commit cec03a34 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: profiles_editor: display muxers capabilities.

Also shows possible warning for non native muxers.
parent e3611943
...@@ -210,6 +210,7 @@ DEPS_res = \ ...@@ -210,6 +210,7 @@ DEPS_res = \
pixmaps/win7/win7thumbnail_next.png \ pixmaps/win7/win7thumbnail_next.png \
pixmaps/win7/win7thumbnail_play.png \ pixmaps/win7/win7thumbnail_play.png \
pixmaps/update.png \ pixmaps/update.png \
pixmaps/valid.png \
pixmaps/search_clear.png \ pixmaps/search_clear.png \
pixmaps/lock.png pixmaps/lock.png
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <QRadioButton> #include <QRadioButton>
#include <assert.h> #include <assert.h>
#include <vlc_modules.h>
VLCProfileSelector::VLCProfileSelector( QWidget *_parent ): QWidget( _parent ) VLCProfileSelector::VLCProfileSelector( QWidget *_parent ): QWidget( _parent )
{ {
...@@ -239,6 +240,7 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value ...@@ -239,6 +240,7 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value
ui.profileLine->setText( qs_name ); ui.profileLine->setText( qs_name );
ui.profileLine->setReadOnly( true ); ui.profileLine->setReadOnly( true );
} }
loadCapabilities();
registerCodecs(); registerCodecs();
CONNECT( ui.transcodeVideo, toggled( bool ), CONNECT( ui.transcodeVideo, toggled( bool ),
this, setVTranscodeOptions( bool ) ); this, setVTranscodeOptions( bool ) );
...@@ -259,24 +261,50 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value ...@@ -259,24 +261,50 @@ VLCProfileEditor::VLCProfileEditor( const QString& qs_name, const QString& value
BUTTONACT( cancelButton, reject() ); BUTTONACT( cancelButton, reject() );
fillProfile( value ); fillProfile( value );
muxSelected();
}
void VLCProfileEditor::loadCapabilities()
{
size_t count;
module_t **p_all = module_list_get (&count);
module_t *p_module;
/* Parse the module list for capabilities and probe each of them */
for (size_t i = 0; (p_module = p_all[i]) != NULL; i++)
{
if( module_provides( p_module, "sout mux" ) )
caps["muxers"].insert( module_get_object( p_module ) );
// else if ( module_provides( p_module, "encoder" ) )
// caps["encoders"].insert( module_get_object( p_module ) );
}
module_list_free (p_all);
} }
inline void VLCProfileEditor::registerCodecs() inline void VLCProfileEditor::registerCodecs()
{ {
#define SETMUX( button, val ) ui.button->setProperty( "sout", val ); #define SETMUX( button, val, vid, aud, men, sub, stream, chaps ) \
SETMUX( PSMux, "ps" ) ui.button->setProperty( "sout", val );\
SETMUX( TSMux, "ts" ) ui.button->setProperty( "capvideo", vid );\
SETMUX( WEBMux, "webm" ) ui.button->setProperty( "capaudio", aud );\
SETMUX( MPEG1Mux, "mpeg1" ) ui.button->setProperty( "capmenu", men );\
SETMUX( OggMux, "ogg" ) ui.button->setProperty( "capsubs", sub );\
SETMUX( ASFMux, "asf" ) ui.button->setProperty( "capstream", stream );\
SETMUX( MOVMux, "mp4" ) ui.button->setProperty( "capchaps", chaps );\
SETMUX( WAVMux, "wav" ) CONNECT( ui.button, clicked(bool), this, muxSelected() );
SETMUX( RAWMux, "raw" ) SETMUX( PSMux, "ps", true, true, false, true, false, true )
SETMUX( FLVMux, "flv" ) SETMUX( TSMux, "ts", true, true, false, true, true, false )
SETMUX( MKVMux, "mkv" ) SETMUX( WEBMux, "webm", true, true, false, false, true, false )
SETMUX( AVIMux, "avi" ) SETMUX( MPEG1Mux, "mpeg1", true, true, false, false, false, false )
SETMUX( MJPEGMux, "mpjpeg" ) SETMUX( OggMux, "ogg", true, true, false, false, true, true )
SETMUX( ASFMux, "asf", true, true, false, true, true, true )
SETMUX( MOVMux, "mp4", true, true, true, true, true, false )
SETMUX( WAVMux, "wav", false, true, false, false, false, false )
SETMUX( RAWMux, "raw", true, true, false, false, false, false )
SETMUX( FLVMux, "flv", true, true, false, false, true, false )
SETMUX( MKVMux, "mkv", true, true, true, true, true, true )
SETMUX( AVIMux, "avi", true, true, false, false, false, false )
SETMUX( MJPEGMux, "mpjpeg", true, false, false, false, false, false )
#undef SETMUX #undef SETMUX
#define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) ); #define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) );
...@@ -334,6 +362,38 @@ inline void VLCProfileEditor::registerCodecs() ...@@ -334,6 +362,38 @@ inline void VLCProfileEditor::registerCodecs()
#undef ADD_SCODEC #undef ADD_SCODEC
} }
void VLCProfileEditor::muxSelected()
{
#define SETYESNOSTATE( name, prop ) \
ui.name->setChecked( current->property( prop ).toBool() )
for ( int i=0; i< ui.muxer->layout()->count(); i++ )
{
QRadioButton *current =
qobject_cast<QRadioButton *>(ui.muxer->layout()->itemAt(i)->widget());
if ( unlikely( !current ) ) continue;
if ( !current->isChecked() ) continue;
/* dumb :/ */
SETYESNOSTATE( capvideo, "capvideo" );
SETYESNOSTATE( capaudio, "capaudio" );
SETYESNOSTATE( capmenu, "capmenu" );
SETYESNOSTATE( capsubs, "capsubs" );
SETYESNOSTATE( capstream, "capstream" );
SETYESNOSTATE( capchaps, "capchaps" );
bool b = caps["muxers"].contains( "mux_" + current->property("sout").toString() );
if ( b )
ui.muxerwarning->setText(
QString( "<img src=\":/menu/info\"/> %1" )
.arg( qtr( "This muxer is not provided directly by VLC: It could be missing." ) )
);
else
ui.muxerwarning->setText("");
return;
}
#undef SETYESNOSTATE
}
void VLCProfileEditor::fillProfile( const QString& qs ) void VLCProfileEditor::fillProfile( const QString& qs )
{ {
QStringList options = qs.split( ";" ); QStringList options = qs.split( ";" );
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include "qt4.hpp" #include "qt4.hpp"
#include <QWidget> #include <QWidget>
#include <QSet>
#include <QHash>
#include "util/qvlcframe.hpp" #include "util/qvlcframe.hpp"
#include "ui/profiles.h" #include "ui/profiles.h"
...@@ -70,12 +72,16 @@ public: ...@@ -70,12 +72,16 @@ public:
private: private:
void registerCodecs(); void registerCodecs();
void fillProfile( const QString& qs ); void fillProfile( const QString& qs );
typedef QSet<QString> resultset;
QHash<QString, resultset> caps;
void loadCapabilities();
protected slots: protected slots:
virtual void close(); virtual void close();
private slots: private slots:
void setVTranscodeOptions( bool ); void setVTranscodeOptions( bool );
void setATranscodeOptions( bool ); void setATranscodeOptions( bool );
void setSTranscodeOptions( bool ); void setSTranscodeOptions( bool );
void muxSelected();
}; };
#endif #endif
...@@ -44,12 +44,21 @@ ...@@ -44,12 +44,21 @@
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="muxer"> <widget class="QWidget" name="muxertab">
<attribute name="title"> <attribute name="title">
<string>Encapsulation</string> <string>Encapsulation</string>
</attribute> </attribute>
<layout class="QGridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="2" column="0"> <item>
<widget class="QWidget" name="muxer" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QRadioButton" name="TSMux"> <widget class="QRadioButton" name="TSMux">
<property name="text"> <property name="text">
<string>MPEG-TS</string> <string>MPEG-TS</string>
...@@ -59,87 +68,181 @@ ...@@ -59,87 +68,181 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="1" column="0">
<widget class="QRadioButton" name="PSMux"> <widget class="QRadioButton" name="PSMux">
<property name="text"> <property name="text">
<string>MPEG-PS</string> <string>MPEG-PS</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="2" column="0">
<widget class="QRadioButton" name="WAVMux"> <widget class="QRadioButton" name="MPEG1Mux">
<property name="text"> <property name="text">
<string>WAV</string> <string>MPEG 1</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="0">
<widget class="QRadioButton" name="ASFMux">
<property name="text">
<string>ASF/WMV</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="WEBMux"> <widget class="QRadioButton" name="WEBMux">
<property name="text"> <property name="text">
<string>Webm</string> <string>Webm</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="1" column="1">
<widget class="QRadioButton" name="ASFMux"> <widget class="QRadioButton" name="MJPEGMux">
<property name="text"> <property name="text">
<string>ASF/WMV</string> <string>MJPEG</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="1">
<widget class="QRadioButton" name="MKVMux">
<property name="text">
<string>MKV</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="OggMux"> <widget class="QRadioButton" name="OggMux">
<property name="text"> <property name="text">
<string>Ogg/Ogm</string> <string>Ogg/Ogm</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="1" column="2">
<widget class="QRadioButton" name="WAVMux">
<property name="text">
<string>WAV</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QRadioButton" name="RAWMux"> <widget class="QRadioButton" name="RAWMux">
<property name="text"> <property name="text">
<string>RAW</string> <string>RAW</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="0" column="3">
<widget class="QRadioButton" name="MPEG1Mux"> <widget class="QRadioButton" name="MOVMux">
<property name="text"> <property name="text">
<string>MPEG 1</string> <string>MP4/MOV</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="3"> <item row="1" column="3">
<widget class="QRadioButton" name="FLVMux"> <widget class="QRadioButton" name="FLVMux">
<property name="text"> <property name="text">
<string>FLV</string> <string>FLV</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="3"> <item row="2" column="3">
<widget class="QRadioButton" name="AVIMux"> <widget class="QRadioButton" name="AVIMux">
<property name="text"> <property name="text">
<string>AVI</string> <string>AVI</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> </layout>
<widget class="QRadioButton" name="MOVMux"> </widget>
</item>
<item>
<widget class="QGroupBox" name="muxcaps">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Features</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="3">
<widget class="YesNoCheckBox" name="capsubs">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text"> <property name="text">
<string>MP4/MOV</string> <string>Subtitles</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="0" column="4">
<widget class="QRadioButton" name="MJPEGMux"> <widget class="YesNoCheckBox" name="capstream">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text"> <property name="text">
<string>MJPEG</string> <string>Streamable</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="2" column="4">
<widget class="QRadioButton" name="MKVMux"> <widget class="YesNoCheckBox" name="capchaps">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text"> <property name="text">
<string>MKV</string> <string>Chapters</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="YesNoCheckBox" name="capaudio">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Audio</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="YesNoCheckBox" name="capvideo">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Video</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="YesNoCheckBox" name="capmenu">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Menus</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="muxerwarning">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -503,22 +606,16 @@ ...@@ -503,22 +606,16 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>YesNoCheckBox</class>
<extends>QCheckBox</extends>
<header>../util/customwidgets.hpp</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>profileLine</tabstop> <tabstop>profileLine</tabstop>
<tabstop>tabWidget</tabstop> <tabstop>tabWidget</tabstop>
<tabstop>TSMux</tabstop>
<tabstop>WEBMux</tabstop>
<tabstop>OggMux</tabstop>
<tabstop>MOVMux</tabstop>
<tabstop>PSMux</tabstop>
<tabstop>MJPEGMux</tabstop>
<tabstop>WAVMux</tabstop>
<tabstop>FLVMux</tabstop>
<tabstop>MPEG1Mux</tabstop>
<tabstop>MKVMux</tabstop>
<tabstop>RAWMux</tabstop>
<tabstop>AVIMux</tabstop>
<tabstop>ASFMux</tabstop>
<tabstop>transcodeVideo</tabstop> <tabstop>transcodeVideo</tabstop>
<tabstop>keepVideo</tabstop> <tabstop>keepVideo</tabstop>
<tabstop>vCodecBox</tabstop> <tabstop>vCodecBox</tabstop>
......
...@@ -401,3 +401,18 @@ void QToolButtonExt::clickedSlot() ...@@ -401,3 +401,18 @@ void QToolButtonExt::clickedSlot()
else if( shortClick ) else if( shortClick )
emit shortClicked(); emit shortClicked();
} }
YesNoCheckBox::YesNoCheckBox( QWidget *parent ) : QCheckBox( parent )
{
setEnabled( false );
setStyleSheet("\
QCheckBox::indicator:unchecked:hover,\
QCheckBox::indicator:unchecked {\
image: url(:/menu/quit);\
}\
QCheckBox::indicator:checked:hover,\
QCheckBox::indicator:checked {\
image: url(:/valid);\
}\
");
}
...@@ -32,12 +32,14 @@ ...@@ -32,12 +32,14 @@
#include <QLabel> #include <QLabel>
#include <QStackedWidget> #include <QStackedWidget>
#include <QSpinBox> #include <QSpinBox>
#include <QCheckBox>
#include <QList> #include <QList>
#include <QTimer> #include <QTimer>
#include <QToolButton> #include <QToolButton>
#include <QAbstractAnimation> #include <QAbstractAnimation>
class QPixmap; class QPixmap;
class QWidget;
class QFramelessButton : public QPushButton class QFramelessButton : public QPushButton
{ {
...@@ -149,6 +151,13 @@ private: ...@@ -149,6 +151,13 @@ private:
PixmapAnimator *animator; PixmapAnimator *animator;
}; };
class YesNoCheckBox : public QCheckBox
{
Q_OBJECT
public:
YesNoCheckBox( QWidget *parent );
};
/* VLC Key/Wheel hotkeys interactions */ /* VLC Key/Wheel hotkeys interactions */
class QKeyEvent; class QKeyEvent;
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
<file alias="lock">pixmaps/lock.png</file> <file alias="lock">pixmaps/lock.png</file>
<file alias="search_clear">pixmaps/search_clear.png</file> <file alias="search_clear">pixmaps/search_clear.png</file>
<file alias="dropzone">pixmaps/playlist/dropzone.png</file> <file alias="dropzone">pixmaps/playlist/dropzone.png</file>
<file alias="valid">pixmaps/valid.png</file>
</qresource> </qresource>
<qresource prefix="/prefsmenu"> <qresource prefix="/prefsmenu">
<file alias="cone_audio_64">pixmaps/prefs/spref_cone_Audio_64.png</file> <file alias="cone_audio_64">pixmaps/prefs/spref_cone_Audio_64.png</file>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment