Minor fixes in format name to display in the status bar

Fix especially to FFMPEG formats
This commit is contained in:
jfmcarreira committed 2016-03-09 00:49:48 +00:00
1 parent 2cd1c7f269
commit 50d5d397c7
4 files changed
+17 -5

No files matched your search

+3 -3
View File
@@ -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 );
+5
View File
@@ -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;
+7
View File
@@ -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__
+2 -2
View File
@@ -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;
}