Kotlin

Implementar el capturador personalizado

Crear una clase que extienda BaseVideoCapturer del SDK de Vonage. Tu capturadora debe implementar varios métodos clave. Para la implementación completa revisa los archivos usados aquí: ScreenSharingCapturer.kt. Empecemos por explorar getCaptureSettings()

getCaptureSettings() indica al SDK el formato del vídeo: resolución, frecuencia de imagen y formato de píxeles.

override fun getCaptureSettings(): CaptureSettings {
    return CaptureSettings().apply {
        this.fps = this@ScreenSharingCapturer.fps // 15 in our case
        this.width = this@ScreenSharingCapturer.width
        this.height = this@ScreenSharingCapturer.height
        format = ABGR
    }
}
  • fps - fotogramas por segundo (15 fps es lo habitual para compartir pantalla)
  • width / height - dimensiones de los fotogramas capturados
  • format - formato de píxel (por ejemplo ABGR, NV21)