aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_convert.h2
-rw-r--r--mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_decode.cpp2
-rw-r--r--mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp10
-rw-r--r--mediaplugin/src/mediaplugins/include/core/plugin_core.h36
-rw-r--r--mediaplugin/src/mediaplugins/include/core/util.h2
5 files changed, 28 insertions, 24 deletions
diff --git a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_convert.h b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_convert.h
index ee4c5a81..fbb5bedc 100644
--- a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_convert.h
+++ b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_convert.h
@@ -47,7 +47,7 @@ protected:
bool init() {
// Note: FFmpeg does not support resampling for more than 2 input channels
- if (_srcFormatInfo.getFormat() != asfS16) {
+ if (_srcFormatInfo.getFormat() != AUDIO_SAMPLE_FORMAT_S16) {
logger.error("Unsupported format", "TAudioConverter_FFmpeg.Init");
return false;
}
diff --git a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_decode.cpp b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_decode.cpp
index da49891c..ce15f7a7 100644
--- a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_decode.cpp
+++ b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_audio_decode.cpp
@@ -179,7 +179,7 @@ bool FFmpegAudioDecodeStream::_open(const IPath &filename) {
audioSampleFormat_t sampleFormat;
if (!ffmpegCore->convertFFmpegToAudioFormat(_codecCtx->sample_fmt, &sampleFormat)) {
// try standard format
- sampleFormat = asfS16;
+ sampleFormat = AUDIO_SAMPLE_FORMAT_S16;
}
if (_codecCtx->channels > 255) {
logger.status("Error: _codecCtx->channels > 255", "TFFmpegDecodeStream.Open");
diff --git a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp
index 79f353e1..506387ba 100644
--- a/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp
+++ b/mediaplugin/src/mediaplugins/ffmpeg/ffmpeg_core.cpp
@@ -165,20 +165,20 @@ int MediaCore_FFmpeg::findAudioStreamIndex(AVFormatContext *formatCtx) const {
bool MediaCore_FFmpeg::convertFFmpegToAudioFormat(SampleFormat ffmpegFormat, audioSampleFormat_t *format) const {
switch (ffmpegFormat) {
case SAMPLE_FMT_U8:
- *format = asfU8;
+ *format = AUDIO_SAMPLE_FORMAT_U8;
break;
case SAMPLE_FMT_S16:
- *format = asfS16;
+ *format = AUDIO_SAMPLE_FORMAT_S16;
break;
case SAMPLE_FMT_S32:
- *format = asfS32;
+ *format = AUDIO_SAMPLE_FORMAT_S32;
break;
case SAMPLE_FMT_FLT:
- *format = asfFloat;
+ *format = AUDIO_SAMPLE_FORMAT_FLOAT;
break;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(51,65,0)
case SAMPLE_FMT_DBL:
- *format = asfDouble;
+ *format = AUDIO_SAMPLE_FORMAT_DOUBLE;
break;
#endif
default:
diff --git a/mediaplugin/src/mediaplugins/include/core/plugin_core.h b/mediaplugin/src/mediaplugins/include/core/plugin_core.h
index c7d078b0..69cc7f19 100644
--- a/mediaplugin/src/mediaplugins/include/core/plugin_core.h
+++ b/mediaplugin/src/mediaplugins/include/core/plugin_core.h
@@ -141,26 +141,30 @@ typedef struct pluginCore_t {
} pluginCore_t;
typedef enum audioSampleFormat_t {
- asfUnknown, // unknown format
- asfU8, asfS8, // unsigned/signed 8 bits
- asfU16LSB, asfS16LSB, // unsigned/signed 16 bits (endianness: LSB)
- asfU16MSB, asfS16MSB, // unsigned/signed 16 bits (endianness: MSB)
- asfU16, asfS16, // unsigned/signed 16 bits (endianness: System)
- asfS32, // signed 32 bits (endianness: System)
- asfFloat, // float
- asfDouble // double
+ AUDIO_SAMPLE_FORMAT_UNKNOWN, // unknown format
+ AUDIO_SAMPLE_FORMAT_U8, // unsigned 8 bits
+ AUDIO_SAMPLE_FORMAT_S8, // signed 8 bits
+ AUDIO_SAMPLE_FORMAT_U16LSB, // unsigned 16 bits (endianness: LSB)
+ AUDIO_SAMPLE_FORMAT_S16LSB, // signed 16 bits (endianness: LSB)
+ AUDIO_SAMPLE_FORMAT_U16MSB, // unsigned 16 bits (endianness: MSB)
+ AUDIO_SAMPLE_FORMAT_S16MSB, // signed 16 bits (endianness: MSB)
+ AUDIO_SAMPLE_FORMAT_U16, // unsigned 16 bits (endianness: System)
+ AUDIO_SAMPLE_FORMAT_S16, // signed 16 bits (endianness: System)
+ AUDIO_SAMPLE_FORMAT_S32, // signed 32 bits (endianness: System)
+ AUDIO_SAMPLE_FORMAT_FLOAT, // float
+ AUDIO_SAMPLE_FORMAT_DOUBLE // double
} audioSampleFormat_t;
// Size of one sample (one channel only) in bytes
static const int g_audioSampleSize[] = {
- 0, // asfUnknown
- 1, 1, // asfU8, asfS8
- 2, 2, // asfU16LSB, asfS16LSB
- 2, 2, // asfU16MSB, asfS16MSB
- 2, 2, // asfU16, asfS16
- 3, // asfS24
- 4, // asfS32
- 4, // asfFloat
+ 0, // Unknown
+ 1, 1, // U8, S8
+ 2, 2, // U16LSB, S16LSB
+ 2, 2, // U16MSB, S16MSB
+ 2, 2, // U16, S16
+ 3, // S24
+ 4, // S32
+ 4, // Float
};
typedef struct audioFormatInfo_t {
diff --git a/mediaplugin/src/mediaplugins/include/core/util.h b/mediaplugin/src/mediaplugins/include/core/util.h
index 55c5e93f..ba7ae2a4 100644
--- a/mediaplugin/src/mediaplugins/include/core/util.h
+++ b/mediaplugin/src/mediaplugins/include/core/util.h
@@ -62,7 +62,7 @@ public:
AudioFormatInfo() :
_sampleRate(0),
_channels(0),
- _format(asfUnknown),
+ _format(AUDIO_SAMPLE_FORMAT_UNKNOWN),
_frameSize(0)
{}