public class VideoFileDetector extends Detector implements com.affectiva.android.affdex.sdk.decoder.FrameDecoder.DecoderFrameListener, com.affectiva.android.affdex.sdk.decoder.FrameDecoder.DecoderFinishedListener
Detector.FaceListener, Detector.ImageListener
Constructor and Description |
---|
VideoFileDetector(android.content.Context context,
String filePath)
Creates a VideoFileDetector.
|
Modifier and Type | Method and Description |
---|---|
void |
frameReady(byte[] frame,
int width,
int height,
Frame.COLOR_FORMAT format,
long timeStamp,
Frame.ROTATE rotation)
Called when the
Decoder gets a frame ready decoded and ready to process. |
void |
onProcessingFinished() |
void |
reset()
Resets the baselines used to measure facial expressions and emotions.
|
void |
start()
Initiates processing of the video file.
|
void |
stop()
Allows the VideoFileProcessor to deallocate resources when processing is complete.
|
getDetectAnger, getDetectAttention, getDetectBrowFurrow, getDetectBrowRaise, getDetectChinRaiser, getDetectContempt, getDetectDisgust, getDetectEngagement, getDetectEyeClosure, getDetectFear, getDetectGender, getDetectInnerBrowRaiser, getDetectJoy, getDetectLipDepressor, getDetectLipPress, getDetectLipPucker, getDetectLipSuck, getDetectMouthOpen, getDetectNoseWrinkler, getDetectSadness, getDetectSmile, getDetectSmirk, getDetectSurprise, getDetectUpperLipRaiser, getDetectValence, getPercentFaceDetected, isRunning, setAllEmotions, setAllExpressions, setDetectAnger, setDetectAttention, setDetectBrowFurrow, setDetectBrowRaise, setDetectChinRaiser, setDetectContempt, setDetectDisgust, setDetectEngagement, setDetectEyeClosure, setDetectFear, setDetectGender, setDetectInnerBrowRaiser, setDetectJoy, setDetectLipDepressor, setDetectLipPress, setDetectLipPucker, setDetectLipSuck, setDetectMouthOpen, setDetectNoseWrinkler, setDetectSadness, setDetectSmile, setDetectSmirk, setDetectSurprise, setDetectUpperLipRaiser, setDetectValence, setFaceListener, setImageListener, setLicensePath, setLicenseStream
public VideoFileDetector(android.content.Context context, String filePath)
context
- application's context.filePath
- the path on the SD card to the video file.NullPointerException
- if context
and/or filePath
is null
.public void start()
start
in class Detector
LicenseException
- if no or invalid license was provided see: Detector.setLicensePath(String)
.AffdexException
- if the detector did not initialize successfully.public void frameReady(byte[] frame, int width, int height, Frame.COLOR_FORMAT format, long timeStamp, Frame.ROTATE rotation)
com.affectiva.android.affdex.sdk.decoder.FrameDecoder.DecoderFrameListener
Decoder
gets a frame ready decoded and ready to process.
You can go ahead and copy the ByteBuffer
to a preallocated Bitmap
(by calling
copyPixelsFromBuffer
on the Bitmap
)frameReady
in interface com.affectiva.android.affdex.sdk.decoder.FrameDecoder.DecoderFrameListener
frame
- The frame.format
- the frame's color format.timeStamp
- The frame's timestamp, in microseconds.rotation
- The orientation of the passed frame.public void onProcessingFinished()
onProcessingFinished
in interface com.affectiva.android.affdex.sdk.decoder.FrameDecoder.DecoderFinishedListener
public void stop()
stop
in class Detector
IllegalStateException
- if called before Detector.start()
.Detector.getPercentFaceDetected()
public void reset()
Detector
Detector.start()
.Copyright © 2015. All rights reserved.