0

I have an Android application that displays a video using gstreamer. It's similar to the tutorial mentioned here:

http://docs.gstreamer.com/display/GstSDK/Android+tutorial+3%3A+Video

Especially, it uses the GStreamerSurfaceView which extends SurfaceView.

I want now to perform some treatments on the video with another library that uses a GLSurfaceView:

class DemoGLSurfaceView extends GLSurfaceView {

    public DemoGLSurfaceView(Context context) {
        super(context);
        setEGLContextClientVersion(2);
        mRenderer = new DemoRenderer(context);
        setRenderer(mRenderer);
    }
    DemoRenderer mRenderer;
}

class DemoRenderer implements GLSurfaceView.Renderer {
    Context act;

    public DemoRenderer(Context context) {
        act = context;
    }

    @Override
    public void onDrawFrame(GL10 arg0) {
        nativeRender();
    }

    @Override
    public void onSurfaceChanged(GL10 arg0, int arg1, int arg2) {
    }

    @Override
    public void onSurfaceCreated(GL10 arg0, EGLConfig arg1) {
    }
}

private static native void nativeRender();

How can I "insert" the GLSurfaceView nativeRender process onto the GstreamerSurfaceView?

jww
  • 97,681
  • 90
  • 411
  • 885
gregoiregentil
  • 1,793
  • 1
  • 26
  • 56
  • Are you trying to process every frame, e.g. https://www.youtube.com/watch?v=kH9kCP2T5Gg , or just have one SurfaceView overlay the other? – fadden Apr 20 '15 at 15:26
  • Yes, I'm trying to process every frame. I'm not trying to integrate this grafika library on top of gstreamer-android but my objective seems very similar. I want to "intercept" each frame that gstreamer renders to the surfaceview and process it with this other library. – gregoiregentil Apr 20 '15 at 16:52
  • You can't capture the output of a SurfaceView; see e.g. http://stackoverflow.com/questions/27817577/ . If you can send the output to a SurfaceTexture or TextureView you can grab each frame. – fadden Apr 20 '15 at 17:10
  • Thanks. That's useful. I start to understand. Yes, I think that I need to modify gstreamer so that it outputs to a right memory element so that the library and it's GLSurfaceView can get it and then process it. – gregoiregentil Apr 20 '15 at 17:50

1 Answers1

0

A solution consists to develop a Gstreamer app video sink that can get each frame in memory and copy it to the OnDraw of GLSurfaceView.

gregoiregentil
  • 1,793
  • 1
  • 26
  • 56