VM Maker: VMMaker.oscog-eem.2956.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2956.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2956.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2956
Author: eem
Time: 18 April 2021, 4:31:24.673307 pm
UUID: e051588b-16be-45e6-b68e-c95c85a3db6f
Ancestors: VMMaker.oscog-eem.2955

CameraPlugin: add primAcknowledgeFrame for simple use of the primSetCameraBuffers interface.

=============== Diff against VMMaker.oscog-eem.2955 ===============

Item was added:
+ ----- Method: CameraPlugin>>primAcknowledgeFrame (in category 'primitives') -----
+ primAcknowledgeFrame
+ "Acknowledge the receipt of one or more buffered frames, installed via primSetCameraBuffers.
+ Answer the number of times a buffer was filled since the last invocation.  This is a version of
+ primGetFrame that does not need to supply a buffer to receiver the result."
+ <export: true>
+ | cameraNum result |
+
+ cameraNum := interpreterProxy stackValue: 0.
+ (interpreterProxy isIntegerObject: cameraNum) ifFalse:
+ [^interpreterProxy primitiveFailFor: PrimErrBadArgument].
+
+ result := self Camera: cameraNum Get: 0 Frame: 0.
+ result < 0 ifTrue:
+ [^interpreterProxy primitiveFailFor: result negated].
+
+ interpreterProxy methodReturnInteger: result!

Item was changed:
  ----- Method: CameraPlugin>>primOpenCamera (in category 'primitives') -----
  primOpenCamera
+ "Open a camera. Takes one argument, the index of the device to open.
+ CameraOpen should choose the default size for the device if both desiredFrameWidth
+ and desiredFrameHeight are zero, and the closest to the non-zero value(s) if either or both
+ of desiredFrameWidth and desiredFrameHeight are non-zero."
- "Open a camera. Takes one argument, the index of the device to open."
 
  <export: true>
  | cameraNum desiredFrameWidth desiredFrameHeight ok |
 
  cameraNum := interpreterProxy stackIntegerValue: 2.
  desiredFrameWidth := interpreterProxy stackIntegerValue: 1.
  desiredFrameHeight := interpreterProxy stackIntegerValue: 0.
  interpreterProxy failed ifTrue: [^0].
 
  ok := self CameraOpen: cameraNum _: desiredFrameWidth _: desiredFrameHeight.
  ok <= 0 ifTrue:
  [interpreterProxy success: false.
  ^0].
 
  interpreterProxy methodReturnReceiver!