diff --git a/lib/LibAvContextHandle.cpp b/lib/LibAvContextHandle.cpp index f941cf4..20c0617 100644 --- a/lib/LibAvContextHandle.cpp +++ b/lib/LibAvContextHandle.cpp @@ -177,9 +177,9 @@ Bool LibAvContextHandle::initAvFormat( const char* filename, UInt& width, UInt& getMem1D( &m_pchFrameBuffer, m_uiFrameBufferSize ); } - const char *codec_name = avcodec_get_name( video_dec_ctx->codec_id ); - sprintf( m_acCodecName, "%s", codec_name ); - + const char *name = avcodec_get_name( video_dec_ctx->codec_id ); + sprintf( m_acCodecName, "%s", name ); + Double fr = 30; if( video_stream->avg_frame_rate.den && video_stream->avg_frame_rate.num ) fr = av_q2d( video_stream->avg_frame_rate ); diff --git a/lib/LibAvContextHandle.h b/lib/LibAvContextHandle.h index 646c6a6..0f44828 100644 --- a/lib/LibAvContextHandle.h +++ b/lib/LibAvContextHandle.h @@ -75,6 +75,10 @@ public: { return m_bHasStream; } + Char* getFormatName() + { + return m_acFormatName; + } Char* getCodecName() { return m_acCodecName; @@ -101,6 +105,7 @@ private: Bool m_bHasStream; + Char m_acFormatName[20]; Char m_acCodecName[20]; UInt64 m_uiSecs; UInt64 m_uiMicroSec; diff --git a/lib/PlaYUVerDefs.h b/lib/PlaYUVerDefs.h index 7a65276..7f0893d 100644 --- a/lib/PlaYUVerDefs.h +++ b/lib/PlaYUVerDefs.h @@ -126,6 +126,13 @@ inline std::string lowercase( const std::string& in ) return out; } +inline std::string uppercase( const std::string& in ) +{ + std::string out; + transform( in.begin(), in.end(), std::back_inserter( out ), toupper ); + return out; +} + } // NAMESPACE #endif // __PLAYUVERDEFS_H__ diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index cb443fb..d804947 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -159,7 +159,7 @@ Void PlaYUVerStream::findHandler() { if( supportedFmts[i].formatExt == currExt ) { - m_cFormatName = supportedFmts[i].formatExt[i]; + m_cFormatName = uppercase( supportedFmts[i].formatExt ); m_iStreamHandler = FFMPEG; return; } @@ -176,7 +176,7 @@ Void PlaYUVerStream::findHandler() { if( supportedFmts[i].formatExt == currExt ) { - m_cFormatName = supportedFmts[i].formatExt; + m_cFormatName = uppercase( supportedFmts[i].formatExt ); m_iStreamHandler = FFMPEG; return; }