human: 如何处理七牛云的实时音视频QNScreenVideoTrack

gpt: [实时音视频](https://developer.qiniu.com/rtc) > API 文档 > Windows
>QNScreenVideoTrack

#  QNScreenVideoTrack

最近更新时间: 2022-03-23 23:22:13

本地视频录屏 Track 类

> 屏幕共享 track 的创建需要发起系统屏幕录制的申请，具体使用姿势请参考[屏幕共享 track
> 使用指南](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/undefined)。

Hierarchy

  * [QNTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9452/QNTrack)
    * [QNLocalTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9422/QNLocalTrack)
      * [QNLocalVideoTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9424/QNLocalVideoTrack)
        * [QNCameraVideoTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9404/QNCameraVideoTrack)
        * QNScreenVideoTrack 
        * [QNCustomVideoTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9412/QNCustomVideoTrack)
      * [QNLocalAudioTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9420/QNLocalAudioTrack)
        * [QNMicrophoneAudioTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9433/QNMicrophoneAudioTrack)
        * [QNCustomAudioTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9409/QNCustomAudioTrack)
    * [QNRemoteTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9440/QNRemoteTrack)
      * [QNRemoteVideoTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9443/QNRemoteVideoTrack)
      * [QNRemoteAudioTrack](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/9438/QNRemoteAudioTrack)

Index

Core Methods

  * GetTrackID
  * GetUserID
  * GetTag
  * IsAudio
  * IsVideo
  * IsMuted
  * SetMuted
  * SetVideoFrameListener
  * Play
  * SendSEI
  * StartCrop
  * StopCrop
  * StartScale
  * StopScale
  * StartCapture
  * StopCapture
  * IsScreenCaptureSupported

Core Methods

GetTrackID

  * virtual const std::string& GetTrackID() = 0
  * 获取 TrackID

Returns string

GetUserID

  * virtual const std::string& GetUserID() = 0
  * 获取 UserID

Returns string

GetTag

  * virtual const std::string& GetTag() = 0
  * 获取 Tag

Returns string

IsAudio

  * virtual bool IsAudio() = 0
  * 是否为音频 track

Returns bool

IsVideo

  * virtual bool IsVideo() = 0
  * 是否为视频 track

Returns bool

IsMuted

  * virtual bool IsMuted() = 0
  * 是否 muted

Returns bool

SetMuted

  * virtual void SetMuted(bool muted) = 0
  * 设置是否静默该 track，静默后，SDK 将会发送静默帧数据

Parameters

    * muted: bool 

是否静默

SetVideoFrameListener

  * virtual void SetVideoFrameListener([QNVideoFrameListener](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/11326/QNVideoFrameListener)* listener) = 0
  * 设置视频数据监听

Parameters

    * listener: [QNVideoFrameListener](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/11326/QNVideoFrameListener)

视频数据监听接口

Play

  * virtual void Play(QNView& view) = 0
  * 设置本地渲染参数

Parameters

    * view: [QNView](https://developer.qiniu.com/rtc/9448/qnscreenvideotrack/11328/QNView)

渲染参数

SendSEI

  * virtual void SendSEI(std::string& message,std::string& uuid,int32_t repeat_count) = 0
  * 发送 SEI

Parameters

    * message: string 

消息内容

    * uuid: string 

唯一 ID

    * repeat_count: int 

重复次数, -1 为每一帧都发送

StartCrop

  * virtual void StartCrop(uint32_t crop_x,uint32_t crop_y,int32_t crop_width,int32_t crop_height) = 0
  * 开启原始帧裁剪功能，设置参数要求如下，如果设置不正确，则输出原始图像

Parameters

    * crop_x: uint32_t 

开始裁减的 X 坐标点，原点为左上角，必须落在原图之内

    * crop_y: uint32_t 

开始裁减的 Y 坐标点，原点为左上角，必须落在原图之内

    * crop_width: int32_t 

目标图像宽度，必须为 4 的整数倍，如果是裁剪模式，crop_x和 crop_y，裁剪图像必须在原始图像之内

    * crop_height: int32_t 

目标图像高度，必须为 4 的整数倍，如果是裁剪模式，crop_x 和 crop_y，裁剪图像必须在原始图像之内

StopCrop

  * virtual void StopCrop() = 0
  * 关闭裁剪功能

StartScale

  * virtual void StartScale(int32_t dst_width, int32_t dst_height) = 0
  * 开启原始帧缩放功能，设置参数要求如下，如果设置不正确，则输出原始图像

Parameters

    * dst_width: int32_t 

目标图像宽度，必须为 4 的整数倍

    * dst_height: int32_t 

目标图像高度，必须为 4 的整数倍

StopScale

  * virtual void StopScale() = 0
  * 关闭缩放功能

StartCapture

  * virtual void StartCapture() = 0
  * 开启摄像头采集

StopCapture

  * virtual void StopCapture() = 0
  * 关闭摄像头采集

IsScreenCaptureSupported

  * virtual bool IsScreenCaptureSupported() = 0
  * 是否支持屏幕共享， 仅适用于 Android 和 iOS 平台

Returns bool

以上内容是否对您有帮助？