QTfrontend/util/libav_iteraction.cpp
changeset 7617 0ac281e1b58b
parent 7544 a72ace943bfd
child 7620 fa3bc79dc0b8
equal deleted inserted replaced
7616:dcda1c2b77e4 7617:0ac281e1b58b
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  */
    17  */
    18 
    18 
       
    19 #include "libav_iteraction.h"
       
    20 
       
    21 #if VIDEOREC
    19 #define __STDC_CONSTANT_MACROS
    22 #define __STDC_CONSTANT_MACROS
    20 extern "C"
    23 extern "C"
    21 {
    24 {
    22 #include "libavformat/avformat.h"
    25 #include "libavformat/avformat.h"
    23 }
    26 }
       
    27 
    24 #include <QVector>
    28 #include <QVector>
    25 #include <QList>
    29 #include <QList>
    26 #include <QMessageBox>
    30 #include <QMessageBox>
    27 #include <QComboBox>
    31 #include <QComboBox>
    28 
    32 
    29 #include "libav_iteraction.h"
       
    30 #include "HWApplication.h"
    33 #include "HWApplication.h"
    31 
    34 
    32 struct Codec
    35 struct Codec
    33 {
    36 {
    34     CodecID id;
    37     CodecID id;
    47     QVector<Codec*> codecs;
    50     QVector<Codec*> codecs;
    48 };
    51 };
    49 
    52 
    50 QList<Codec> codecs;
    53 QList<Codec> codecs;
    51 QMap<QString,Format> formats;
    54 QMap<QString,Format> formats;
    52 
       
    53 LibavIteraction & LibavIteraction::instance()
       
    54 {
       
    55     static LibavIteraction instance;
       
    56     return instance;
       
    57 }
       
    58 
    55 
    59 // test if given format supports given codec
    56 // test if given format supports given codec
    60 bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
    57 bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
    61 {  
    58 {  
    62 #if LIBAVFORMAT_VERSION_MAJOR >= 54
    59 #if LIBAVFORMAT_VERSION_MAJOR >= 54
   323 #else
   320 #else
   324     avformat_close_input(&pContext);
   321     avformat_close_input(&pContext);
   325 #endif
   322 #endif
   326     return desc;
   323     return desc;
   327 }
   324 }
       
   325 
       
   326 #else
       
   327 LibavIteraction::LibavIteraction()
       
   328 {
       
   329 
       
   330 }
       
   331 
       
   332 void LibavIteraction::fillFormats(QComboBox * pFormats)
       
   333 {
       
   334     Q_UNUSED(pFormats);
       
   335 }
       
   336 
       
   337 void LibavIteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
       
   338 {
       
   339     Q_UNUSED(format);
       
   340     Q_UNUSED(pVCodecs);
       
   341     Q_UNUSED(pACodecs);
       
   342 }
       
   343 
       
   344 QString LibavIteraction::getExtension(const QString & format)
       
   345 {
       
   346     Q_UNUSED(format);
       
   347 
       
   348     return QString();
       
   349 }
       
   350 
       
   351 QString LibavIteraction::getFileInfo(const QString & filepath)
       
   352 {
       
   353     Q_UNUSED(filepath);
       
   354 
       
   355     return QString();
       
   356 }
       
   357 #endif
       
   358 
       
   359 LibavIteraction & LibavIteraction::instance()
       
   360 {
       
   361     static LibavIteraction instance;
       
   362     return instance;
       
   363 }