diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-28 14:58:30 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-28 14:58:30 +0300 |
commit | b880c13c3aa9e0d00509586224a0b30586ebb594 (patch) | |
tree | 3f63af5ab8fb50adc042df2971556cf96951eb5c /source/blender | |
parent | a33034cc3fd17802ffdd3e87e9958f5539f67bbb (diff) | |
parent | b030277e791e429e8f8de90316144830eda6bbf8 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 20 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 10 |
3 files changed, 33 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 394f4cc1122..9cdb48998a0 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -725,6 +725,26 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, RenderData *rd, int c->sample_fmt = AV_SAMPLE_FMT_S16; c->channels = rd->ffcodecdata.audio_channels; +#ifdef FFMPEG_HAVE_FRAME_CHANNEL_LAYOUT + switch (rd->ffcodecdata.audio_channels) { + case FFM_CHANNELS_MONO: + c->channel_layout = AV_CH_LAYOUT_MONO; + break; + case FFM_CHANNELS_STEREO: + c->channel_layout = AV_CH_LAYOUT_STEREO; + break; + case FFM_CHANNELS_SURROUND4: + c->channel_layout = AV_CH_LAYOUT_QUAD; + break; + case FFM_CHANNELS_SURROUND51: + c->channel_layout = AV_CH_LAYOUT_5POINT1_BACK; + break; + case FFM_CHANNELS_SURROUND71: + c->channel_layout = AV_CH_LAYOUT_7POINT1; + break; + } +#endif + if (request_float_audio_buffer(codec_id)) { /* mainly for AAC codec which is experimental */ c->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 5fe57dd6d1e..73d6249a263 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -136,6 +136,14 @@ typedef enum eFFMpegCrf { FFM_CRF_LOWEST = 32, } eFFMpegCrf; +typedef enum eFFMpegAudioChannels { + FFM_CHANNELS_MONO = 1, + FFM_CHANNELS_STEREO = 2, + FFM_CHANNELS_SURROUND4 = 4, + FFM_CHANNELS_SURROUND51 = 6, + FFM_CHANNELS_SURROUND71 = 8, +} eFFMpegAudioChannels; + typedef struct FFMpegCodecData { int type; int codec; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 2c457aaaa60..3bb098fcd09 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -4345,11 +4345,11 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna) #endif static const EnumPropertyItem audio_channel_items[] = { - {1, "MONO", 0, "Mono", "Set audio channels to mono"}, - {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"}, - {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"}, - {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"}, - {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"}, + {FFM_CHANNELS_MONO, "MONO", 0, "Mono", "Set audio channels to mono"}, + {FFM_CHANNELS_STEREO, "STEREO", 0, "Stereo", "Set audio channels to stereo"}, + {FFM_CHANNELS_SURROUND4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"}, + {FFM_CHANNELS_SURROUND51, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"}, + {FFM_CHANNELS_SURROUND71, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"}, {0, NULL, 0, NULL, NULL} }; |