RTCDisplayLinkTimer.h 894 B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright 2018 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #import <Foundation/Foundation.h>
  11. // RTCDisplayLinkTimer wraps a CADisplayLink and is set to fire every two screen
  12. // refreshes, which should be 30fps. We wrap the display link in order to avoid
  13. // a retain cycle since CADisplayLink takes a strong reference onto its target.
  14. // The timer is paused by default.
  15. @interface RTCDisplayLinkTimer : NSObject
  16. @property(nonatomic) BOOL isPaused;
  17. - (instancetype)initWithTimerHandler:(void (^)(void))timerHandler;
  18. - (void)invalidate;
  19. @end