Android camera native access : startPreview() vs startRecording()

前端 未结 3 1660
走了就别回头了
走了就别回头了 2021-01-31 12:53

Trying to get camera working from native code in Android ICS: most manuals refer to startPreview() method . But browsing AOSP code I\'ve found also \'st

3条回答
  •  时光取名叫无心
    2021-01-31 13:21

    In terms of performance there is no gain in going for native camera. Using Camera.setPreviewCallbackWithBuffer() in Java (off UI thread) gives as many frames per second as any native alternative. But on some SOCs, e.g. Samsung, camera output may be directly (0-copy) wired with HW h264 encoder, which naturally gives excellent throughput. This is what the pure java MediaRecorder does under the hood. You cannot achieve same if any manipulation of the buffer should be involved.

提交回复
热议问题