Use QImage to load photo metadata instead of ffmpeg.
This commit is contained in:
2
qcma.pro
2
qcma.pro
@@ -90,7 +90,7 @@ TRANSLATIONS += \
|
|||||||
resources/translations/qcma.es.ts \
|
resources/translations/qcma.es.ts \
|
||||||
resources/translations/qcma.ja.ts
|
resources/translations/qcma.ja.ts
|
||||||
|
|
||||||
VERSION = \\\"'0.2.5'\\\"
|
VERSION = \\\"'0.2.6'\\\"
|
||||||
|
|
||||||
DEFINES += "QCMA_VER=$${VERSION}"
|
DEFINES += "QCMA_VER=$${VERSION}"
|
||||||
|
|
||||||
|
@@ -164,19 +164,6 @@ void AVDecoder::getVideoMetadata(metadata_t &metadata)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AVDecoder::getPictureMetadata(metadata_t &metadata)
|
|
||||||
{
|
|
||||||
int stream_index;
|
|
||||||
AVCodec *codec = NULL;
|
|
||||||
|
|
||||||
if((stream_index = av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, &codec, 0)) >= 0) {
|
|
||||||
AVCodecContext *pCodecCtx = pFormatCtx->streams[stream_index]->codec;
|
|
||||||
metadata.data.photo.tracks->data.track_photo.width = pCodecCtx->width;
|
|
||||||
metadata.data.photo.tracks->data.track_photo.height = pCodecCtx->height;
|
|
||||||
}
|
|
||||||
metadata.data.photo.title = strdup(metadata.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray AVDecoder::getAudioThumbnail(int width, int height)
|
QByteArray AVDecoder::getAudioThumbnail(int width, int height)
|
||||||
{
|
{
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
|
@@ -44,7 +44,6 @@ public:
|
|||||||
|
|
||||||
QByteArray getAudioThumbnail(int width, int height);
|
QByteArray getAudioThumbnail(int width, int height);
|
||||||
QByteArray getVideoThumbnail(int width, int height);
|
QByteArray getVideoThumbnail(int width, int height);
|
||||||
void getPictureMetadata(metadata_t &metadata);
|
|
||||||
void getAudioMetadata(metadata_t &metadata);
|
void getAudioMetadata(metadata_t &metadata);
|
||||||
void getVideoMetadata(metadata_t &metadata);
|
void getVideoMetadata(metadata_t &metadata);
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
Database *CmaEvent::db = NULL;
|
Database *CmaEvent::db = NULL;
|
||||||
|
|
||||||
metadata_t CmaEvent::g_thumbmeta = {0, 0, 0, NULL, NULL, 0, 0, 0, Thumbnail, {{17, 144, 80, 0, 1, 1.0f, 2}}, NULL};
|
metadata_t CmaEvent::g_thumbmeta = {0, 0, 0, NULL, NULL, 0, 0, 0, Thumbnail, {{17, 240, 136, 0, 1, 1.0f, 2}}, NULL};
|
||||||
|
|
||||||
CmaEvent::CmaEvent(vita_device_t *s_device) :
|
CmaEvent::CmaEvent(vita_device_t *s_device) :
|
||||||
device(s_device), is_active(true)
|
device(s_device), is_active(true)
|
||||||
|
@@ -150,12 +150,12 @@ void CMAObject::loadVideoMetadata(const QString &path)
|
|||||||
|
|
||||||
void CMAObject::loadPhotoMetadata(const QString &path)
|
void CMAObject::loadPhotoMetadata(const QString &path)
|
||||||
{
|
{
|
||||||
AVDecoder decoder;
|
QImage img;
|
||||||
if(decoder.open(path)) {
|
if(img.load(path)) {
|
||||||
decoder.getPictureMetadata(metadata);
|
metadata.data.photo.tracks->data.track_photo.width = img.width();
|
||||||
} else {
|
metadata.data.photo.tracks->data.track_photo.height = img.height();
|
||||||
metadata.data.photo.title = strdup(metadata.name);
|
|
||||||
}
|
}
|
||||||
|
metadata.data.photo.title = strdup(metadata.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMAObject::initObject(const QFileInfo &file, int file_type)
|
void CMAObject::initObject(const QFileInfo &file, int file_type)
|
||||||
|
Reference in New Issue
Block a user