RTCEncodedImage.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2017 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. #import "RTCMacros.h"
  12. #import "RTCVideoFrame.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. /** Represents an encoded frame's type. */
  15. typedef NS_ENUM(NSUInteger, RTCFrameType) {
  16. RTCFrameTypeEmptyFrame = 0,
  17. RTCFrameTypeAudioFrameSpeech = 1,
  18. RTCFrameTypeAudioFrameCN = 2,
  19. RTCFrameTypeVideoFrameKey = 3,
  20. RTCFrameTypeVideoFrameDelta = 4,
  21. };
  22. typedef NS_ENUM(NSUInteger, RTCVideoContentType) {
  23. RTCVideoContentTypeUnspecified,
  24. RTCVideoContentTypeScreenshare,
  25. };
  26. /** Represents an encoded frame. Corresponds to webrtc::EncodedImage. */
  27. RTC_OBJC_EXPORT
  28. @interface RTC_OBJC_TYPE (RTCEncodedImage) : NSObject
  29. @property(nonatomic, strong) NSData *buffer;
  30. @property(nonatomic, assign) int32_t encodedWidth;
  31. @property(nonatomic, assign) int32_t encodedHeight;
  32. @property(nonatomic, assign) uint32_t timeStamp;
  33. @property(nonatomic, assign) int64_t captureTimeMs;
  34. @property(nonatomic, assign) int64_t ntpTimeMs;
  35. @property(nonatomic, assign) uint8_t flags;
  36. @property(nonatomic, assign) int64_t encodeStartMs;
  37. @property(nonatomic, assign) int64_t encodeFinishMs;
  38. @property(nonatomic, assign) RTCFrameType frameType;
  39. @property(nonatomic, assign) RTCVideoRotation rotation;
  40. @property(nonatomic, assign) BOOL completeFrame;
  41. @property(nonatomic, strong) NSNumber *qp;
  42. @property(nonatomic, assign) RTCVideoContentType contentType;
  43. @end
  44. NS_ASSUME_NONNULL_END