Adreno220 framebuffer object - framebuffer

I made a sample JNI android app.
It works well on Galaxy Note(Mali 400MP) but don't work on SGS2LTE(Adreno 220).
I think its problem in making FBO.
cpp code is below
// Create Depth Buffer;
GL_CMD(glGenFramebuffers(1, &m_depthBuffer))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer))
GL_CMD(glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, m_width, m_height))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, 0))
// Create Stencil Buffer;
GL_CMD(glGenFramebuffers(1, &m_stencilBuffer))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, m_stencilBuffer))
GL_CMD(glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, m_width, m_height))
GL_CMD(glBindRenderbuffer(GL_RENDERBUFFER, 0))
// Construct FBO
GL_CMD(glGenFramebuffers(1, &m_fbo))
GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, m_fbo))
GL_CMD(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0))
GL_CMD(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_depthBuffer))
GL_CMD(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_stencilBuffer))
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
LOGE("Check Frame Buffer Status Failed : %x", status);
return;
}
GL_CMD(glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT))
status represents 0x8CDD(GL_FRAMEBUFFER_UNSUPPORTED_EXT).
I attach Logcat.
01-03 03:59:32.829: D/libEGL(24851): loaded /system/lib/egl/libGLES_android.so
01-03 03:59:32.829: D/libEGL(24851): loaded /system/lib/egl/libEGL_adreno200.so
01-03 03:59:32.839: D/libEGL(24851): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
01-03 03:59:32.839: D/libEGL(24851): loaded /system/lib/egl/libGLESv2_adreno200.so
01-03 03:59:32.849: W/EglHelper(24851): createContext com.google.android.gles_jni.EGLContextImpl#40529b80 tid=1
01-03 03:59:32.869: D/Surface(24851): Surface is full screen
01-03 03:59:32.899: D/Surface(24851): Surface is full screen
01-03 03:59:32.899: W/EglHelper(24851): start() tid=1
01-03 03:59:32.909: W/EglHelper(24851): createContext com.google.android.gles_jni.EGLContextImpl#4052afc0 tid=1
01-03 03:59:32.909: W/EglHelper(24851): createSurface() tid=1
01-03 03:59:32.939: D/dalvikvm(24851): Note: class Landroid/opengl/GLWrapperBase; has 211 unimplemented (abstract) methods
01-03 03:59:32.939: I/EGLUtils(24851): GL Version = OpenGL ES 2.0 1566933
01-03 03:59:32.939: I/EGLUtils(24851): GL Vendor = Qualcomm
01-03 03:59:32.949: I/EGLUtils(24851): GL Renderer = Adreno (TM) 220
01-03 03:59:32.949: I/EGLUtils(24851): GL Extensions = GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_QCOM_memory_monitor GL_AMD_compressed_3DC_texture
01-03 03:59:32.979: I/GLUtils(24851): EGL Extensions : EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_ANDROID_image_native_buffer EGL_ANDROID_swap_rectangle EGL_ANDROID_get_render_buffer
01-03 03:59:32.989: I/GLUtils(24851): GL Extensions : GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_QCOM_memory_monitor GL_AMD_compressed_3DC_texture
01-03 03:59:32.989: I/SharedTexture(24851): imageEGL: 0 syncKHR: 0
01-03 03:59:33.009: D/CLIPBOARD(24851): Hide Clipboard dialog at Starting input: finished by someone else... !
**01-03 03:59:33.039: E/AGRE(24851): Check Frame Buffer Status Failed : 8cdd**
How can it work on Adreno 220?

Have you checked the exact value glCheckFramebufferStatus() returns? If it is GL_FRAMEBUFFER_UNSUPPORTED, you should try simply ignoring the error and continuing with execution.

Try using GL_OES_packed_depth_stencil rather than separate depth/stencil render buffers. See http://www.khronos.org/registry/gles/extensions/OES/OES_packed_depth_stencil.txt for more details. You'll want to check that this extension is indeed supported by the device before using it. This would be the case for Adreno 220.

Related

Ffmpeg-kit not detecting my vidoe file (iOS Development, Swift) but the actual application does

