📜  如何将连接的相机定义为 webrtc android 的媒体源 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:31.544000             🧑  作者: Mango

代码示例1
public void onReceive(byte[] videoBuffer, int size, int width, int height) {
    long timestampNS = TimeUnit.MILLISECONDS.toNanos(SystemClock.elapsedRealtime());
    NV21Buffer buffer = new NV21Buffer(videoBuffer, width, height, null);

    VideoFrame videoFrame = new VideoFrame(buffer, 0, timestampNS);
    videoSource.getCapturerObserver().onFrameCaptured(videoFrame);

    videoFrame.release();
}