surfaceview

SurfaceView in widget

十年热恋 提交于 2019-12-11 02:26:10
问题 I am implementing a widget for TV application in which I want to show streaming so I have to place SurfaceView in it. As widget has RemoteViews, how can I use SurfaceView to set value of SurfaceHolder ? I have defined SurfaceView in xml. I have searched on internet but didn't find any help. I want instance of SurfaceView so that I can play with it. 回答1: As widget has RemoteViews, how can I use SurfaceView That is not possible. SurfaceView is not available for use with app widgets, as is

Adapting Grafika RecordFBOActivity to work with Android GPUImage

柔情痞子 提交于 2019-12-11 02:21:23
问题 I have an application that is using the Android port of GPUImage as the OpenGL Renderer and manager of several filters. It currently does not have a video implementation, so I am trying to adapt the RecordFBOActivity from the Google grafika repository to work with the GPUImage architecture. The base GPUImage class manages the GLContext and GLSurfaceView, and the GPUImageRenderer class implements the Renderer class. This is the class where I am trying to adapt the RenderThread from the

SurfaceView in Android Wear (API 21)

∥☆過路亽.° 提交于 2019-12-11 02:17:49
问题 I want to use a SurfaceView in an Android Wear project in order to render a parallax background (see attached screenie). The problem: the SurfaceView disappears after about 1000ms but the car remains so there is a pink car on a black background. The SurfaceView is added via XML layout definition: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

Button on top of SurfaceView with setZOrderOnTop set to true in Android

本秂侑毒 提交于 2019-12-11 01:45:22
问题 I have two surfaceviews in an app and one surfaceview needs to overlap the other surfaceview. For example, say there are two surfaceviews SurfaceView A and SurfaceView B. B needs to be on top of A which is accomplished by setting setZOrderOnTop(true) on B. Now, I want to display some text or buttons on top of B but because it has Z order set as true the text or buttons added doesn't show on top but come underneath it. If the setZOrderOnTop property is not set then the text views and buttons

What is the use of calling SurfaceHolder.setFixedSize()?

自闭症网瘾萝莉.ら 提交于 2019-12-11 00:39:51
问题 I have similar code to many examples floating around the net: mSurfaceHolder = mVideoSurface.getHolder(); mSurfaceHolder.addCallback(this); mSurfaceHolder.setFormat(PixelFormat.TRANSPARENT); mSurfaceHolder.setFixedSize(20, 10); Then in the callbacks I have: @Override public void surfaceCreated(SurfaceHolder holder) { Log.d(TAG, "SurfaceCreated"); mSurfaceHolder.setFixedSize(20, 10); } @Override public void surfaceChanged( SurfaceHolder holder, int format, int width, int height ) { Log.d(TAG,

How to display a scaled down GL ES texture without clamp or repeat on android

感情迁移 提交于 2019-12-10 23:59:22
问题 I am currently rendering a camera preview using GL ES 2.0 on android to a SurfaceTexture, rendering it with opengl, then transferring it to a media codec's input surface to for recording. It is displayed to the user in a surface view and by setting that surface view's aspect ratio the camera preview is not distorted based on screen size. The recording is in portrait, but at some point the incoming texture will start coming in landscape, at which point I'd like to zoom out and display it as a

Touch events and gestures in surface view

倾然丶 夕夏残阳落幕 提交于 2019-12-10 23:33:02
问题 Can anybody point me to some classes or suggest anything for the following case? I have SurfaceView which has a background image, on top of which I wish to paint other bitmaps. I would like to support following operations: on single tap new bitmap is added on top of background, on double tap bitmap at given position is removed, on tap&move (like drag&drop) bitmap is moving, on press and move surface view is scrolling, on pinch out/pinch in surface view is scaling accordingly. Is this doable

Camera Preview appearing really slow in Android

£可爱£侵袭症+ 提交于 2019-12-10 23:05:47
问题 I am displaying Camera Preview on a Fragment through Surface View. I got everything working fine but the thing that is annoying me is that it takes about 4-5 seconds to start the Preview and things like 'Stop ' during the duration : My XML Files for the SurfaceView which i host in FrameLayout is actually a FrameLayout Instead of a SurfaceView . Is it due to this the Preview takes time. If not So , What May be the Reason behind the Lag. Any Help would be greatly appreciated The Code for the

How to draw to Canvas from SurfaceView?

我的梦境 提交于 2019-12-10 19:05:42
问题 I'm trying to do simple painter. The problem that it looks like Android has three independent Canvas and give me it for drawing sequentially. I made UI with SurfaceView , took Holder from it. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sv = (SurfaceView) findViewById(R.id.sv); holder = sv.getHolder(); holder.addCallback(callback); } Then took Surface. @Override public void surfaceCreated

How to draw a bitmap to a SurfaceView?

孤者浪人 提交于 2019-12-10 18:08:30
问题 I am trying to draw a bitmap to my SurfaceView actually with the following code: (this will be run in another Thread and in a while , because it needs to refresh the SurfaceView ). while (true) { try { // Enable drawing // ERROR LINE! Canvas ca = mPreview2.Holder.LockCanvas(); // Get current frame Bitmap test = mediaPlayer.CurrentFrame; // Actual drawing Paint paint = new Paint(); ca.DrawBitmap(test, 0, 0, paint); // Stop drawing mPreview2.Holder.UnlockCanvasAndPost(ca); } catch (Exception ex