def _getCaps(self):
bits = struct.calcsize(self.datatype) * 8
if self.datatype in ('f', 'd'):
return gst.Caps('audio/x-raw-float,endianness=%s,width=%d,rate=%d,channels=1' % (self.ENDIANNESS, bits, self.sample_rate))
else:
# In struct module, unsigned types are uppercase, signed are lower
if self.datatype.isupper():
signed = 'false'
else:
signed = 'true'
return gst.Caps('audio/x-raw-int,endianness=%s,signed=%s,width=%d,depth=%d,rate=%d,channels=1' % (self.ENDIANNESS, signed, bits, bits, self.sample_rate))
评论列表
文章目录