summaryrefslogtreecommitdiff
path: root/libardrone/test_h264_decoder.py
blob: 1107fd70ddec6676fbe556e315bae4c98dbe3e78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import paveparser
import mock
import h264decoder
import os


def test_h264_decoder():
    outfileobj = mock.Mock()
    decoder = h264decoder.H264Decoder(outfileobj)
    example_video_stream = open(os.path.join(os.path.dirname(__file__), 'paveparser.output'))
    while True:
        data = example_video_stream.read(1000)
        if len(data) == 0:
            break
        decoder.write(data)

    assert outfileobj.image_ready.called