Return the correct codec/format type for all the supported file types.

This commit is contained in:
codestation
2013-09-14 17:30:10 -04:30
parent 339b08704a
commit 6bff6b9831
6 changed files with 90 additions and 35 deletions

View File

@@ -18,7 +18,9 @@
*/
#include "avdecoder.h"
#include "cmaobject.h"
#include <QDebug>
#include <QBuffer>
#include <QFile>
#include <QSettings>
@@ -110,6 +112,13 @@ void AVDecoder::getVideoMetadata(metadata_t &metadata)
AVCodecContext *pCodecCtx = pFormatCtx->streams[stream_index]->codec;
metadata.data.video.tracks->data.track_video.width = pCodecCtx->width;
metadata.data.video.tracks->data.track_video.height = pCodecCtx->height;
if(strcmp(codec->name, "h264") == 0) {
metadata.data.video.tracks->data.track_video.codecType = CODEC_TYPE_AVC;
} else if(strcmp(codec->name, "mpeg4") == 0) {
metadata.data.video.tracks->data.track_video.codecType = CODEC_TYPE_MPEG4;
} else {
metadata.data.video.tracks->data.track_video.codecType = 0;
}
}
}