mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 10:30:05 +01:00
Implement av_get_codec_tag_string() and use it in ffprobe.
Originally committed as revision 23421 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -802,6 +802,21 @@ static int get_bit_rate(AVCodecContext *ctx)
|
||||
return bit_rate;
|
||||
}
|
||||
|
||||
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
|
||||
{
|
||||
int i, len, ret = 0;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
len = snprintf(buf, buf_size,
|
||||
isprint(codec_tag&0xFF) ? "%c" : "[%d]", codec_tag&0xFF);
|
||||
buf += len;
|
||||
buf_size = buf_size > len ? buf_size - len : 0;
|
||||
ret += len;
|
||||
codec_tag>>=8;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
||||
{
|
||||
const char *codec_name;
|
||||
|
||||
Reference in New Issue
Block a user