Commit 46f671ee authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Paul Saman

Backport of [21787]: Get human readible string from a vlc_fourcc_t.

parent 5296de80
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998-2005 the VideoLAN team
* $Id$
* $Id: 47038af022b63418ff42884b90a010117fe49204 $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -193,6 +193,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
*****************************************************************************/
......
......@@ -1790,7 +1790,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') &&
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, 5);
vlc_fourcc_to_char( p_region->fmt.i_chroma, &psz_fourcc );
msg_Err( p_enc, "chroma %4s not supported", &psz_fourcc );
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