|
43 | 43 | SINE_MONO_S32, |
44 | 44 | SINE_MONO_S32_44100, |
45 | 45 | SINE_MONO_S32_8000, |
| 46 | + supports_approximate_mode, |
46 | 47 | TEST_SRC_2_720P, |
47 | 48 | TEST_SRC_2_720P_H265, |
48 | 49 | TEST_SRC_2_720P_MPEG4, |
@@ -1469,10 +1470,7 @@ def test_get_frames_at_tensor_indices(self): |
1469 | 1470 | def test_beta_cuda_interface_get_frame_at( |
1470 | 1471 | self, asset, contiguous_indices, seek_mode |
1471 | 1472 | ): |
1472 | | - if ( |
1473 | | - asset in (AV1_VIDEO, TEST_SRC_2_720P_VP9, TEST_SRC_2_720P_VP8) |
1474 | | - and seek_mode == "approximate" |
1475 | | - ): |
| 1473 | + if seek_mode == "approximate" and not supports_approximate_mode(asset): |
1476 | 1474 | pytest.skip("asset doesn't work with approximate mode") |
1477 | 1475 |
|
1478 | 1476 | ref_decoder = VideoDecoder(asset.path, device="cuda", seek_mode=seek_mode) |
@@ -1518,10 +1516,7 @@ def test_beta_cuda_interface_get_frame_at( |
1518 | 1516 | def test_beta_cuda_interface_get_frames_at( |
1519 | 1517 | self, asset, contiguous_indices, seek_mode |
1520 | 1518 | ): |
1521 | | - if ( |
1522 | | - asset in (AV1_VIDEO, TEST_SRC_2_720P_VP9, TEST_SRC_2_720P_VP8) |
1523 | | - and seek_mode == "approximate" |
1524 | | - ): |
| 1519 | + if seek_mode == "approximate" and not supports_approximate_mode(asset): |
1525 | 1520 | pytest.skip("asset doesn't work with approximate mode") |
1526 | 1521 |
|
1527 | 1522 | ref_decoder = VideoDecoder(asset.path, device="cuda", seek_mode=seek_mode) |
@@ -1565,10 +1560,7 @@ def test_beta_cuda_interface_get_frames_at( |
1565 | 1560 | ) |
1566 | 1561 | @pytest.mark.parametrize("seek_mode", ("exact", "approximate")) |
1567 | 1562 | def test_beta_cuda_interface_get_frame_played_at(self, asset, seek_mode): |
1568 | | - if ( |
1569 | | - asset in (AV1_VIDEO, TEST_SRC_2_720P_VP9, TEST_SRC_2_720P_VP8) |
1570 | | - and seek_mode == "approximate" |
1571 | | - ): |
| 1563 | + if seek_mode == "approximate" and not supports_approximate_mode(asset): |
1572 | 1564 | pytest.skip("asset doesn't work with approximate mode") |
1573 | 1565 |
|
1574 | 1566 | ref_decoder = VideoDecoder(asset.path, device="cuda", seek_mode=seek_mode) |
@@ -1609,10 +1601,7 @@ def test_beta_cuda_interface_get_frame_played_at(self, asset, seek_mode): |
1609 | 1601 | ) |
1610 | 1602 | @pytest.mark.parametrize("seek_mode", ("exact", "approximate")) |
1611 | 1603 | def test_beta_cuda_interface_get_frames_played_at(self, asset, seek_mode): |
1612 | | - if ( |
1613 | | - asset in (AV1_VIDEO, TEST_SRC_2_720P_VP9, TEST_SRC_2_720P_VP8) |
1614 | | - and seek_mode == "approximate" |
1615 | | - ): |
| 1604 | + if seek_mode == "approximate" and not supports_approximate_mode(asset): |
1616 | 1605 | pytest.skip("asset doesn't work with approximate mode") |
1617 | 1606 |
|
1618 | 1607 | ref_decoder = VideoDecoder(asset.path, device="cuda", seek_mode=seek_mode) |
@@ -1654,10 +1643,7 @@ def test_beta_cuda_interface_get_frames_played_at(self, asset, seek_mode): |
1654 | 1643 | ) |
1655 | 1644 | @pytest.mark.parametrize("seek_mode", ("exact", "approximate")) |
1656 | 1645 | def test_beta_cuda_interface_backwards(self, asset, seek_mode): |
1657 | | - if ( |
1658 | | - asset in (AV1_VIDEO, TEST_SRC_2_720P_VP9, TEST_SRC_2_720P_VP8) |
1659 | | - and seek_mode == "approximate" |
1660 | | - ): |
| 1646 | + if seek_mode == "approximate" and not supports_approximate_mode(asset): |
1661 | 1647 | pytest.skip("asset doesn't work with approximate mode") |
1662 | 1648 |
|
1663 | 1649 | ref_decoder = VideoDecoder(asset.path, device="cuda", seek_mode=seek_mode) |
|
0 commit comments