Git Product home page Git Product logo

Comments (7)

ChillingVan avatar ChillingVan commented on June 5, 2024

Could you show your code as an example?

from androidinstantvideo.

ChillingVan avatar ChillingVan commented on June 5, 2024

And is requestRender called?

from androidinstantvideo.

inventionsbyhamid avatar inventionsbyhamid commented on June 5, 2024

Here is the link https://github.com/inventionsbyhamid/AndroidInstantVideo/tree/screen_display
I have created a separate activity "ScreenPublisherActivity" to just draw the screen preview. Not able to figure out why nothing gets drawn on the texture view.

from androidinstantvideo.

ChillingVan avatar ChillingVan commented on June 5, 2024

I check and the onFrameAvailable is not called, I am wondering why

from androidinstantvideo.

ChillingVan avatar ChillingVan commented on June 5, 2024

It seems that the surface in ImageReader works fine. Need to look into the source code of it.

from androidinstantvideo.

ChillingVan avatar ChillingVan commented on June 5, 2024

I try to use

                surfaceTexture.setDefaultBufferSize(width, height);

And it works.
Add this line before set onFrameAvailable listener:

        displayTextureView.setSurfaceTextureCreatedListener(new GLMultiTexProducerView.SurfaceTextureCreatedListener() {
            @Override
            public void onCreated(List<GLTexture> producedTextureList) {
                GLTexture texture = producedTextureList.get(0);
                surfaceTexture = texture.getSurfaceTexture();
                RawTexture outsideTexture = texture.getRawTexture();
                width = outsideTexture.getWidth();
                height = outsideTexture.getHeight();
                surfaceTexture.setDefaultBufferSize(width, height);
                surfaceTexture.setOnFrameAvailableListener(new SurfaceTexture.OnFrameAvailableListener() {
                    @Override
                    public void onFrameAvailable(SurfaceTexture surfaceTexture) {
                        Log.i(TAG, "onFrameAvailable");
                        displayTextureView.requestRender();
                    }
                }, mHandler);
                mSurface = new Surface(surfaceTexture);
                if(mVirtualDisplay != null) {
                    mVirtualDisplay.setSurface(mSurface);
                }
            }
        });

from androidinstantvideo.

inventionsbyhamid avatar inventionsbyhamid commented on June 5, 2024

It works fine. Thanks for the help!

from androidinstantvideo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.