Commit 9a21bac2 authored by Jean-Paul Saman's avatar Jean-Paul Saman
Browse files

Add function to get a human readible string for a vlc_fourcc_t value.

parent 7b19600d
......@@ -191,6 +191,24 @@ typedef uint32_t vlc_fourcc_t;
#endif
static inline void __vlc_fourcc_to_char( vlc_fourcc_t fcc, char *psz_fourcc )
{
#ifdef WORDS_BIGENDIAN
psz_fourcc[0] = (uint32_t) (fcc >> 24);
psz_fourcc[1] = (uint32_t) (fcc >> 16);
psz_fourcc[2] = (uint32_t) (fcc >> 8);
psz_fourcc[3] = (uint32_t) (fcc);
#else
psz_fourcc[3] = (uint32_t) (fcc >> 24);
psz_fourcc[2] = (uint32_t) (fcc >> 16);
psz_fourcc[1] = (uint32_t) (fcc >> 8);
psz_fourcc[0] = (uint32_t) (fcc);
#endif
}
#define vlc_fourcc_to_char( a, b ) \
__vlc_fourcc_to_char( (vlc_fourcc_t)(a), (char *)(b) )
/*****************************************************************************
* Classes declaration
*****************************************************************************/
......
......@@ -1905,8 +1905,11 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
if( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') &&
p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') )
{
msg_Err( p_enc, "chroma not supported" );
return NULL;
char psz_fourcc[5];
memset( &psz_fourcc, 0, sizeof(char)*5 );
vlc_fourcc_to_char( p_region->fmt.i_chroma, &psz_fourcc );
msg_Err( p_enc, "chroma %4s not supported", &psz_fourcc );
return NULL;
}
if( p_region->fmt.p_palette )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment