2014 snapchat source code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB

  1. //
  2. // SCBlackCameraDetector.h
  3. // Snapchat
  4. //
  5. // Created by Derek Wang on 24/01/2018.
  6. //
  7. #import "SCBlackCameraReporter.h"
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. @class SCBlackCameraNoOutputDetector;
  11. @interface SCBlackCameraDetector : NSObject
  12. @property (nonatomic, strong) SCBlackCameraNoOutputDetector *blackCameraNoOutputDetector;
  13. SC_INIT_AND_NEW_UNAVAILABLE
  14. - (instancetype)initWithTicketCreator:(id<SCManiphestTicketCreator>)ticketCreator;
  15. // CameraView visible/invisible
  16. - (void)onCameraViewVisible:(BOOL)visible;
  17. - (void)onCameraViewVisibleWithTouch:(UIGestureRecognizer *)touch;
  18. // Call this when [AVCaptureSession startRunning] is called
  19. - (void)sessionWillCallStartRunning;
  20. - (void)sessionDidCallStartRunning;
  21. // Call this when [AVCaptureSession stopRunning] is called
  22. - (void)sessionWillCallStopRunning;
  23. - (void)sessionDidCallStopRunning;
  24. // Call this when [AVCaptureSession commitConfiguration] is called
  25. - (void)sessionWillCommitConfiguration;
  26. - (void)sessionDidCommitConfiguration;
  27. - (void)sessionDidChangeIsRunning:(BOOL)running;
  28. // For CapturePreview visibility detector
  29. - (void)capturePreviewDidBecomeVisible:(BOOL)visible;
  30. /**
  31. Mark the start of creating new session
  32. When we fix black camera by creating new session, some detector may report black camera because we called
  33. [AVCaptureSession stopRunning] on old AVCaptureSession, so we need to tell the detector the session is recreating, so
  34. it is fine to call [AVCaptureSession stopRunning] on old AVCaptureSession.
  35. */
  36. - (void)sessionWillRecreate;
  37. /**
  38. Mark the end of creating new session
  39. */
  40. - (void)sessionDidRecreate;
  41. @end