Skip to content

Commit

Permalink
test create decoder with different resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
neptune46 committed Feb 3, 2018
1 parent 50db2f6 commit d384e36
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions src/pyva_dx11/test_valib_dx11/test_valib_dx11.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import sys
import uuid
import pyva

Expand Down Expand Up @@ -64,35 +65,39 @@ def getGuidName(x):
return name

def getProfile(profiles):
guids = []
print("#"*16 + " " + sys._getframe().f_code.co_name + " " + "#"*16)
ret = pyva.init()
if ret == 0:
num = pyva.getDecoderProfileCount()
for i in range(num):
guids.append(uuid.UUID(pyva.getDecoderProfile(i)))
pyva.free()

for guid in guids:
profiles.append(getGuidName(guid))
guid = uuid.UUID(pyva.getDecoderProfile(i))
profiles.append(getGuidName(guid))
pyva.free()

for p in profiles:
print(p)

def createDecoder(codec, w, h):
ret = pyva.init()
if ret == 0:
ret = pyva.createDecoder(codec, w, h)
if ret == 0:
print("create video decoder: succeed")
else:
print("create video decoder: failed!")
b = "Success: " if ret == 0 else "Failed: "
print("%s %d, %d" % (b, w, h))
pyva.free()

def testCreateDecoder() :
print("#"*16 + " " + sys._getframe().f_code.co_name + " " + "#"*16)
# res = [(w, h) for w in range(16, 1024, 16) for h in range(16, 1024, 16)]
for w in range(16, 4096, 16) :
for h in range(16, 4096, 16) :
createDecoder("h264", w, h)

if __name__ == "__main__":
# query decode profiles
profiles = []
getProfile(profiles)
print(profiles)

# create video decoder
createDecoder("h264", 1920, 1080)

createDecoder("h264", 4096, 4096)

print("finish")

0 comments on commit d384e36

Please sign in to comment.