Add a new sample file to assets, which has increasing timestamps.
Re-enable tests that have no muxer support for timestamps going backwards. Tests running on the B-frame sample will be added in a future commit. #mse-bug-week PiperOrigin-RevId: 429599177
This commit is contained in:
parent
ad35995d54
commit
d7adb94669
Binary file not shown.
@ -40,6 +40,8 @@ import org.json.JSONObject;
|
|||||||
/** Utilities for instrumentation tests. */
|
/** Utilities for instrumentation tests. */
|
||||||
public final class AndroidTestUtil {
|
public final class AndroidTestUtil {
|
||||||
public static final String MP4_ASSET_URI_STRING = "asset:///media/mp4/sample.mp4";
|
public static final String MP4_ASSET_URI_STRING = "asset:///media/mp4/sample.mp4";
|
||||||
|
public static final String MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING =
|
||||||
|
"asset:///media/mp4/sample_with_increasing_timestamps.mp4";
|
||||||
public static final String SEF_ASSET_URI_STRING = "asset:///media/mp4/sample_sef_slow_motion.mp4";
|
public static final String SEF_ASSET_URI_STRING = "asset:///media/mp4/sample_sef_slow_motion.mp4";
|
||||||
public static final String REMOTE_MP4_10_SECONDS_URI_STRING =
|
public static final String REMOTE_MP4_10_SECONDS_URI_STRING =
|
||||||
"https://storage.googleapis.com/exoplayer-test-media-1/mp4/android-screens-10s.mp4";
|
"https://storage.googleapis.com/exoplayer-test-media-1/mp4/android-screens-10s.mp4";
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package androidx.media3.transformer.mh;
|
package androidx.media3.transformer.mh;
|
||||||
|
|
||||||
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
|
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING;
|
||||||
import static androidx.media3.transformer.AndroidTestUtil.runTransformer;
|
import static androidx.media3.transformer.AndroidTestUtil.runTransformer;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import androidx.media3.common.util.Log;
|
|
||||||
import androidx.media3.common.util.Util;
|
|
||||||
import androidx.media3.transformer.Transformer;
|
import androidx.media3.transformer.Transformer;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
@ -35,19 +33,13 @@ public class RemoveAudioTransformationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void removeAudioTransform() throws Exception {
|
public void removeAudioTransform() throws Exception {
|
||||||
if (Util.SDK_INT < 25) {
|
|
||||||
// TODO(b/210593256): Remove test skipping after removing the MediaMuxer dependency.
|
|
||||||
Log.i(TAG, "Skipping on this API version due to lack of muxing support");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Context context = ApplicationProvider.getApplicationContext();
|
Context context = ApplicationProvider.getApplicationContext();
|
||||||
Transformer transformer = new Transformer.Builder(context).setRemoveAudio(true).build();
|
Transformer transformer = new Transformer.Builder(context).setRemoveAudio(true).build();
|
||||||
runTransformer(
|
runTransformer(
|
||||||
context,
|
context,
|
||||||
/* testId= */ "removeAudioTransform",
|
/* testId= */ "removeAudioTransform",
|
||||||
transformer,
|
transformer,
|
||||||
MP4_ASSET_URI_STRING,
|
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING,
|
||||||
/* timeoutSeconds= */ 120);
|
/* timeoutSeconds= */ 120);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package androidx.media3.transformer.mh;
|
package androidx.media3.transformer.mh;
|
||||||
|
|
||||||
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
|
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING;
|
||||||
import static androidx.media3.transformer.AndroidTestUtil.runTransformer;
|
import static androidx.media3.transformer.AndroidTestUtil.runTransformer;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import androidx.media3.common.util.Log;
|
|
||||||
import androidx.media3.common.util.Util;
|
|
||||||
import androidx.media3.transformer.Transformer;
|
import androidx.media3.transformer.Transformer;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
@ -35,19 +33,13 @@ public class TransformationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void transform() throws Exception {
|
public void transform() throws Exception {
|
||||||
if (Util.SDK_INT < 25) {
|
|
||||||
// TODO(b/210593256): Remove test skipping after removing the MediaMuxer dependency.
|
|
||||||
Log.i(TAG, "Skipping on this API version due to lack of muxing support");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Context context = ApplicationProvider.getApplicationContext();
|
Context context = ApplicationProvider.getApplicationContext();
|
||||||
Transformer transformer = new Transformer.Builder(context).build();
|
Transformer transformer = new Transformer.Builder(context).build();
|
||||||
runTransformer(
|
runTransformer(
|
||||||
context,
|
context,
|
||||||
/* testId= */ "transform",
|
/* testId= */ "transform",
|
||||||
transformer,
|
transformer,
|
||||||
MP4_ASSET_URI_STRING,
|
MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING,
|
||||||
/* timeoutSeconds= */ 120);
|
/* timeoutSeconds= */ 120);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user