[FFmpeg-devel] [PATCH 03/11] Implement av_get_codec_tag_string() and use it in ffprobe.

Baptiste Coudurier baptiste.coudurier
Wed Jun 2 00:09:29 CEST 2010


On 05/22/2010 08:58 AM, Stefano Sabatini wrote:
> [...]
>
> +const char *av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
> +{
> +    int i, fourcc[4];
> +    fourcc[0] = codec_tag&  0xff;
> +    fourcc[1] = codec_tag>>8&  0xff;
> +    fourcc[2] = codec_tag>>16&  0xff;
> +    fourcc[3] = codec_tag>>24&  0xff;
> +
> +    buf[0] = 0;
> +    for (i = 0; i<  4; i++) {
> +        if (isprint(fourcc[i])) av_strlcatf(buf, buf_size,  "%c" , fourcc[i]);
> +        else                    av_strlcatf(buf, buf_size, "[%d]", fourcc[i]);
> +    }
> +    return buf;
> +}
> +

[...]

av_log(NULL, AV_LOG_INFO, "%.4s\n", (char*)&codec_tag)); :))))


-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list