Read steam information from LibAvContextHandle when it is possible

This commit is contained in:
jfmcarreira committed 2014-02-02 14:07:42 +00:00
1 parent 7c033380d4
commit 4523accb07
2 files changed
+15 -3

No files matched your search

+14 -1
View File
@@ -24,7 +24,7 @@
#include "LibAvContextHandle.h"
#ifdef USE_FFMPEG
#include <cstdio>
#include <QtDebug>
@@ -135,6 +135,19 @@ Bool LibAvContextHandle::initAvFormat( QString filename, UInt& width, UInt& heig
video_dst_bufsize = ret;
}
AVCodecContext *in_codec = fmt_ctx->streams[0]->codec;
width = in_codec->width;
height = in_codec->height;
switch( in_codec->pix_fmt )
{
case AV_PIX_FMT_YUV420P:
pixel_format = PlaYUVerFrame::YUV420;
break;
case AV_PIX_FMT_GRAY8:
pixel_format = PlaYUVerFrame::YUV400;
break;
}
/* dump input information to stderr */
av_dump_format( fmt_ctx, 0, src_filename, 0 );
if( !video_stream )