Minor fixes in format name to display in the status bar
Fix especially to FFMPEG formats
This commit is contained in:
1 parent
15c5bb02e7
commit
6d1ce190ae
4 files changed
+17
-5
No files matched your search
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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__
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user