Java Question Attempt to invoke virtual method 'android.view.SurfaceHolder net.maj

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Hello all ,


I am trying to wrap this library https://github.com/fyhertz/libstreaming

When I try this code

B4X:
mSession = SessionBuilder.getInstance()
        .setCallback(this)
        .setSurfaceView(mSurfaceView)
        .setPreviewOrientation(90)
        .setContext( ba.applicationContext)
        .setAudioEncoder(SessionBuilder.AUDIO_NONE)
        .setAudioQuality(new AudioQuality(16000, 32000))
        .setVideoEncoder(SessionBuilder.VIDEO_H264)
        .setVideoQuality(new VideoQuality(320,240,20,500000))
        .build();

        mSurfaceView.getHolder().addCallback(this);

I get this error

B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.SurfaceHolder net.majorkernelpanic.streaming.gl.SurfaceView.getHolder()' on a null object reference

Can anyone please help ?

Thanks in advance
 

DonManfred

Expert
Licensed User
Longtime User
surfaceview0106.png


- You need to wrap the SurfaceView first
- You need to add the Surfaceview to the Layout
- You need to add the SurfaceView-reference to the SessionBuilder.

OR you wait a few days then i will release a wrap for this (maybe with server-version too; will see)
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
- You need to wrap the SurfaceView first
- You need to add the Surfaceview to the Layout
- You need to add the SurfaceView-reference to the SessionBuilder.

OR you wait a few days then i will release a wrap for this (maybe with server-version too; will see)
Thanks a lot Manfred
I will try to write a wrapper myself ( with help of course from you and other experts :) ) so I learn wrapping libraries .
If I fail then I will just wait for your library or help :D
 

DonManfred

Expert
Licensed User
Longtime User
but I hope DonManfred is working on this lib
i thought you would?
I don´t want to steal the show so i was quiet...
I´ll release the lib as written as yet this weekend.... Only the streaming-part and some helping objects (for the video audio configuration) is written. I did not had the mood for the server-part... But the stream is working. As of now it is only tested on wowza server

I´ll upload the java-source too so hopefully someone other will do the next step ;-)
 

MarcoRome

Expert
Licensed User
Longtime User
Great Don ...when you release this you will be again a my donation ;)
Thank you again
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
i thought you would?
I don´t want to steal the show so i was quiet...
I´ll release the lib as written as yet this weekend.... Only the streaming-part and some helping objects (for the video audio configuration) is written. I did not had the mood for the server-part... But the stream is working. As of now it is only tested on wowza server

I´ll upload the java-source too so hopefully someone other will do the next step ;-)
Sorry I might misunderstood your sentence "OR you wait a few days then i will release a wrap for this (maybe with server-version too; will see)"
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
hehe.. I wanted to release it.

But as you wrote you are trying and i dont want to steal the show of someone other bla bla bla...

I´m just on the way to create the announce :D
That is one of my chronic problems :D
I loose patience and/or desire in creating or learning something .
But sometimes I get back later and continue what I was doing .
 
Top