History

Add request_sample_fmt field to AVCodecContext.

This will allow audio decoders to support output of different sample formats as a runtime option.

Justin Ruggles committed 15 years ago

Commit 64150ff1 parent 32f8fb83 files · +14 −1Browse files

Unified · Split

3 files
  1. libavcodec/avcodec.h +7 −0
  2. libavcodec/options.c +6 −0
  3. libavcodec/version.h +1 −1
libavcodec/avcodec.h+7−0
@@ -2836,6 +2836,13 @@ typedef struct AVCodecContext { · 2835 unmodified lines
28362836 * - decoding: Set by libavcodec.
28372837 */
28382838 enum AVAudioServiceType audio_service_type;
2839+
2840+ /**
2841+ * Used to request a sample format from the decoder.
2842+ * - encoding: unused.
2843+ * - decoding: Set by user.
2844+ */
2845+ enum AVSampleFormat request_sample_fmt;
28392846 } AVCodecContext;
28402847
28412848 /**
libavcodec/options.c+6−0
@@ -441,6 +441,12 @@ static const AVOption options[]={ · 440 unmodified lines
441441 {"em", "Emergency", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_EMERGENCY }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
442442 {"vo", "Voice Over", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_VOICE_OVER }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
443443 {"ka", "Karaoke", 0, FF_OPT_TYPE_CONST, {.dbl = AV_AUDIO_SERVICE_TYPE_KARAOKE }, INT_MIN, INT_MAX, A|E, "audio_service_type"},
444+{"request_sample_fmt", NULL, OFFSET(request_sample_fmt), FF_OPT_TYPE_INT, {.dbl = AV_SAMPLE_FMT_NONE }, AV_SAMPLE_FMT_NONE, AV_SAMPLE_FMT_NB-1, A|D, "request_sample_fmt"},
445+{"u8" , "8-bit unsigned integer", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_U8 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
446+{"s16", "16-bit signed integer", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_S16 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
447+{"s32", "32-bit signed integer", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_S32 }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
448+{"flt", "32-bit float", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_FLT }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
449+{"dbl", "64-bit double", 0, FF_OPT_TYPE_CONST, {.dbl = AV_SAMPLE_FMT_DBL }, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
444450 {NULL},
445451 };
446452
libavcodec/version.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #define AVCODEC_VERSION_H
2222
2323 #define LIBAVCODEC_VERSION_MAJOR 53
24−#define LIBAVCODEC_VERSION_MINOR 3
24+#define LIBAVCODEC_VERSION_MINOR 4
2525 #define LIBAVCODEC_VERSION_MICRO 0
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t