diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-11-14 12:22:06 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-01-27 09:17:48 +0100 |
commit | 728685f37ab333ca35980bd01766c78d197f784a (patch) | |
tree | a7a8cb43ab86dd21d5df02d64b312c96a9ca240b /libavfilter/af_ashowinfo.c | |
parent | 80a11de7dca315505bf203ce9c8c016e71724fd2 (diff) | |
download | ffmpeg-streaming-728685f37ab333ca35980bd01766c78d197f784a.zip ffmpeg-streaming-728685f37ab333ca35980bd01766c78d197f784a.tar.gz |
Add a side data type for audio service type.
Currently, audio service type is a field in AVCodecContext. However,
side data is more appropriate for this kind of information.
Diffstat (limited to 'libavfilter/af_ashowinfo.c')
-rw-r--r-- | libavfilter/af_ashowinfo.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c index 57120c1..a91d7ac 100644 --- a/libavfilter/af_ashowinfo.c +++ b/libavfilter/af_ashowinfo.c @@ -157,6 +157,30 @@ static void dump_replaygain(AVFilterContext *ctx, AVFrameSideData *sd) print_peak(ctx, "album peak", rg->album_peak); } +static void dump_audio_service_type(AVFilterContext *ctx, AVFrameSideData *sd) +{ + enum AVAudioServiceType *ast; + + av_log(ctx, AV_LOG_INFO, "audio service type: "); + if (sd->size < sizeof(*ast)) { + av_log(ctx, AV_LOG_INFO, "invalid data"); + return; + } + ast = (enum AVAudioServiceType*)sd->data; + switch (*ast) { + case AV_AUDIO_SERVICE_TYPE_MAIN: av_log(ctx, AV_LOG_INFO, "Main Audio Service"); break; + case AV_AUDIO_SERVICE_TYPE_EFFECTS: av_log(ctx, AV_LOG_INFO, "Effects"); break; + case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED: av_log(ctx, AV_LOG_INFO, "Visually Impaired"); break; + case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED: av_log(ctx, AV_LOG_INFO, "Hearing Impaired"); break; + case AV_AUDIO_SERVICE_TYPE_DIALOGUE: av_log(ctx, AV_LOG_INFO, "Dialogue"); break; + case AV_AUDIO_SERVICE_TYPE_COMMENTARY: av_log(ctx, AV_LOG_INFO, "Commentary"); break; + case AV_AUDIO_SERVICE_TYPE_EMERGENCY: av_log(ctx, AV_LOG_INFO, "Emergency"); break; + case AV_AUDIO_SERVICE_TYPE_VOICE_OVER: av_log(ctx, AV_LOG_INFO, "Voice Over"); break; + case AV_AUDIO_SERVICE_TYPE_KARAOKE: av_log(ctx, AV_LOG_INFO, "Karaoke"); break; + default: av_log(ctx, AV_LOG_INFO, "unknown"); break; + } +} + static void dump_unknown(AVFilterContext *ctx, AVFrameSideData *sd) { av_log(ctx, AV_LOG_INFO, "unknown side data type: %d, size %d bytes", sd->type, sd->size); @@ -208,6 +232,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) case AV_FRAME_DATA_MATRIXENCODING: dump_matrixenc (ctx, sd); break; case AV_FRAME_DATA_DOWNMIX_INFO: dump_downmix (ctx, sd); break; case AV_FRAME_DATA_REPLAYGAIN: dump_replaygain(ctx, sd); break; + case AV_FRAME_DATA_AUDIO_SERVICE_TYPE: dump_audio_service_type(ctx, sd); break; default: dump_unknown (ctx, sd); break; } |