File

src/interfaces/ICnnControl.ts

Index

Methods

Methods

disable
disable(idleTimeMs?: number)

Disables the cnn feature persistently. The disabled state is persistent on camera reboot/power cycle.

Parameters :
Name Type Optional
idleTimeMs number Yes
Returns : Promise<void>

A void function.

enable
enable(idleTimeMs?: number)

Enables the cnn feature persistently. The enable state is persistent on camera reboot/power cycle.

Parameters :
Name Type Optional
idleTimeMs number Yes
Returns : Promise<void>

A void function.

init
init()

Convenience function for setting up the camera for starting/stopping cnn feature. Should be called before any other methods.

resolves in case the cnn feature init is completed otherwise it rejects with a rejection message!

Returns : Promise<any>

Returns a promise which resolves in case the cnn feature init is completed otherwise it rejects with a rejection message!

isEnabled
isEnabled()

Checks if cnn feature is enabled on the camera. Returns true if yes, false otherwise.

false if disabled.

Returns : Promise<Boolean>

Returns a promise which resolves to true if cnn features is enabled false if disabled.

ICnnControl Interface

Genius Framing Controller

Below you can find an example on how to get started with Genius Framing (GF) on Huddly cameras that support the feature. Follow the steps below to enable or disable GF:

...
// We assume the sdk has been initialized and camera manager instance acquired
...

/**
 * Get an autozoom control instance from the initialized camera manager.
 * For custom autozoom, `getAutozoomControl` accepts some options which are
 * documented on the `IAutozoomControlOpts` interface.
 */
const autozoomCtrl = cameraManager.getAutozoomControl();

// Always call init before doing anything
await autozoomCtrl.init();

/* Enable autozoom cnn feature on the camera (persistent across camera booting) */
await autozoomCtrl.enable();

...
// Your code goes here
...

/* Disable autozoom cnn feature on the camera (persistent across camera booting) */
await autozoomCtrl.disable();

NOTE: For subscribing for detection and/or framing events you need to use the Detector class.

Portrait Lightning Controller

In a similar way to Genius Framing controller, Portrait Lightning also implements ICnnController and can be used to toggle the feature as needed. Below is a code snippet on how to do it.

const portraitLightningCtrl = cameraManager.getFaceBasedExposureControl();

// Always call init before doing anything
await portraitLightningCtrl.init();

/* Enable Portrait Lightning cnn feature on the camera (persistent across camera booting) */
await portraitLightningCtrl.enable();

...
// Your code goes here
...

/* Disable Portrait Lightning cnn feature on the camera (persistent across camera booting) */
await portraitLightningCtrl.disable();

export default interface ICnnControl {
  /**
   * Convenience function for setting up the camera
   * for starting/stopping cnn feature.
   * Should be called before any other methods.
   *
   * @returns {Promise<any>} Returns a promise which
   * resolves in case the cnn feature init is completed
   * otherwise it rejects with a rejection message!
   * @memberof ICnnControl
   */
  init(): Promise<any>;

  /**
   * Enables the cnn feature persistently. The enable state
   * is persistent on camera reboot/power cycle.
   *
   * @returns {Promise<void>} A void function.
   * @memberof ICnnControl
   */
  enable(idleTimeMs?: number): Promise<void>;

  /**
   * Disables the cnn feature persistently. The disabled state
   * is persistent on camera reboot/power cycle.
   *
   * @returns {Promise<void>} A void function.
   * @memberof ICnnControl
   */
  disable(idleTimeMs?: number): Promise<void>;

  /**
   * Checks if cnn feature is enabled on the camera. Returns true if yes, false otherwise.
   *
   * @returns {Promise<Boolean} Returns a promise which resolves to true if cnn features is enabled
   * false if disabled.
   */
  isEnabled(): Promise<Boolean>;
}

results matching ""

    No results matching ""