private List<Pair<SequenceUUID, Integer>> getChannelsByLayout(FFmpegAudioChannels[] channelsGroup, SoundfieldGroupInfo soundfieldGroup) { return Stream.of(channelsGroup) .map(soundfieldGroup.getChannelsMap()::get) .collect(Collectors.toList()); }
private boolean isGroupUsed(SoundfieldGroupInfo soundfieldGroup) { return soundfieldGroup.getChannelsMap().values().stream() .noneMatch(this::isChannelUsed); }
protected List<SoundfieldGroupInfo> findInputForChannelGroup(FFmpegAudioChannels[] channelsGroup) { List<SoundfieldGroupInfo> result = new ArrayList<>(); for (SoundfieldGroupInfo soundfieldGroupInfo : inputSoundfieldGroups.values()) { Set<FFmpegAudioChannels> inputChannels = soundfieldGroupInfo.getChannelsMap().keySet(); Set<FFmpegAudioChannels> requiredChannels = new HashSet<>(Arrays.asList(channelsGroup)); if (!inputChannels.equals(requiredChannels)) { continue; } result.add(soundfieldGroupInfo); } return result; }
public static void addStereo(AudioMapType audioMapType, int num, SoundfieldGroupInfo stereo) { for (FFmpegAudioChannels channel : STEREO_LAYOUT) { audioMapType.getEBUTrack().add( createEbuTrack(num, stereo.getChannelsMap().get(channel))); num++; } }
public static void add51(AudioMapType audioMapType, int num, SoundfieldGroupInfo fiveOne) { for (FFmpegAudioChannels channel : SURROUND_5_1_LAYOUT) { audioMapType.getEBUTrack().add( createEbuTrack(num, fiveOne.getChannelsMap().get(channel))); num++; } }
protected String getLanguage(SoundfieldGroupInfo info) { String lang = null; for (ImmutablePair<SequenceUUID, Integer> seqInfos : info.getChannelsMap().values()) { SequenceTemplateParameterContext seqContext = contextProvider.getSequenceContext(); ContextInfo contextInfo = new ContextInfoBuilder() .setSequenceType(SequenceType.AUDIO) .setSequenceUuid(seqInfos.getLeft()) .build(); if (!seqContext.hasSequenceParameter(SequenceContextParameters.LANGUAGE, contextInfo)) { return null; } String nextLang = seqContext.getParameterValue(SequenceContextParameters.LANGUAGE, contextInfo); // all sequences from a soundfield group must have the same language! if (lang != null && !lang.equals(nextLang)) { return null; } lang = nextLang; } return lang; }