public static TemplateParameterContextProvider createContext(int audioSeqCount, int segmCount, int resourceCount, FFmpegAudioChannels[][] channelsForSeq, String[] soundfieldGroups, String[] langs) throws Exception { return createContext(audioSeqCount, segmCount, resourceCount, channelsForSeq, soundfieldGroups, null, langs); }
public static TemplateParameterContextProvider createContext(int audioSeqCount, FFmpegAudioChannels[][] channelsForSeq) throws Exception { return createContext(audioSeqCount, channelsForSeq, null); }
public static TemplateParameterContextProvider createContext(int audioSeqCount, FFmpegAudioChannels[][] channelsForSeq, String[] langs) throws Exception { return createContext(audioSeqCount, 1, 1, channelsForSeq, langs); }
public static TemplateParameterContextProvider createContext(FFmpegAudioChannels[][] channelsForSeq) throws Exception { return createContext(channelsForSeq, null); }
public static TemplateParameterContextProvider createContext(FFmpegAudioChannels[][] channelsForSeq, String[] langs) throws Exception { return createContext(channelsForSeq.length, channelsForSeq, langs); }
public static TemplateParameterContextProvider createContext(int audioSeqCount, int segmCount, int resourceCount, FFmpegAudioChannels[][] channelsForSeq) throws Exception { return createContext(audioSeqCount, segmCount, resourceCount, channelsForSeq, null); }
@Test public void testGuessNoMainAudio() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FC}, {FL, FR, FC, LFE, SL, SR}, {FC} }, new String[]{"fr", "en", "en", "en"}); ChannelsMapper mapper = new ChannelsMapper(contextProvider); assertTrue(mapper.guessMainAudio("es").isEmpty()); }
@Test public void testGuessNoAlternativeAudios() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FC}, {FL, FR}, {FC}, {FL, FR, FC, LFE, SL, SR} }, new String[]{"fr", "en", "en", "de"}); ChannelsMapper mapper = new ChannelsMapper(contextProvider); assertTrue(mapper.guessAlternatives("en").isEmpty()); }
@Test public void testNoAudio() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ }); ChannelsMapper mapper = new ChannelsMapper(contextProvider); mapper.mapChannels(createLayoutOptions(new LayoutType[]{SURROUND}, new String[]{"en"})); assertTrue(mapper.resultChannels.isEmpty()); }
@Test public void testLanguageNotFoundByRegion() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FC} }, new String[]{"", "en-GB", "de"}); ChannelsMapper mapper = new ChannelsMapper(contextProvider); mapper.mapChannels(createLayoutOptions(new LayoutType[]{SURROUND}, new String[]{"en"})); assertTrue(mapper.getChannels(Pair.of(SURROUND, "en")).isEmpty()); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_two51_noLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} } ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_threeStereo_sameLang_23() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR} }, new String[]{"en", "ru", "ru"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_threeStereo_sameLang_13() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR} }, new String[]{"en", "ru", "en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess2A_noStereo() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }); new AudioMapGuesser(contextProvider, EBU_R_48_2_A).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_two51_oneLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} }, new String[]{"en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_one51() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }, new String[]{"en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void check_noChannelLayout_forAll() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(4, new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void checkAllResourcesDifferentChannelLayout() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(2, 2, 2, new FFmpegAudioChannels[][]{ {FL, FR}, {FL}, {FL, FR}, {FL, FR}, {FL, FR, FC, LFE, SL, SR}, {SL, SR, FC, LFE, FL, FR}, {LFE, SL, SR, FL, FR, FC,}, {FC} }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); } }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess4BC_noStereo() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }); new AudioMapGuesser(contextProvider, EBU_R_123_4_B).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16C_no51() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR} }); new AudioMapGuesser(contextProvider, EBU_R_123_16_C).guessAudioMap(); }