-2

I want to make an application for cardboard with a sony actioncam. I noticed that we can get the video preview by a SurfaceView method. But I remember that the only way to have a split screen with the camera device is by a SurfaceTexture. So my question is, is there a way with one actioncam to have 2 video previews simultaneously ( split screen ) ?? thanks

EDIT: okay so I went ahead and bought an action cam AS200, the sdk sample worked perfectly and i was able to get the video preview very quickly. I tried to duplicate the SimpleStreamSurfaceView with no success as expected. Now I m trying to copy the byte array in order to have two previews in one array. First I have tried to simply create an arraybuffer where i put two times the bitmap array, just to see what changes ... and I was surprised to see that nothing changed ... Here is the code `

                while (mWhileFetching) {
                    try {
                        byte[] jpegData = mJpegQueue.take();
                        ByteBuffer test=ByteBuffer.allocate(jpegData.length *2);
                        test.put(jpegData);
                        test.put(jpegData);
                        frameBitmap = BitmapFactory.decodeByteArray(//
                                test.array(), 0, test.array().length, factoryOptions);
                        //frameBitmap.setWidth(frameBitmap.getWidth()*2);
                    } catch (IllegalArgumentException e) {
                        if (mInMutableAvailable) {
                            clearInBitmap(factoryOptions);
                        }
                        continue;
                    } catch (InterruptedException e) {
                        Log.i(TAG, "Drawer thread is Interrupted.");
                        break;
                    }

                    if (mInMutableAvailable) {
                        setInBitmap(factoryOptions, frameBitmap);
                    }
                    drawFrame(frameBitmap);
                }

                if (frameBitmap != null) {
                    frameBitmap.recycle();
                }
                mWhileFetching = false;
            }
        };
        mDrawerThread.start();
        return true;
    }
`

Of course I wasnt expecting a great result but why nothing changed ??

1 Answers1

0

I solved it. I just had to draw two times in the canvas to different rectangles.

Box Box Box Box
  • 5,094
  • 10
  • 49
  • 67