Class: UVC::ProcessingUnitDescriptor

Inherits:
ClassSpecificVCInterfaceDescriptor show all
Defined in:
lib/uvc.rb

Defined Under Namespace

Classes: Controls

Instance Attribute Summary collapse

Attributes inherited from ClassSpecificVCInterfaceDescriptor

#bDescriptorSubType, #bDescriptorType, #rest

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ClassSpecificVCInterfaceDescriptor

parse_array

Constructor Details

#initialize(bDescriptorType, bDescriptorSubType, bUnitID, bSourceID, wMaxMultiplier, bControlSize, bmControls, iProcessing, bmVideoStandards) ⇒ ProcessingUnitDescriptor

Returns a new instance of ProcessingUnitDescriptor.



504
505
506
507
508
509
510
511
512
513
# File 'lib/uvc.rb', line 504

def initialize(bDescriptorType, bDescriptorSubType, bUnitID, bSourceID, wMaxMultiplier, bControlSize, bmControls, iProcessing, bmVideoStandards)
	super(bDescriptorType, bDescriptorSubType)
	@bUnitID = bUnitID
	@bSourceID = bSourceID
	@wMaxMultiplier = wMaxMultiplier
	@bControlSize = bControlSize
	@bmControls = Controls.new(bmControls)
	@iProcessing = iProcessing
	@bmVideoStandards = bmVideoStandards
end

Instance Attribute Details

#bControlSizeObject (readonly)

Returns the value of attribute bControlSize.



493
494
495
# File 'lib/uvc.rb', line 493

def bControlSize
  @bControlSize
end

#bmControlsObject (readonly)

Returns the value of attribute bmControls.



494
495
496
# File 'lib/uvc.rb', line 494

def bmControls
  @bmControls
end

#bmVideoStandardsObject (readonly)

Returns the value of attribute bmVideoStandards.



496
497
498
# File 'lib/uvc.rb', line 496

def bmVideoStandards
  @bmVideoStandards
end

#bSourceIDObject (readonly)

Returns the value of attribute bSourceID.



491
492
493
# File 'lib/uvc.rb', line 491

def bSourceID
  @bSourceID
end

#bUnitIDObject (readonly)

Returns the value of attribute bUnitID.



490
491
492
# File 'lib/uvc.rb', line 490

def bUnitID
  @bUnitID
end

#iProcessingObject (readonly)

Returns the value of attribute iProcessing.



495
496
497
# File 'lib/uvc.rb', line 495

def iProcessing
  @iProcessing
end

#wMaxMultiplierObject (readonly)

Returns the value of attribute wMaxMultiplier.



492
493
494
# File 'lib/uvc.rb', line 492

def wMaxMultiplier
  @wMaxMultiplier
end

Class Method Details

.parse(bDescriptorType, bDescriptorSubType, rest) ⇒ Object



498
499
500
501
502
# File 'lib/uvc.rb', line 498

def self.parse(bDescriptorType, bDescriptorSubType, rest)
	bUnitID, bSourceID, wMaxMultiplier, bControlSize, rest = *rest.unpack("ccvca*")
	bmControls, iProcessing, bmVideoStandards = *rest.unpack("B#{bControlSize * 8}cB8")
	self.new(bDescriptorType, bDescriptorSubType, bUnitID, bSourceID, wMaxMultiplier, bControlSize, bmControls, iProcessing, bmVideoStandards)
end

Instance Method Details

#short_inspectObject



571
572
573
574
575
576
577
578
579
# File 'lib/uvc.rb', line 571

def short_inspect
	"%s bUnitID=%d\n  %s" % [
		self.class.name.sub(/Descriptor$/, ''),
		self.bUnitID,
		Controls::BITS.select {|n|
			self.bmControls.send(n)
		}.join("  \n")
	]
end