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
camera
Camera that sends out the video data.
videoBuffer
H.264 video data buffer. Don’t free the buffer after it has been used. The units for the video buffer are bytes.
length
Size 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
camera
Camera that sends out the video data.
videoBuffer
H.264 video data buffer. Don’t free the buffer after it has been used. The units for the video buffer are bytes.
length
Size 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
camera
Camera that updates the current state.
systemState
The camera’s system state.
-
Tells the delegate that the lens information is updated. This method is available only when
isChangeableLensSupported
is YES.Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didUpdateLensState:(DJICameraLensState *_Nonnull)lensState;
Parameters
camera
Camera that sends out the updatd lens information.
lensState
The 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
DJIMedia
instance propertiesthumbnail
,durationInSeconds
andorientation
require special consideration. Thethumbnail
property normally has a pointer to aUIImage
of the thumbnail, but this is only available when the camera is inDJICameraModeMediaDownload
work mode. Additionally, for this instance ofDJIMedia
, thedurationInSeconds
property is 0 and thevideoOrientation
property isDJICameraOrientationLandscape
.Declaration
Objective-C
- (void)camera:(DJICamera *_Nonnull)camera didGenerateNewMediaFile:(DJIMedia *_Nonnull)newMedia;
Parameters
camera
Camera that generates the new media file.
newMedia
The 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
camera
Camera that generates the time-lapse preview image.
previewImage
The 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
camera
Camera that sends out the updated SD card state.
sdCardState
The 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
camera
Camera that sends out the updated SSD state.
ssdState
The 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
camera
Camera that sends out the aggregate temperature values
temperatureAggregations
The 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
camera
Camera that sends out the external scene setting values
externalSceneSettings
The 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
camera
Camera that sends out the video data.
params
The 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
camera
Camera that sends out the updated center temperature.
temperature
The camera’s temperature data in degrees Celsius.