RCRTCVideoView

public class RCRTCVideoView

Implements VideoRenderer.Callbacks by displaying the video stream on a SurfaceView. renderFrame() is asynchronous to avoid blocking the calling thread. This class is thread safe and handles access from potentially four different threads: Interaction from the main app in init, release, setMirror, and setScalingtype. Interaction from C++ rtc::VideoSinkInterface in renderFrame. Interaction from the Activity lifecycle in surfaceCreated, surfaceChanged, and surfaceDestroyed. Interaction with the layout framework in onMeasure and onSizeChanged.

Constructors

Link copied to clipboard
public void RCRTCVideoView(Context context)
Standard View constructor.
public void RCRTCVideoView(Context context, AttributeSet attrs)
Standard View constructor.

Types

Link copied to clipboard
@Deprecated()
public interface OnSizeChangedListener
Link copied to clipboard
public class Size

Properties

Link copied to clipboard
public int drawingMode
CDN渲染相关 0:默认执行RTC流绘制 1:执行CDN流绘制
Link copied to clipboard
public int rotatedFrameHeight
Link copied to clipboard
public int rotatedFrameWidth

Functions

Link copied to clipboard
public void addFrameListener(FrameListener listener, float scale)
public void addFrameListener(FrameListener listener, float scale, GlDrawer drawer)
Register a needCallback to be invoked when a new video frame has been received.
Link copied to clipboard
public void clearScreen()
清空屏幕
Link copied to clipboard
public void disableFpsReduction()
Link copied to clipboard
public ScalingType getScalingType()
Link copied to clipboard
Link copied to clipboard
public void init(Context context, RCRTCVideoStream videoStream)
Link copied to clipboard
public void onFrame(VideoFrame frame)
Link copied to clipboard
public void onFrameResolutionChanged(int videoWidth, int videoHeight, int rotation)
Link copied to clipboard
public void pauseVideo()
Link copied to clipboard
public void release()
Block until any pending frame is returned and all GL resources released, even if an interrupt occurs.
Link copied to clipboard
public void removeFrameListener(FrameListener listener)
Link copied to clipboard
public void setAllowRenderer(boolean isAllow)
是否允许渲染
Link copied to clipboard
public void setAspectRatio(int aspectRatio)
Link copied to clipboard
public void setDrawingMode(int drawingMode)
RTC 内部方法,禁止开发者调用
Link copied to clipboard
public void setEnableHardwareScalar(boolean enabled)
Enables fixed size for the surface.
Link copied to clipboard
public void setFpsReduction(float fps)
Limit render framerate.
Link copied to clipboard
public void setMirror(boolean mirror)
Set if the video stream should be mirrored or not.
Link copied to clipboard
public void setMirrorInternal(boolean mirror)
Link copied to clipboard
@Deprecated()
public void setOnSizeChangedListener(RCRTCVideoView.OnSizeChangedListener onSizeChangedListener)
Link copied to clipboard
public void setRendererEventsListener(RCRTCRendererEventsListener listener)
Link copied to clipboard
public void setScalingType(ScalingType scalingType)
Set how the video will fill the allowed layout area.
public void setScalingType(ScalingType scalingTypeMatchOrientation, ScalingType scalingTypeMismatchOrientation)
Link copied to clipboard
public void setVideoSampleAspectRatio(int videoSarNum, int videoSarDen)
Link copied to clipboard
public void setVideoSize(int videoWidth, int videoHeight)
Link copied to clipboard
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
Link copied to clipboard
public void surfaceCreated(SurfaceHolder holder)
Link copied to clipboard
public void surfaceDestroyed(SurfaceHolder holder)