[FFmpeg-cvslog] Add a side data type for audio service type.
Anton Khirnov
git at videolan.org
Tue Jan 27 18:16:17 CET 2015
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Nov 14 12:22:06 2014 +0100| [728685f37ab333ca35980bd01766c78d197f784a] | committer: Anton Khirnov
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=728685f37ab333ca35980bd01766c78d197f784a
---
doc/APIchanges | 4 ++++
libavcodec/avcodec.h | 6 ++++++
libavcodec/utils.c | 1 +
libavcodec/version.h | 2 +-
libavfilter/af_ashowinfo.c | 25 +++++++++++++++++++++++++
libavutil/frame.h | 6 ++++++
libavutil/version.h | 2 +-
7 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index e1bf415..b685866 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2014-08-09
API changes, most recent first:
+2014-11-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.
+
201x-xx-xx - xxxxxxx - lavc 56.10.0 - vdpau.h
Add av_vdpau_get_surface_parameters().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 1abe985..87f3a83 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -917,6 +917,12 @@ enum AVPacketSideDataType {
* Stereoscopic 3D information in form of the AVStereo3D struct.
*/
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,
};
typedef struct AVPacketSideData {
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 27f1039..5493055 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -569,6 +569,7 @@ int ff_decode_frame_props(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 },
};
frame->color_primaries = avctx->color_primaries;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 20904f1..e3168c4 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 11
+#define LIBAVCODEC_VERSION_MINOR 12
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
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;
}
diff --git a/libavutil/frame.h b/libavutil/frame.h
index d3360c4..28170e7 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -87,6 +87,12 @@ enum AVFrameSideDataType {
* in ETSI TS 101 154 using enum AVActiveFormatDescription.
*/
AV_FRAME_DATA_AFD,
+
+ /**
+ * 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 3d973bc..7a7d054 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 54
-#define LIBAVUTIL_VERSION_MINOR 7
+#define LIBAVUTIL_VERSION_MINOR 8
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
More information about the ffmpeg-cvslog
mailing list