Skip to content

Commit b37684b

Browse files
author
Clement Champetier
committed
pyTest: updated testReader to be able to check video frame > 8bits
1 parent f6f69a9 commit b37684b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/pyTest/testReader.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def testVideoReaderCreateNewInputFile():
2424
# read all frames and check their size
2525
for i in xrange(0, reader.getSourceVideoProperties().getNbFrames()):
2626
frame = av.VideoFrame(reader.readNextFrame())
27-
assert_equals( frame.getSize(), reader.getOutputWidth() * reader.getOutputHeight() * reader.getOutputNbComponents() )
27+
bytesPerPixel = reader.getOutputBitDepth() / 8
28+
assert_equals( frame.getSize(), reader.getOutputWidth() * reader.getOutputHeight() * bytesPerPixel )
2829

2930
# check if the next frame is empty
3031
frame = av.VideoFrame(reader.readNextFrame())
@@ -43,7 +44,8 @@ def testVideoReaderReferenceInputFile():
4344
# read all frames and check their size
4445
for i in xrange(0, reader.getSourceVideoProperties().getNbFrames()):
4546
frame = av.VideoFrame(reader.readNextFrame())
46-
assert_equals( frame.getSize(), reader.getOutputWidth() * reader.getOutputHeight() * reader.getOutputNbComponents() )
47+
bytesPerPixel = reader.getOutputBitDepth() / 8
48+
assert_equals( frame.getSize(), reader.getOutputWidth() * reader.getOutputHeight() * bytesPerPixel )
4749

4850
# check if the next frame is empty
4951
frame = av.VideoFrame(reader.readNextFrame())

0 commit comments

Comments
 (0)