1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 package org.mozilla.gecko.media;
6 
7 import android.os.Build;
8 
9 import java.io.IOException;
10 
11 public final class AsyncCodecFactory {
create(String name)12     public static AsyncCodec create(String name) throws IOException {
13         // A bug that getInputBuffer() could fail after flush() then start() wasn't fixed until MR1.
14         // See: https://android.googlesource.com/platform/frameworks/av/+/d9e0603a1be07dbb347c55050c7d4629ea7492e8
15         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1
16                ? new LollipopAsyncCodec(name)
17                : new JellyBeanAsyncCodec(name);
18     }
19 }
20