I have a video file in the project folder that is detected by the app as VideoPlayer(player: AVPlayer(url: url)) does make use of it and play it on the iPhone screen, I have the video path of simply videoURL = Bundle.main.url(forResource: "Earth_Zoom_In", withExtension: "mov")
Now, a kind gentleman gave me this code just yesterday:
func syncCommand() {
guard let session = FFmpegKit.execute("-i Earth_Zoom_In.mov -c:v file1.mp4") else {
print("!! Failed to create session")
return
}
let returnCode = session.getReturnCode()
if ReturnCode.isSuccess(returnCode) {
print("COOOOL");
} else if ReturnCode.isCancel(returnCode) {
print("CANCELED???? WHAT?????");
} else {
print("Command failed with state \(FFmpegKitConfig.sessionState(toString: session.getState()) ?? "Unknown") and rc \(returnCode?.description ?? "Unknown").\(session.getFailStackTrace() ?? "Unknown")")
}
}
But Ffmpeg seems to not find the file as when the function is executed I get ERROR: Earth_Zoom_In.mov: No such file or directory
But it is on the directory...
Can anyone help me with that? 🥹🥹🥹 please.
I have tried:
guard let session = FFmpegKit.execute("-i \(url) -c:v file1.mp4") else {
inside of syncCommand(url: URL?) and change the code in my init
to init() {
videoURL = Bundle.main.url(forResource: "Earth_Zoom_In", withExtension: "mov")
syncCommand(url: videoURL);
}
so video URL is on scope... but again, the same error, just with a complete path this time...
WARNING: Trailing option(s) found in the command: may be ignored.
2022-06-19 22:25:08.541915-0500 videommm[7736:217682] ERROR: Optional(file:///Users/homefolder/Library/Developer/CoreSimulator/Devices/2FE26EEA-A16A-4DAA-A38E-D003C678A3A2/data/Containers/Bundle/Application/374A618D-37CB-4AC2-92E6-BD3D22185EA4/videommm.app/Earth_Zoom_In.mov): No such file or directory
In case you were wondering about my file structure:
ENTIRE ERROR LOG AFTER I TRIED
guard let input = Bundle.main.url(forResource: "Earth_Zoom_In", withExtension: "mov") else { return }
guard let outputPath = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first else { return }
let output = outputPath.appendingPathComponent("file1.mp4")
guard let session = FFmpegKit.execute("-i \(input.path) -c:v \(outputPath.path)")
(above solution by #MadProgrammer )::::
2022-06-19 22:59:42.004358-0500 videommm[8918:255076] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000140c340> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2022-06-19 22:59:42.048383-0500 videommm[8918:254980] <CATransformLayer: 0x6000014060e0> - changing property masksToBounds in transform-only layer, will have no effect
2022-06-19 22:59:42.049907-0500 videommm[8918:254980] <CATransformLayer: 0x60000143bc20> - changing property masksToBounds in transform-only layer, will have no effect
2022-06-19 22:59:42.085850-0500 videommm[8918:254980] <CATransformLayer: 0x600001408d00> - changing property masksToBounds in transform-only layer, will have no effect
2022-06-19 22:59:42.108774-0500 videommm[8918:254980] <CATransformLayer: 0x600001406e20> - changing property masksToBounds in transform-only layer, will have no effect
2022-06-19 22:59:42.110957-0500 videommm[8918:254980] <CATransformLayer: 0x60000143e0e0> - changing property masksToBounds in transform-only layer, will have no effect
2022-06-19 22:59:42.154667-0500 videommm[8918:254980] <CATransformLayer: 0x600001408d00> - changing property allowsGroupBlending in transform-only layer, will have no effect
2022-06-19 22:59:42.155013-0500 videommm[8918:254980] <CATransformLayer: 0x600001406e20> - changing property allowsGroupBlending in transform-only layer, will have no effect
2022-06-19 22:59:46.660559-0500 videommm[8918:254980] Loading ffmpeg-kit.
2022-06-19 22:59:46.663426-0500 videommm[8918:254980] Loaded ffmpeg-kit-full-x86_64-4.5.1-20220114
2022-06-19 22:59:46.664216-0500 videommm[8918:255076] INFO: ffmpeg version v4.5-dev-3393-g30322ebe3c
2022-06-19 22:59:46.664496-0500 videommm[8918:255076] INFO: Copyright (c) 2000-2021 the FFmpeg developers
2022-06-19 22:59:46.664704-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.664909-0500 videommm[8918:255076] INFO: built with Apple clang version 13.0.0 (clang-1300.0.29.30)
2022-06-19 22:59:46.665124-0500 videommm[8918:255076] INFO: configuration: --cross-prefix=x86_64-ios-darwin- --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-x86_64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=x86_64 --cpu=x86_64 --target-os=darwin --disable-neon --disable-asm --ar=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='clang -arch x86_64 -target x86_64-apple-ios12.1-simulator -march=x86-64 -msse4.2 -mpopcnt -m64 -DFFMPEG_KIT_X86_64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -DIOS -DFFMPEG_KIT_BUILD_DATE=20220114 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -O2 -mios-simulator-version-min=12.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk/usr/include' --ranlib=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --nm=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --extra-ldflags='-mios-simulator-version-min=12.1' --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-shared --disable-static --install-name-dir='#rpath' --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libdav1d --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-libzimg --disable-openssl --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
2022-06-19 22:59:46.666175-0500 videommm[8918:255076] INFO: libavutil 57. 13.100 / 57. 13.100
2022-06-19 22:59:46.666715-0500 videommm[8918:255076] INFO: libavcodec 59. 15.102 / 59. 15.102
2022-06-19 22:59:46.666956-0500 videommm[8918:255076] INFO: libavformat 59. 10.100 / 59. 10.100
2022-06-19 22:59:46.667271-0500 videommm[8918:255076] INFO: libavdevice 59. 1.100 / 59. 1.100
2022-06-19 22:59:46.667512-0500 videommm[8918:255076] INFO: libavfilter 8. 21.100 / 8. 21.100
2022-06-19 22:59:46.667769-0500 videommm[8918:255076] INFO: libswscale 6. 1.102 / 6. 1.102
2022-06-19 22:59:46.668029-0500 videommm[8918:255076] INFO: libswresample 4. 0.100 / 4. 0.100
2022-06-19 22:59:46.668221-0500 videommm[8918:255076] WARNING: Trailing option(s) found in the command: may be ignored.
2022-06-19 22:59:46.701533-0500 videommm[8918:255076] INFO: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/homefolder/Library/Developer/CoreSimulator/Devices/2FE26EEA-A16A-4DAA-A38E-D003C678A3A2/data/Containers/Bundle/Application/F4A3F78B-5582-41A0-8338-ADD05240F64D/videommm.app/Earth_Zoom_In.mov':
Command failed with state COMPLETED and rc 1.Unknown
2022-06-19 22:59:46.701781-0500 videommm[8918:255076] INFO: Metadata:
2022-06-19 22:59:46.701973-0500 videommm[8918:255076] INFO: major_brand :
2022-06-19 22:59:46.702152-0500 videommm[8918:255076] INFO: qt
2022-06-19 22:59:46.702371-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.702541-0500 videommm[8918:255076] INFO: minor_version :
2022-06-19 22:59:46.702747-0500 videommm[8918:255076] INFO: 537199360
2022-06-19 22:59:46.702938-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.703085-0500 videommm[8918:255076] INFO: compatible_brands:
2022-06-19 22:59:46.703304-0500 videommm[8918:255076] INFO: qt
2022-06-19 22:59:46.703584-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.703858-0500 videommm[8918:255076] INFO: creation_time :
2022-06-19 22:59:46.704101-0500 videommm[8918:255076] INFO: 2013-07-09T19:19:28.000000Z
2022-06-19 22:59:46.704327-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.704620-0500 videommm[8918:255076] INFO: Duration:
2022-06-19 22:59:46.704846-0500 videommm[8918:255076] INFO: 00:00:06.84
2022-06-19 22:59:46.705150-0500 videommm[8918:255076] INFO: , start:
2022-06-19 22:59:46.705409-0500 videommm[8918:255076] INFO: 0.000000
2022-06-19 22:59:46.705632-0500 videommm[8918:255076] INFO: , bitrate:
2022-06-19 22:59:46.705909-0500 videommm[8918:255076] INFO: 9824 kb/s
2022-06-19 22:59:46.706185-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.706519-0500 videommm[8918:255076] INFO: Stream #0:0
2022-06-19 22:59:46.706760-0500 videommm[8918:255076] INFO: [0x1]
2022-06-19 22:59:46.707083-0500 videommm[8918:255076] INFO: (eng)
2022-06-19 22:59:46.707377-0500 videommm[8918:255076] INFO: : Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, 9812 kb/s
2022-06-19 22:59:46.707642-0500 videommm[8918:255076] INFO: , SAR 1:1 DAR 16:9
2022-06-19 22:59:46.707947-0500 videommm[8918:255076] INFO: ,
2022-06-19 22:59:46.708306-0500 videommm[8918:255076] INFO: 25 fps,
2022-06-19 22:59:46.708617-0500 videommm[8918:255076] INFO: 25 tbr,
2022-06-19 22:59:46.708969-0500 videommm[8918:255076] INFO: 25 tbn
2022-06-19 22:59:46.709169-0500 videommm[8918:255076] INFO: (default)
2022-06-19 22:59:46.709332-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.709603-0500 videommm[8918:255076] INFO: Metadata:
2022-06-19 22:59:46.709808-0500 videommm[8918:255076] INFO: creation_time :
2022-06-19 22:59:46.710117-0500 videommm[8918:255076] INFO: 2013-07-09T19:19:28.000000Z
2022-06-19 22:59:46.710660-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.710924-0500 videommm[8918:255076] INFO: handler_name :
2022-06-19 22:59:46.711139-0500 videommm[8918:255076] INFO: Apple Video Media Handler
2022-06-19 22:59:46.711488-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.711733-0500 videommm[8918:255076] INFO: vendor_id :
2022-06-19 22:59:46.712038-0500 videommm[8918:255076] INFO: appl
2022-06-19 22:59:46.712365-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.712698-0500 videommm[8918:255076] INFO: encoder :
2022-06-19 22:59:46.712971-0500 videommm[8918:255076] INFO: H.264
2022-06-19 22:59:46.713283-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.713563-0500 videommm[8918:255076] INFO: timecode :
2022-06-19 22:59:46.713863-0500 videommm[8918:255076] INFO: 00:00:00:00
2022-06-19 22:59:46.714037-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.714353-0500 videommm[8918:255076] INFO: Stream #0:1
2022-06-19 22:59:46.714769-0500 videommm[8918:255076] INFO: [0x2]
2022-06-19 22:59:46.715138-0500 videommm[8918:255076] INFO: (eng)
2022-06-19 22:59:46.715510-0500 videommm[8918:255076] INFO: : Data: none (tmcd / 0x64636D74), 0 kb/s
2022-06-19 22:59:46.715889-0500 videommm[8918:255076] INFO: (default)
2022-06-19 22:59:46.716143-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.716460-0500 videommm[8918:255076] INFO: Metadata:
2022-06-19 22:59:46.716794-0500 videommm[8918:255076] INFO: creation_time :
2022-06-19 22:59:46.717141-0500 videommm[8918:255076] INFO: 2013-07-09T19:23:14.000000Z
2022-06-19 22:59:46.717427-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.717686-0500 videommm[8918:255076] INFO: handler_name :
2022-06-19 22:59:46.718053-0500 videommm[8918:255076] INFO: Tidskodsmediehanterare
2022-06-19 22:59:46.718412-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.718787-0500 videommm[8918:255076] INFO: timecode :
2022-06-19 22:59:46.719136-0500 videommm[8918:255076] INFO: 00:00:00:00
2022-06-19 22:59:46.719402-0500 videommm[8918:255076] INFO:
2022-06-19 22:59:46.719596-0500 videommm[8918:255076] FATAL: At least one output file must be specified
Sooo, welcome to the wonderful world of "file handling in Swift/iOS"
First, you should probably take a look at:
iOS storage best practices
FileManager
Working with files and folders in Swift
Working with Files on iOS with Swift
... and, you know what, you could probably google for more 😉
First Bundle.main.url is going to give a URL, which is helpful, but you need a String. It would start by using URL#path and test to see if that works, otherwise URL#description will be what you want (sorry, I'm vague, been awhile since I needed to this)
Next, you need somewhere to output the file to. iOS (and even MacOS) are sandboxed, so you must "ask" the system where you can write things to do. In this, I might consider using the "cache" directory, a few reasons, but mostly it won't expose the file to the user (you could store it in the "documents" directory if you wanted to)
So, all that might look something like...
guard let input = Bundle.main.url(forResource: "Earth_Zoom_In", withExtension: "mov") else { return }
guard let outputPath = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first else { return }
let output = outputPath.appendingPathComponent("file1.mp4")
Then you can use them in your command something like...
FFmpegKit.execute("-i \(input.path) -c:v \(outputPath.path)")
Now, if this fails, you need to use FFmpegKit.execute("-i \(input) -c:v \(outputPath)") instead, which will produce a file:// based URL string
nb: Based on some, very old code, I was using URL#path
Notes
File management on iOS is much more restrictive then on MacOS, you are only allowed to write within the sandboxed constraints of the App.
If you wish to "share" the file, under iOS, the .documents directory is probably preferred. You could write directly to it, or do a move/copy operation later.
Under MacOS, you may not be allowed to write to certain locations without first having specified your intent in the app's "capability" and gotten permission from the user before hand

App crash after successfully changed wallpaper

hi i'm a beginner in flutter, here i'm trying to make a wallpaper application. my application can run and change the wallpaper, my problem is why does my application crash after success?
_saving() async {
await _askPermissions();
var response = await Dio().get(
widget.imgData,
options: Options(responseType: ResponseType.bytes),
);
final result = await ImageGallerySaver.saveImage(
Uint8List.fromList(response.data), name: 'images');
print(result['filePath']);
var path = await FlutterAbsolutePath.getAbsolutePath(result['filePath']);
print(path);
String out;
try {
out = await WallpaperManager.setWallpaperFromFile(
path, WallpaperManager.HOME_SCREEN);
} on PlatformException {
out = 'Failed to get wallpaper.';
}
}
i am getting this log
D/EGL_emulation(26450): app_time_stats: avg=1550.15ms min=19.34ms max=12037.74ms count=8
I/System.out(26450): ImageGallerySaverPlugin 80
I/flutter (26450): content://media/external/images/media/90
I/flutter (26450): /data/user/0/realfz.flutter.xeed.xeed/cache/IMG_1645634589898.png
E/FA (26450): Missing google_app_id. Firebase Analytics disabled.
D/EGL_emulation(26450): eglCreateContext: 0x7d36c51db690: maj 2 min 0 rcv 2
D/EGL_emulation(26450): eglCreateContext: 0x7d36c51de750: maj 2 min 0 rcv 2
D/HostConnection(26450): createUnique: call
D/HostConnection(26450): HostConnection::get() New Host Connection established 0x7d36c51df950, tid 27786
D/HostConnection(26450): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
D/EGL_emulation(26450): eglMakeCurrent: 0x7d36c51de750: ver 2 0 (tinfo 0x7d38ea0a7200) (first time)
I/Choreographer(26450): Skipped 49 frames! The application may be doing too much work on its main thread.
D/HostConnection(26450): createUnique: call
D/HostConnection(26450): HostConnection::get() New Host Connection established 0x7d36c51e36d0, tid 27785
D/HostConnection(26450): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
D/EGL_emulation(26450): eglMakeCurrent: 0x7d36c51db690: ver 2 0 (tinfo 0x7d38ea0a7100) (first time)
D/EGL_emulation(26450): eglCreateContext: 0x7d36c51e30d0: maj 2 min 0 rcv 2
I/Choreographer(26450): Skipped 109 frames! The application may be doing too much work on its main thread.
I/OpenGLRenderer(26450): Davey! duration=2649ms; Flags=1, FrameTimelineVsyncId=113284, IntendedVsync=47817620015088, Vsync=47818436681722, InputEventId=0, HandleInputStart=47818446770100, AnimationStart=47818446842400, PerformTraversalsStart=47818446945100, DrawStart=47820247194700, FrameDeadline=47817636681754, FrameInterval=47818446237700, FrameStartTime=16666666, SyncQueued=47820248422100, SyncStart=47820248873100, IssueDrawCommandsStart=47820249153600, SwapBuffers=47820251098700, FrameCompleted=47820270211800, DequeueBufferDuration=10092300, QueueBufferDuration=2055700, GpuCompleted=47820259923000, SwapBuffersCompleted=47820270211800, DisplayPresentTime=8589934592,
sorry

Can i avoid this error. E/InputMethodManager: Failed to get fallback IMM with expected .flutter.plugins.webviewflutter.InputAwareWebView

I'm Using the flutter_tex library
flutter_tex
flutter_tex: ^3.6.7+10
I want to release the app in the play store. My app is running fine. But I'm getting this message in the Debug Console.
Can I Avoid It?
TeXView(
renderingEngine: const TeXViewRenderingEngine.katex(),
child: TeXViewDocument('\$\$$text\$\$'),
),
Getting this error:
E/InputMethodManager(28630): b/117267690: Failed to get fallback IMM with expected displayId=137 actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{86b4162 VFEDHVC.. ........ 0,0-864,188}
E/InputMethodManager(28630): b/117267690: Failed to get fallback IMM with expected displayId=137
actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{86b4162 VFEDHVC..
........ 0,0-864,188}
D/EGL_emulation(28630): eglMakeCurrent: 0x963e0360: ver 2 0 (tinfo 0xebe0dce0)
E/InputMethodManager(28630): b/117267690: Failed to get fallback IMM with expected displayId=138
actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{47b28d1 VFEDHVC..
........ 0,0-864,188}
D/HostConnection(28630): HostConnection::get() New Host Connection established 0x6bd973d0, tid 28933
D/HostConnection(28630): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2
ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings
ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache
ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync
ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit
GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing
ANDROID_EMU_gles_max_version_2
E/InputMethodManager(28630): b/117267690: Failed to get fallback IMM with expected displayId=139
actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{d55bd6b VFEDHVC..
........ 0,0-864,188}
E/InputMethodManager(28630): b/117267690: Failed to get fallback IMM with expected displayId=140
actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{24c90e0 VFEDHVC..
........ 0,0-864,188}
Is this safe to not care about this.
We have to enable hybrid composition, set WebView.platform = SurfaceAndroidWebView();
You can look at this github link https://github.com/flutter/flutter/issues/40716#issuecomment-708076795. This helped me solve this error.
This problem is due to clicking on this widget and will not be fixed by resetting or deleting the build files.
All you have to do is design an operation that clicks on this widget or add a read-only feature to it, and this will solve the problem.
Your day without bugs!
Had the same problem. A clean rebuild of the project fixed it.

Problem with Debian 10, Eclipse, C when linking GTK3 libs

I am using Debian 10, GTK3 (package libgtk-3-dev), CDT, GCC. Compiling and linking by command line / shell ($1-parameter) works fine:
gcc `pkg-config --cflags gtk+-3.0` $1.c -o $1 `pkg-config --libs gtk+-3.0`
I installed Codeblocks and changed the compiler and linker settings due to command line options, it works as well.
But I want to use Eclipse (2019-03) as IDE as I am used to it.
Installation of pkg-config plugin via Marketplace failed (compatibilty problem).
So I changed compiler and linker settings, replacing pkg-config (didn't work) with its contents.
Compiler settings:
-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
Linker settings:
-lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
Program:
#include <gtk/gtk.h>
void on_button_clicked (GtkButton *button) {
g_print ("button '%s' clicked\n", gtk_button_get_label (button));
}
int main (int argc, char *argv[]) {
GtkWidget *window, *button;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
button = gtk_button_new_with_label ("Hallo Michel");
gtk_container_add (GTK_CONTAINER (window), button);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
g_signal_connect (button, "clicked", G_CALLBACK (on_button_clicked), NULL);
gtk_widget_show_all (window);
gtk_main ();
return 0;
}
Compilation works (.o-file created), debugging is possible, but linking fails:
Eclipse Console output:
Building target: GTK3
Invoking: GCC C Linker
gcc -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -o "GTK3" ./gtk_test.o
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [makefile:31: GTK3] Fehler 1
"make all" terminated with exit code 2. Build might be incomplete.
Eclipse Problems output:
/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': GTK3 C/C++ Problem
make: *** [makefile:31: GTK3] Fehler 1 GTK3 C/C++ Problem
Type 'GTK_CONTAINER (window)' could not be resolved gtk_test.c /GTK3 line 14 Semantic Error
Type 'GTK_CONTAINER (window)' could not be resolved gtk_test.c /GTK3 line 17 Semantic Error
Type 'GTK_WINDOW (window)' could not be resolved gtk_test.c /GTK3 line 13 Semantic Error
undefined reference to `main' GTK3 C/C++ Problem
Who knows what to do?
Thanks in advance
Michel

Too many logs in flutter app when touch on screen

i have created new project in flutter and not added any single line in that default project still
it displays logs every time i touch on screen.
i think it is because of android 10 device.
anyone have any idea?
it gives below log every time i touch on screen
D/ColorViewRootUtil(29111): nav gesture mode swipeFromBottom ignore false downY 1325 mScreenHeight 2340 mScreenWidth 1080 mStatusBarHeight 54 globalScale 1.125 nav mode 3 event MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=425.0, y[0]=1325.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=11694678, downTime=11694678, deviceId=7, source=0x1002, displayId=0 } rotation 0
if you are using flutter sdk version v1.12.13+hotfix.8 you may face this issue because it is not stable.