Android SurfaceView black screen on Galaxy S - android

Hi I am wondering what the problem with the galaxy S is. I am using both a nexus S and a galaxy S phones for testing purposes. My whole app works pretty well on Nexus one. But when it comes to Galaxy S I cant see any video. Just hear audio.
Like I said above this doesn't happen on Nexus S. Is there something about the Galaxy S that messes with the SurfaceView? Sometimes I get a quick flash of the video before the screen goes black. My menu's and such still show up just not the video. Any help would be greatly appreciated. If you have know how to fix this kind of problem please help. I will add relevant code if necessary
I know for a fact that the video is playing because in one of the methods that stats the video player i put a logcat which tells me that video is starting to play.
Is it possible that the surface view is being hidden for some reason on the galaxy S?

I'm not sure if this is relevant to you, but i had a similar issue with image assets not displaying on this phone, turns out i needed to use the layout-xhdpi, even though all other phones would default to the standard image in the 'layout' directory

I finally figured out what the Problem was. I am changing some settings in for the aspect ratio. This somehow stops the image from showing up. I will update when i have found a solution.
Edit:
I call setAspectRatio on my my Video after it has been prepared and the video has started in the onPreparedListener.
Edit 2:
The best way around this error is to change the aspect Ration after VideSizeChanged listener is called the first time, as that is when the first dimensions of the video are found.

Related

Unity/ARCore on Samsung Galaxy S8 - camera image is stretched

I started playing around with ARCore through unity and testing on a Samsung galaxy S8.
Everything seems to be working fine but the video image that is displayed in the background (done automatically by ARCore) appears stretched vertically. I know the camera aspect on that device doesn't match the weird aspect of the phone's screen but I couldn't find a way to work around this.
This also happens when I build the small sample that comes with the ARCore package. Anyone else run into this?
Seems like a bug in the Unity implementation of ARCore according to this thread.
For those interested, We actually ended up doing fancy shader work to 'un-stretch' the image while pre-stretching all our content so we end up with a correct image - pretty ugly solution and I will happily yank this part out of the project as soon as a fix is issued.

Why is Three.js video not rendering on my Nexus 7

Trying to run the Three.js examples on the Nexus 7 and most of them work fine.
But im particularly interested in getting webgl video rendering to work on my nexus 7 device and this doesn't seem to work. All im getting is a black screen where the video is supposed to render, the rest surrounding the video renders just as normal.
My Nexus 7 is running android 4.4.4 & Chrome 36.0.1985.135 and im not seeing any console errors when running these examples.
The examples that don't work are:
https://github.com/mrdoob/three.js/blob/master/examples/canvas_materials_video.html
https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_video.html
My assumption (and from what i read) is that this could have something to do with the texture size, its needs to be the power of 2. Do you guys have any clue on why its not working and what i could try to get it working?
Many thanks for your help already
Best,
Erik
I'm just guessing but AFAIK videos don't autoplay on mobile devices. To fix the issue you need to make the user click something and in the handler for that click start the video playing. The easiest way might be to make a fullscreen div with no content that has its css z-index set to something so it's above everything else. Once the user clicks it start the video and remove it.

Andengine Live wallpaper slow reload

After making many live wallpapers in andengine , this is the only problem i still face with andengine.
When i used original extension, When rotating device and returning to home screen from apps there was a blink of screen(unscaled background) and 0,5 sec lag (resources reloading). But i had seen many live wallpapers with out any issue.
And i had seen this problem mainly in some devices, my tab Iberry give this issue where as Samsung tab don't produce this issue, and as this issue don't give out any error, i cant find it as a report for my App.
Problem thread
I had seen this problem being faced by many http://www.andengine.org/forums/live-wallpaper-extension/slow-reload-after-onresume-t4183-70.html
temporary Solution
I had Tried out a solution too https://github.com/gigiigig/AndengineLiveWallpaperExtensionImproved
But it has many other problems, So i hope someone can help to find a solution to the slow reload problem that makes the andengine Live wallpaper extension a Question.

Galaxy S3 Video Recording via API "rolls" or is corrupted in Bright Light

Following the instructions from Google here exactly as it is (QUALITY_HIGH):
http://developer.android.com/guide/topics/media/camera.html#custom-camera
When doing this with a Galaxy S3 (US Version) everything seems fine in indoor lighting. But when the camera goes outside and it is bright (maybe it needs to increase the shutter speed) something strange happens. The video starts "rolling" like a bad TV signal, and the image gets to be very low quality. It almost seems like the image sensor got overloaded and messed up.
I tried recording with the normal camera application and it seems to have no problems under the same condition. But using the API as described here generates this problem. Since the S3 is pretty popular -- anyone run into this problem before?
Is there some kind of hidden setting that the main camera app uses for camera setup? I tried flattening the camera settings to take a look at what's in there and there are tons of settings but i dont know what they all do without documentation. already tried turning off anti-banding and luma-adaptation and that didnt seem to do anything.
Thanks!
I think I figured it out. Need more testing but this seems to do it. There is a hidden setting called "camera-mode" that is normally set to -1. I changed it to a 1 and suddenly it is fine and functioning like the normal camera app.. anyone know what this mode thing actually means?
Camera.Parameters lParam = prCamera.getParameters();
lParam.set("camera-mode",1);
prCamera.setParameters(lParam);
Is what did the trick if anyone else seems to run into the problem.\

How to set camera resolution in Android with OpenCV?

I'm trying to develop an app for Android, and I would need to get uncompressed pictures with a resolution as high as possible from the camera. I tried takePicture's rawCallback and postviewCallback, but they are not working.
Right now I'm trying with OpenCV (version 2.4) using VideoCapture, but I'm stuck in the default 960x720, which is poor for what I need; and my phone, a Samsung Galaxy S3, is able to provide, theoretically, up to 8Mpx (3,264×2,448 for pictures, and 1,920×1,080 for video, according to Wikipedia). VideoCapture.set(Highgui.CV_CAP_PROP_FRAME_WIDTH/HEIGHT, some number) makes the camera return a black image as far as I've found.
Is there any way to obtain a higher resolution, either through OpenCV or with the Android API, without compressing?
I'm really sorry if this has been asked before; I have been looking for days and I have found nothing.
Thank you for your time!
EDIT: Although it is not exactly what I was asking, I found that there is a way to do something very similar: if you set an OnPreviewCallback for the Camera, using setPreviewCallback, you do get the raw picture data from the camera (at least in the S3 I'm working with). I leave it here in case somebody finds it useful in the future.
EDIT: A partial solution is explained in an answer below. To sum up,
vc.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, desiredFrameWidth);
vc.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, desiredFrameHeight);
works under some conditions; please see below for further detail.
You have to get supported camera preview resoultions by calling getSupportedPreviewSizes.
After this you can set any resolution with method setPreviewSize. And don't forget to setParameters in the end. Actally many OpenCV Android examples contain this information (look at sample3).
In case anybody ever finds this useful, I found a (partial) solution: If your VideoCapture variable is called vc, this should work:
vc.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, desiredFrameWidth);
vc.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, desiredFrameHeight);
Mind that the combination of width and height must be one of the supported picture formats for your camera, otherwise it will just get a black image. You can get those through Camera.Parameters.getSupportedPictureSizes().
However, setting a high resolution appears to exceed the YUV conversion buffer's capacity, so I'm still struggling with that. I'm going to make a new separate question for that, to keep everything clearer: new thread
setPreviewSize does not set picture resolution. setPictureSize does.

Categories

Resources