mirror of https://github.com/python/cpython.git
Use constants defined in cl module. (Sjoerd)
This commit is contained in:
parent
1e57a04301
commit
1554b7b061
|
@ -345,15 +345,15 @@ def decompress(self, data):
|
||||||
if self.format <> 'compress':
|
if self.format <> 'compress':
|
||||||
return data
|
return data
|
||||||
if not self.decompressor:
|
if not self.decompressor:
|
||||||
import cl, CL
|
import cl
|
||||||
scheme = cl.QueryScheme(self.compressheader)
|
scheme = cl.QueryScheme(self.compressheader)
|
||||||
self.decompressor = cl.OpenDecompressor(scheme)
|
self.decompressor = cl.OpenDecompressor(scheme)
|
||||||
headersize = self.decompressor.ReadHeader(self.compressheader)
|
headersize = self.decompressor.ReadHeader(self.compressheader)
|
||||||
width = self.decompressor.GetParam(CL.IMAGE_WIDTH)
|
width = self.decompressor.GetParam(cl.IMAGE_WIDTH)
|
||||||
height = self.decompressor.GetParam(CL.IMAGE_HEIGHT)
|
height = self.decompressor.GetParam(cl.IMAGE_HEIGHT)
|
||||||
params = [CL.ORIGINAL_FORMAT, CL.RGBX, \
|
params = [cl.ORIGINAL_FORMAT, cl.RGBX, \
|
||||||
CL.ORIENTATION, CL.BOTTOM_UP, \
|
cl.ORIENTATION, cl.BOTTOM_UP, \
|
||||||
CL.FRAME_BUFFER_SIZE, width*height*CL.BytesPerPixel(CL.RGBX)]
|
cl.FRAME_BUFFER_SIZE, width*height*cl.BytesPerPixel(cl.RGBX)]
|
||||||
self.decompressor.SetParams(params)
|
self.decompressor.SetParams(params)
|
||||||
data = self.decompressor.Decompress(1, data)
|
data = self.decompressor.Decompress(1, data)
|
||||||
return data
|
return data
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
import VCR
|
import VCR
|
||||||
try:
|
try:
|
||||||
import cl
|
import cl
|
||||||
import CL
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
cl = None
|
cl = None
|
||||||
|
|
||||||
|
@ -200,10 +199,10 @@ def setdefaults(self):
|
||||||
self.c_rgb24_size.addto_choice(label)
|
self.c_rgb24_size.addto_choice(label)
|
||||||
self.c_rgb24_size.set_choice(self.rgb24_size)
|
self.c_rgb24_size.set_choice(self.rgb24_size)
|
||||||
if cl:
|
if cl:
|
||||||
algs = cl.QueryAlgorithms(CL.VIDEO)
|
algs = cl.QueryAlgorithms(cl.VIDEO)
|
||||||
self.all_comp_schemes = []
|
self.all_comp_schemes = []
|
||||||
for i in range(0, len(algs), 2):
|
for i in range(0, len(algs), 2):
|
||||||
if algs[i+1] in (CL.COMPRESSOR, CL.CODEC):
|
if algs[i+1] in (cl.COMPRESSOR, cl.CODEC):
|
||||||
self.all_comp_schemes.append(algs[i])
|
self.all_comp_schemes.append(algs[i])
|
||||||
self.c_cformat.clear_choice()
|
self.c_cformat.clear_choice()
|
||||||
for label in self.all_comp_schemes:
|
for label in self.all_comp_schemes:
|
||||||
|
@ -778,11 +777,11 @@ def get_aformat(self):
|
||||||
|
|
||||||
def init_compressor(self, w, h):
|
def init_compressor(self, w, h):
|
||||||
self.compressor = None
|
self.compressor = None
|
||||||
scheme = cl.QuerySchemeFromName(CL.VIDEO, self.comp_scheme)
|
scheme = cl.QuerySchemeFromName(cl.VIDEO, self.comp_scheme)
|
||||||
self.compressor = cl.OpenCompressor(scheme)
|
self.compressor = cl.OpenCompressor(scheme)
|
||||||
parambuf = [CL.IMAGE_WIDTH, w, \
|
parambuf = [cl.IMAGE_WIDTH, w, \
|
||||||
CL.IMAGE_HEIGHT, h, \
|
cl.IMAGE_HEIGHT, h, \
|
||||||
CL.ORIGINAL_FORMAT, CL.YUV422DC]
|
cl.ORIGINAL_FORMAT, cl.YUV422DC]
|
||||||
self.compressor.SetParams(parambuf)
|
self.compressor.SetParams(parambuf)
|
||||||
return self.compressor.Compress(0, '')
|
return self.compressor.Compress(0, '')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue