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

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; ...@@ -191,6 +191,24 @@ typedef uint32_t vlc_fourcc_t;
#endif #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 * Classes declaration
*****************************************************************************/ *****************************************************************************/
......
...@@ -1905,7 +1905,10 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic ) ...@@ -1905,7 +1905,10 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_subpic )
if( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') && if( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') &&
p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') ) p_region->fmt.i_chroma != VLC_FOURCC('Y','U','V','P') )
{ {
msg_Err( p_enc, "chroma not supported" ); 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; return NULL;
} }
......
Markdown is supported
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