-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose discard, trusted and disposable packet flags
--------- Co-authored-by: Scott Kirklin <[email protected]> Co-authored-by: WyattBlue <[email protected]> Co-authored-by: JoeUgly <[email protected]>
- Loading branch information
1 parent
ac0353d
commit 9ad1d91
Showing
4 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import av | ||
|
||
from .common import TestCase, fate_suite | ||
|
||
|
||
class TestProperties(TestCase): | ||
def test_is_keyframe(self): | ||
with av.open(fate_suite("h264/interlaced_crop.mp4")) as container: | ||
stream = container.streams.video[0] | ||
for i, packet in enumerate(container.demux(stream)): | ||
if i in (0, 21, 45, 69, 93, 117): | ||
self.assertTrue(packet.is_keyframe) | ||
else: | ||
self.assertFalse(packet.is_keyframe) | ||
|
||
def test_is_corrupt(self): | ||
with av.open(fate_suite("mov/white_zombie_scrunch-part.mov")) as container: | ||
stream = container.streams.video[0] | ||
for i, packet in enumerate(container.demux(stream)): | ||
if i == 65: | ||
self.assertTrue(packet.is_corrupt) | ||
else: | ||
self.assertFalse(packet.is_corrupt) | ||
|
||
def test_is_discard(self): | ||
with av.open(fate_suite("mov/mov-1elist-ends-last-bframe.mov")) as container: | ||
stream = container.streams.video[0] | ||
for i, packet in enumerate(container.demux(stream)): | ||
if i == 46: | ||
self.assertTrue(packet.is_discard) | ||
else: | ||
self.assertFalse(packet.is_discard) | ||
|
||
def test_is_disposable(self): | ||
with av.open(fate_suite("hap/HAPQA_NoSnappy_127x1.mov")) as container: | ||
stream = container.streams.video[0] | ||
for i, packet in enumerate(container.demux(stream)): | ||
if i == 0: | ||
self.assertTrue(packet.is_disposable) | ||
else: | ||
self.assertFalse(packet.is_disposable) |