surfaceview

Android Camera Live Filter

限于喜欢 提交于 2019-12-04 04:44:33
What is the best way for Camera Live filters. I am recently using GPUImage Library from Link: https://github.com/CyberAgent/android-gpuimagelibrary . Than I have found SurfaceView and GLSurfaceView. Problem is: How to apply live filter to camera using SurfaceView or GLSurfaceView. Thanks in advance. DAVE This link uses Texture View https://github.com/google/grafika/blob/master/app/src/main/java/com/android/grafika/LiveCameraActivity.java This uses surface view to play a movie..u can manipulate it for live camera https://github.com/google/grafika/blob/master/app/src/main/java/com/android

How to get HTML5 video URI in HTML5VFullScreen$SurfaceVideoView in Android 4.0?

做~自己de王妃 提交于 2019-12-04 03:47:39
I am trying to get a HTML5 video URI when the user clicks the fullscreen button in the video control bar. According to this , the HTML5 video view in Android 4.0 is a SurfaceView, not a VideoView. Could someone tell me how to get the URI in SurfaceVideoView? This is my code. Thanks a lot. webView.setWebChromeClient(new WebChromeClient(){ @Override public void onShowCustomView(View view, CustomViewCallback callback) { super.onShowCustomView(view, callback); if (view instanceof FrameLayout){ final FrameLayout frame = (FrameLayout) view; if (frame.getFocusedChild() instanceof SurfaceView){

How to use camera live feed as a activity background?

只愿长相守 提交于 2019-12-04 03:20:10
I am trying to make an App in which I need to use camera live feed as a background. (I know its a stupid thing to do but can't help, its a client demand). I have tried doing it using SurfaceView but no success so far. So far whatever I found on Stack Overflow are more of a guesses or directions how to do it but no real time examples or code help is out there. It would be great if someone who has done this before share a piece of code with Stack Overflow users like me. Take a look here: http://developer.android.com/guide/topics/media/camera.html There is all the code you need to make an

Getting Bitmap from Custom SurfaceView

可紊 提交于 2019-12-04 02:45:51
I have this code in a class that extends surface view and implements runnable I am able to use the class basically allows you to draw to the canvas using different colors and such. I'm trying to get a method that will allow me to save the image after it is drawn and this is the method. No matter what i do i just get a black image with nothing on it. Any ideas? I have cache drawing enabled Objective get a bitmap image from a custom SurfaceView I have exhausted options of looking at some other post on here and didn't find anything to work. Here is hoping that there is recently a new solution to

Android: Is it possible to have two surfaceview on top of each other?

本小妞迷上赌 提交于 2019-12-04 02:25:58
My idea is to have two surfaceViews. One surfaceView which will hold an image (say ImageSurgaceView) and second surface that lie on top of the first one which holds the annotations (say AnnotationSurfaceView) like circle, rectangle etc. Now I have to map these surface views such that the height, width are same and moreover, both the surface view should move on drag i.e share the touch events. To be precise, when I move the image up the annotations should also move up. Now, I am not sure if this is possible in android. Can any one tell or share some info on this. I don't have any implementation

When does surfaceDestroyed() occur

一世执手 提交于 2019-12-04 02:02:19
I'm having trouble figuring out when surfaceDestroyed() occurs. I am trying to make my threads stop running in the surfaceDestroyed() method (of a SurfaceView) but it appears that my surface is never actually destroyed...can someone tell me when this happens? Or how to trigger it? Lumis Whenever you click return or home button and leave the activity you get: Activity onPause surfaceDestroyed and finally activity onDestroyed. When you return the surfaceView is recreated, however if you have been using static variables do drive the application, they will be often preserved and it may only seem

Pausing threads properly onPause() and onResume() with a SurfaceView and Thread in Android

有些话、适合烂在心里 提交于 2019-12-03 20:57:45
To run the games that I've created on Android, I've been using a GamePanel contains the methods onDraw() and onTouch(). I also have been using a GameThread class that calls onDraw() and update() repeatedly. My activity instantiates the GamePanel and my GamePanel instantiates the GameThread. My onPause() just sets the condition in the while-loop inside the thread, run, to false. My onResume() used to just set that equal to true, however that would give me a force close error ( see edit #1 ) every time I tried to resume the app. So instead to fix the problem I just re-instantiated the thread,

视频02.MediaPlayer和VideoView,TextureView的使用

戏子无情 提交于 2019-12-03 18:32:08
目录介绍 1.关于此视频封装库介绍 1.1 MediaPlayer简单介绍 2.相关方法详解 2.1 获得MediaPlayer实例 2.2 设置播放文件 2.3 其他方法 3.生命周期 3.1 生命周期图[摘自网络] 3.2 周期状态说明 4.播放视频 4.1 播放res/raw音频文件 4.2 播放本地Uri 4.3 播放网络文件 5.MediaPlayer + SurfaceView播放视频 5.1 为什么要这样 5.2 案例展示 5.3 SurfaceView局限性 6.VideoView播放视频 6.1 VideoView介绍 6.2 使用方法代码 7.MediaPlayer+TextureView 7.1 为什么使用TextureView 7.2 如何实现视频播放功能 好消息 博客笔记大汇总【16年3月到至今】,包括Java基础及深入知识点,Android技术博客,Python学习笔记等等,还包括平时开发中遇到的bug汇总,当然也在工作之余收集了大量的面试题,长期更新维护并且修正,持续完善……开源的文件是markdown格式的!同时也开源了生活博客,从12年起,积累共计47篇[近20万字],转载请注明出处,谢谢! 链接地址: https://github.com/yangchong211/YCBlogs 如果觉得好,可以star一下,谢谢!当然也欢迎提出建议

Android SurfaceView slows if no touch events occur

情到浓时终转凉″ 提交于 2019-12-03 17:33:26
I am making a game and all is going well except for the game loop. I am using a SurfaceView and drawing 2D Sprites (Bitmaps). Currently the game is a ship moving through an asteroid field. The ship stays in the center of the screen and the phone is tilted in either direction to move the the asteroids (asteroids change location instead of player). New asteroids spawn as old ones fall off the screen creating an infinite asteroid field feeling. Running on my Nexus 5, I noticed that after about 3 seconds, the asteroids moving down the screen became choppy, despite my game loop set to run at 60fps.

Fastest way to draw a MediaCodec-decoded video frame to screen?

回眸只為那壹抹淺笑 提交于 2019-12-03 14:44:15
I'm looking for the fastest way to take an image frame received from the MediaCodec decoder and draw it to the Android device screen. The important constraints and explanations are: Cannot use MediaPlayer. No intermediate app allowed. Must draw output frames from the MediaCodec decoder to the screen as quickly as possible (minimize latency). The available decoder output formats are as follows: ColorFormat[0] 0x00000013 COLOR_FormatYUV420Planar ColorFormat[1] 0x00000015 COLOR_FormatYUV420SemiPlanar ColorFormat[2] 0x7F000001 OMX_SEC_COLOR_FormatNV12TPhysicalAddress ColorFormat[3] 0x7FC00002 OMX