Closed jackaru closed 6 years ago
can you share you shader?I can test in my pixel
gba1: censored
gba2: censored
And
mRenderPipeline.addFilterRender(new gba1()); mRenderPipeline.addFilterRender(new gba2());
In my android it works well
I have test your shader in my pixel, find the same error "ERROR: 0:13: '8.' : Syntax error: syntax error".
so i change the shader
"const vec4 color1 = vec4(008. / 255., 025. / 255., 032. / 255., 1.);\n" + "const vec4 color2 = vec4(050. / 255., 106. / 255., 079. / 255., 1.);\n" + "const vec4 color3 = vec4(137. / 255., 192. / 255., 111. / 255., 1.);\n" + "const vec4 color4 = vec4(223. / 255., 246. / 255., 208. / 255., 1.);\n" +
to
"const vec4 color1 = vec4(8. / 255., 025. / 255., 032. / 255., 1.);\n" + "const vec4 color2 = vec4(050. / 255., 106. / 255., 079. / 255., 1.);\n" + "const vec4 color3 = vec4(137. / 255., 192. / 255., 111. / 255., 1.);\n" + "const vec4 color4 = vec4(223. / 255., 246. / 255., 208. / 255., 1.);\n" +
then find the similar error "ERROR: 0:14: '9.' : Syntax error: syntax error"
so i change the shader to
"const vec4 color1 = vec4(8. / 255., 025. / 255., 032. / 255., 1.);\n" + "const vec4 color2 = vec4(050. / 255., 106. / 255., 79. / 255., 1.);\n" + "const vec4 color3 = vec4(137. / 255., 192. / 255., 111. / 255., 1.);\n" + "const vec4 color4 = vec4(223. / 255., 246. / 255., 208. / 255., 1.);\n" +
then it can work.
so i think 008 and 079 it's erroneous octal numbers.
When the number begins with 0, some mobile phones use the whole number as an octal number
Thanks, you helped me a lot since I'm still a learner with shaders, I will test it in Google Console if it's working with all devices. Another micro issue is why is unsupported to take photo or video with a saved video by the app?
take photo or video with a saved video? you can see the VideoFilterActivity.java in develop branch, should be supported,
Yah, I missed something with photo that says me "unsupported" and already solved it, but with an imported video I can't use startRecording and stopRecording functions.. I'm alright?
why? RenderPipeline always has startRecording and stopRecording functions.you say you can't, is it mean will crash?
mRenderPipeline = EZFilter.input(mCurrentUri) .addFilter(new BWRender(VideoFilterActivity.this)) .enableRecord("/sdcard/recordVideo.mp4", true, false) .setPreparedListener(new IMediaPlayer.OnPreparedListener() { @Override public void onPrepared(IMediaPlayer var1) { Log.e("VideoFilterActivity", "onPrepared"); } }) .setCompletionListener(new IMediaPlayer.OnCompletionListener() { @Override public void onCompletion(IMediaPlayer var1) { Log.e("VideoFilterActivity", "onCompletion"); } }) .into(mRenderView);
I have test in demo, it can work
Thanks, I don't know why but it's working only with WhatsApp videos, camera videos is crashing every time with this code
new Thread() { public void run() { mRenderPipeline = EZFilter.input(Uri.parse(paths.get(0))) .setLoop(true) .enableRecord(getPath(1), true, true) .setPreparedListener(var1 -> Log.e("VideoFilterActivity", "onPrepared")) .setCompletionListener(var1 -> Log.e("VideoFilterActivity", "onCompletion")) .into(mRenderView); } }.start();
Error.
Update: is not working only with vertical orientation camera videos
what's the width and height of camera videos?
1920 x 1080
I've seen that in some devices tested by google play console, the app will crash only if he choose a filter that include double filters rendering.
"no main() in shader", but it exist
I don't know where is the problem 'cause is not the android version as you can see