DJICameraDelegate
@protocol DJICameraDelegate <NSObject>
This protocol provides delegate methods to receive the updated video data, camera’s current state and lens information.
-
Video data update callback. H.264 (also called MPEG-4 Part 10 Advanced Video Coding or MPEG-4 AVC) is a video coding format that is currently one of the most commonly used formats for the recording, compression, and distribution of video content.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didReceiveVideoData:(nonnull uint8_t *)videoBuffer length:(size_t)size;Parameters
cameraCamera that sends out the video data.
videoBufferH.264 video data buffer. Don’t free the buffer after it has been used. The units for the video buffer are bytes.
lengthSize of the address of the video data buffer in bytes.
-
Video data update callback from the FPV camera on Inspire 2.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didReceiveFPVVideoData:(nonnull uint8_t *)videoBuffer length:(size_t)size;Parameters
cameraCamera that sends out the video data.
videoBufferH.264 video data buffer. Don’t free the buffer after it has been used. The units for the video buffer are bytes.
lengthSize of the address of the video data buffer in bytes.
-
Updates the camera’s current state.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateSystemState:(DJICameraSystemState *_Nonnull)systemState;Parameters
cameraCamera that updates the current state.
systemStateThe camera’s system state.
-
Tells the delegate that the lens information is updated. This method is available only when
isChangeableLensSupportedis YES.Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateLensState:(DJICameraLensState *_Nonnull)lensState;Parameters
cameraCamera that sends out the updatd lens information.
lensStateThe camera’s lens state.
-
Tells the delegate that a new media file (photo or video) has been generated. It is not supported by Zenmuse XT camera.
Warning
In this delegate, the
DJIMediainstance propertiesthumbnail,durationInSecondsandorientationrequire special consideration. Thethumbnailproperty normally has a pointer to aUIImageof the thumbnail, but this is only available when the camera is inDJICameraModeMediaDownloadwork mode. Additionally, for this instance ofDJIMedia, thedurationInSecondsproperty is 0 and thevideoOrientationproperty isDJICameraOrientationLandscape.Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didGenerateNewMediaFile:(DJIMedia *_Nonnull)newMedia;Parameters
cameraCamera that generates the new media file.
newMediaThe new media file.
-
Tells the delegate that a time-lapse preview image has been generated. This method is only available on Osmo with the upcoming firmware version.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didGenerateTimeLapsePreview:(UIImage *_Nonnull)previewImage;Parameters
cameraCamera that generates the time-lapse preview image.
previewImageThe new generated preview image.
-
Tells the delegate that the camera’s SD card state has been updated.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateSDCardState:(DJICameraSDCardState *_Nonnull)sdCardState;Parameters
cameraCamera that sends out the updated SD card state.
sdCardStateThe camera’s SD card state.
-
Tells the delegate that the camera’s SSD state has been updated. This method is available only when isSSDSupported is YES.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateSSDState:(DJICameraSSDState *_Nonnull)ssdState;Parameters
cameraCamera that sends out the updated SSD state.
ssdStateThe camera’s SSD state.
-
Called when there are new min, max, and average values available for the set spot metering area. Supported only by Zenmuse XT containing Advanced Radiometry capabilities.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateAreaTemperatureAggregations: (DJICameraThermalAreaTemperatureAggregations)temperatureAggregations;Parameters
cameraCamera that sends out the aggregate temperature values
temperatureAggregationsThe updated aggregate temperature values
-
Called when updated external scene settings are available. Supported only by Zenmuse XT containing Advanced Radiometry capabilities.
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateExternalSceneSettings: (DJICameraThermalExternalSceneSettings)externalSceneSettings;Parameters
cameraCamera that sends out the external scene setting values
externalSceneSettingsThe updated external scene settings values
-
Called whenever the camera parameters change. In automatic exposure modes (Program, Shutter Priority and Aperture Priority) the camera may be automatically changing aperture, shutter speed and ISO (depending on the mode and camera) when lighting conditions change. In Manual mode, the exposure compensation is automatically updated to let the user know how much compensation the exposure needs to get to an exposure the camera calculates as correct.
See
DJICameraExposureParameters
Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateCurrentExposureParameters:(DJICameraExposureParameters)params;Parameters
cameraCamera that sends out the video data.
paramsThe updated real values for parameters.
-
Received temperature in degrees Celsius of image. The thermal imaging camera will only update the temperature if the temperature data is enabled. For the XT Standard version, the temperature measurement data is the average of the center four pixels of the image. For the XT Advanced Radiometry version, the temperature measurement point can be set using
setThermalSpotMeteringTargetPoint:withCompletion.See
[- (void)setThermalTemperatureDataEnabled:(BOOL)enabled withCompletion:(DJICompletionBlock)block].Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateTemperatureData:(float)temperature;Parameters
cameraCamera that sends out the updated center temperature.
temperatureThe camera’s temperature data in degrees Celsius.
View on GitHub
DJICameraDelegate Protocol Reference