diff --git a/README.md b/README.md index 8fe9ee1..5947192 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,15 @@ official CMA and also offer some features missing in the original one. #### Implemented features missing in OpenCMA (Yifan Lu CLI application) * Metadata for PSP savedatas. -* Basic metadata for single songs (album, artist, title). -* Basic metadata for videos (duration, dimensions). -* Basic metadata for photos (dimensions). +* Basic metadata for single songs (album, artist, title, cover art). +* Basic metadata for videos (duration, dimensions, thumbnail). +* Basic metadata for photos (dimensions, thumbnails). * Easy wireless pairing (show PIN to the user when a Vita is detected). * Ability to restart the connection if the Vita is reconnected (on test). -* Ability to change the connection mode (usb/wireless) on the fly (on test). #### TODO: * Fix remaining bugs with thread synchronizations. -* Implement thumbnails for videos and album art for music. +* Remove wireless/usb switch and allow both to run. * Folder categories for music/videos. * SQLite backend for database. * Fix wireless streaming for music/videos. @@ -40,7 +39,7 @@ using the wireless streaming feature. * [VitaMTP](https://github.com/yifanlu/VitaMTP) -* [MediaInfo](http://mediaarea.net/en/MediaInfo) +* [Libav](http://www.libav.org/) #### Where do I get the source code? diff --git a/avdecoder.cpp b/avdecoder.cpp index 07b7c9c..db844d8 100644 --- a/avdecoder.cpp +++ b/avdecoder.cpp @@ -4,6 +4,8 @@ #include #include +AVDecoder::AvInit init; + AVDecoder::AVDecoder() : pFormatCtx(NULL) { @@ -16,14 +18,8 @@ AVDecoder::~AVDecoder() } } -void AVDecoder::init() -{ - av_register_all(); -} - bool AVDecoder::open(const QString filename) { - if(avformat_open_input(&pFormatCtx, QFile::encodeName(filename).constData(), NULL, NULL) != 0) { return false; } diff --git a/avdecoder.h b/avdecoder.h index 4e3ca70..31e1c0c 100644 --- a/avdecoder.h +++ b/avdecoder.h @@ -24,7 +24,16 @@ public: void getVideoMetadata(metadata_t &metadata); void close(); - static void init(); + class AvInit + { + public: + AvInit() + { + av_register_all(); + } + }; + + static AvInit init; private: void AVFrameToQImage(AVFrame &frame, QImage &image, int width, int height); diff --git a/cmaclient.cpp b/cmaclient.cpp index 1720dfe..e0f79bd 100644 --- a/cmaclient.cpp +++ b/cmaclient.cpp @@ -40,7 +40,6 @@ CmaClient::CmaClient(QObject *parent) : BaseWorker(parent) { this_object = this; - AVDecoder::init(); } int CmaClient::deviceRegistered(const char *deviceid)