实时音视频

  • 实时音视频 > API 文档 > iOS >QNCameraVideoTrack

    QNCameraVideoTrack

    最近更新时间:2021-11-19 22:34:45

    本地视频相机 Track 类
    Hierarchy
    Index
    Core Properties
    Core Methods
    Core Properties
    trackID
    • @property (nonatomic, strong) NSString *trackID;
    • 一路 Track 在 Server 端的唯一标识

    kind
    • @property (nonatomic, readonly) QNTrackKind kind;
    • 标识该路 Track 是音频还是视频

    tag
    • @property (nonatomic, strong) NSString *tag;
    • Track 的 tag

    muted
    • @property (nonatomic, assign, readonly) BOOL muted;
    • 标识 Track 是否为 mute 状态

    videoDelegate
    • @property (nonatomic, weak) id<QNCameraTrackVideoDataDelegate> videoDelegate;
    • 视频 Track 回调代理

    captureSession
    • @property (nonatomic, readonly) AVCaptureSession * _Nullable captureSession;
    • 视频采集 session,只读变量

    videoCaptureDeviceInput
    • @property (nonatomic, readonly) AVCaptureDeviceInput * _Nullable videoCaptureDeviceInput;
    • 视频采集输入源,只读变量

    fillMode
    • @property(readwrite, nonatomic) QNVideoFillModeType fillMode;
    • reviewView 中视频的填充方式,默认使用 QNVideoFillModePreserveAspectRatioAndFill

    captureDevicePosition
    • @property (nonatomic, assign) AVCaptureDevicePosition captureDevicePosition;
    • 摄像头的位置,默认为 AVCaptureDevicePositionFront 前置

    videoOrientation
    • @property (nonatomic, assign) AVCaptureVideoOrientation videoOrientation;
    • 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait

    torchOn
    • @property (nonatomic, assign, getter=isTorchOn) BOOL torchOn;
    • 是否开启手电筒,默认为 NO

    continuousAutofocusEnable
    • @property (nonatomic, assign, getter=isContinuousAutofocusEnable) BOOL continuousAutofocusEnable;
    • 连续自动对焦。默认为 YES

    touchToFocusEnable
    • @property (nonatomic, assign, getter=isTouchToFocusEnable) BOOL touchToFocusEnable;
    • 手动点击屏幕进行对焦。默认为 YES

    smoothAutoFocusEnabled
    • @property (nonatomic, assign, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled;
    • 平滑对焦减缓抖动感,默认为 YES

    focusPointOfInterest
    • @property (nonatomic, assign) CGPoint focusPointOfInterest;
    • 聚焦的位置,(0,0) 代表左上, (1,1) 代表右下。默认为 (0.5, 0.5),即中间位置

    videoZoomFactor
    • @property (nonatomic, assign) CGFloat videoZoomFactor;
    • 控制摄像头的缩放,默认为 1.0

    videoFormats
    • @property (nonatomic, strong, readonly) NSArray<AVCaptureDeviceFormat *> *videoFormats;
    • 设备支持的 formats

    videoActiveFormat
    • @property (nonatomic, strong) AVCaptureDeviceFormat *videoActiveFormat;
    • 设备当前的 format

    sessionPreset
    • @property (nonatomic, copy) NSString *sessionPreset;
    • 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset640x480

    videoFrameRate
    • @property (nonatomic, assign) NSUInteger videoFrameRate;
    • 采集的视频数据的帧率,默认为 24

    previewMirrorFrontFacing
    • @property (nonatomic, assign) BOOL previewMirrorFrontFacing;
    • 前置摄像头预览是否开启镜像,默认为 YES

    previewMirrorRearFacing
    • @property (nonatomic, assign) BOOL previewMirrorRearFacing;
    • 后置摄像头预览是否开启镜像,默认为 NO

    encodeMirrorFrontFacing
    • @property (nonatomic, assign) BOOL encodeMirrorFrontFacing;
    • 前置摄像头,对方观看时是否开启镜像,默认 NO

    encodeMirrorRearFacing
    • @property (nonatomic, assign) BOOL encodeMirrorRearFacing;
    • 后置摄像头,对方观看时是否开启镜像,默认 NO

    Core Methods
    updateMute
    • - (void)updateMute:(BOOL)mute;
    • 更新当前 Track 的 mute 值

      Parameters
      • mute: BOOL

        是否静默 Track

    sendSEI
    • - (void)sendSEI:(NSString *)videoSEI repeatNmuber:(NSNumber *)repeatNumber;
    • 本地视频 Track 添加 SEI

      Parameters
      • videoSEI: NSString

        SEI 内容

      • repeatNumber: NSNumber

        SEI 重复发送次数,-1 为永久发送

    switchCamera
    • - (void)switchCamera;
    • 切换前后摄像头

    setBeautifyModeOn
    • -(void)setBeautifyModeOn:(BOOL)beautifyModeOn;
    • 是否开启美颜

      Parameters
      • beautifyModeOn: BOOL

        美颜开关

    setBeautify
    • -(void)setBeautify:(CGFloat)beautify;
    • 设置对应 Beauty 的程度参数,范围从 0 ~ 1

      Parameters
      • beautify: CGFloat

        美颜程度

    setWhiten
    • -(void)setWhiten:(CGFloat)whiten;
    • 设置美白程度参数,范围从 0 ~ 1

      Parameters
      • whiten: CGFloat

        美白程度

    setRedden
    • -(void)setRedden:(CGFloat)redden;
    • 设置红润的程度参数,范围从 0 ~ 1

      Parameters
      • redden: CGFloat

        红润程度

    setWaterMarkWithImage
    • -(void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position;
    • 设置水印

      Parameters
      • waterMarkImage: UIImage

        水印图片

      • position: CGPoint

        水印位置

    clearWaterMark
    • -(void)clearWaterMark;
    • 移除水印

    pushCameraTrackWithImage
    • - (void)pushCameraTrackWithImage:(nullable UIImage *)image;
    • 设置摄像头 Track 发送图片数据

      Parameters
      • image: UIImage

        图片

    startCapture
    • - (void)startCapture;
    • 开启摄像头采集

    stopCapture
    • - (void)stopCapture;
    • 关闭摄像头采集

    play
    • - (void)play:(QNGLKView *)playView;
    • 预览视图渲染

      Parameters
    以上内容是否对您有帮助?
  • Qvm free helper
    Close