I am support the application with videochat functions. I am use Camera2
for API>=21
. Camera works. Now I need receive data from the camera of my device and write it into a byte [],and then pass the array to a native method for processing and transmitting images opponent. Video transfer functionality written in C ++.My task - to properly record video in byte [] (because this argument accepts a native method, which is to carry out all next actions on the video display).
if I start something to add, the camera stop working.
Help me correctly and easy as possible implement this task. I tried to use MediaRecorder
, but it does not write data in the byte []. I watched standart Google-examples such as Camera2Basic
, Camera2Video . I tried to realize MediaRecorder
like in this tutorials. but it does not work.
ImageReader
as I understand, used only for images.
MediaCodec
- it is too complicated, I could not really understand.
What the better and eaziest way to implement for obtaining image from camera of my device and for recording it into byte[]. and if possible,give me sample of code or a resource where I can see it. Thanks