diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-27 18:02:42 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-01-27 18:03:43 +0100 |
commit | 62a82c66cd3f03e045867471c5edcc84b4d2b54e (patch) | |
tree | ed8a8d99a235f959088b28fe131c6c4e5fcbe610 | |
parent | b44456c908965231160f9b8f88de8c0dc447aa1f (diff) | |
parent | 728685f37ab333ca35980bd01766c78d197f784a (diff) | |
download | ffmpeg-62a82c66cd3f03e045867471c5edcc84b4d2b54e.tar.gz |
Merge commit '728685f37ab333ca35980bd01766c78d197f784a'
* commit '728685f37ab333ca35980bd01766c78d197f784a':
Add a side data type for audio service type.
Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/version.h
libavutil/frame.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/APIchanges | 4 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 6 | ||||
-rw-r--r-- | libavcodec/utils.c | 1 | ||||
-rw-r--r-- | libavcodec/version.h | 2 | ||||
-rw-r--r-- | libavfilter/af_ashowinfo.c | 25 | ||||
-rw-r--r-- | libavutil/frame.h | 6 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
7 files changed, 44 insertions, 2 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 2720a58fcd..65fd599c45 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,10 @@ libavutil: 2014-08-09 API changes, most recent first: +2015-01-xx - xxxxxxx - lavc 56.12.0, lavu 54.8.0 - avcodec.h, frame.h + Add AV_PKT_DATA_AUDIO_SERVICE_TYPE and AV_FRAME_DATA_AUDIO_SERVICE_TYPE for + storing the audio service type as side data. + 2015-01-11 - 007c33d - lavd 56.4.100 - avdevice.h Add avdevice_list_input_sources(). Add avdevice_list_output_sinks(). diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 5c21430ba1..87b53a2840 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1032,6 +1032,12 @@ enum AVPacketSideDataType { AV_PKT_DATA_STEREO3D, /** + * This side data should be associated with an audio stream and corresponds + * to enum AVAudioServiceType. + */ + AV_PKT_DATA_AUDIO_SERVICE_TYPE, + + /** * Recommmends skipping the specified number of samples * @code * u32le number of samples to skip from start of this packet diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e18ed2d751..df4f6e68ae 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -746,6 +746,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) { AV_PKT_DATA_REPLAYGAIN , AV_FRAME_DATA_REPLAYGAIN }, { AV_PKT_DATA_DISPLAYMATRIX, AV_FRAME_DATA_DISPLAYMATRIX }, { AV_PKT_DATA_STEREO3D, AV_FRAME_DATA_STEREO3D }, + { AV_PKT_DATA_AUDIO_SERVICE_TYPE, AV_FRAME_DATA_AUDIO_SERVICE_TYPE }, }; if (pkt) { diff --git a/libavcodec/version.h b/libavcodec/version.h index eafa12d43c..dfb95e098f 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 56 -#define LIBAVCODEC_VERSION_MINOR 20 +#define LIBAVCODEC_VERSION_MINOR 21 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c index 0e6c6c06f5..26e4f1ff95 100644 --- a/libavfilter/af_ashowinfo.c +++ b/libavfilter/af_ashowinfo.c @@ -142,6 +142,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); @@ -200,6 +224,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; } diff --git a/libavutil/frame.h b/libavutil/frame.h index d335bee831..1e296521ff 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -106,6 +106,12 @@ enum AVFrameSideDataType { * @endcode */ AV_FRAME_DATA_SKIP_SAMPLES, + + /** + * This side data must be associated with an audio frame and corresponds to + * enum AVAudioServiceType defined in avcodec.h. + */ + AV_FRAME_DATA_AUDIO_SERVICE_TYPE, }; enum AVActiveFormatDescription { diff --git a/libavutil/version.h b/libavutil/version.h index 8be61e356f..053bd990d1 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -56,7 +56,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 54 -#define LIBAVUTIL_VERSION_MINOR 17 +#define LIBAVUTIL_VERSION_MINOR 18 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |