surfaceview

Antialiasing in TextureView

我的梦境 提交于 2019-11-30 14:08:58
问题 I tried to play the same video with a SurfaceView and a TextureView and noticed that the image rendered with the TextureView is more aliased (less 'smooth') than with the SurfaceView . What is the reason for this ? Is there any way to configure rendering of TextureView to look better ? The TextureView is used like this: TextureView textureView = new TextureView(this); textureView.setSurfaceTextureListener(new SurfaceTextureListener() { @Override public void onSurfaceTextureAvailable

Difference between SurfaceView and GLSurfaceView in Android

老子叫甜甜 提交于 2019-11-30 13:53:27
问题 Can anyone tell me what the basic difference is between SurfaceView and GLSurfaceView? When should I use SurfaceView, and when should I use GLSurfaceView? I read some already answered questions on Stack Overflow, but they did not satisfy my queries. Any help would be appreciated. 回答1: A GLSurfaceView is a SurfaceView that you can render into with OpenGL. Choosing between them is simple: If you're familiar with OpenGL and need what it provides, use a GLSurfaceView . Otherwise, use a

SurfaceView in Layout

流过昼夜 提交于 2019-11-30 13:50:40
So I've done a lot of searching but still can't seem to find the exact reason as to why my SurfaceView won't display. Here's a little background as to what I'm doing: I have a Linear Layout that is set Horizontally. It contains an ImageView, then a vertical Linear Layout, and finally another ImageView. In the vertical Linear Layout, there are essential three things: another ImageView at the top, an extended SurfaceView (called MagnetView) and an ImageView below that. Here's the xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"

How can I make a SurfaceView larger than the screen?

谁说我不能喝 提交于 2019-11-30 11:41:13
I would like to effectively make a simple digital zoom for the camera preview, so I thought I would simply resize my SurfaceView to be larger than the screen. Other questions (such as 3813049 ) seem to indicate that this is easy, so I created the sample code below which I expect to let me see only half of the image horizontally (since the SurfaceView is twice as wide as the screen) and have the image only take up half of the screen horizontally. However, running it (when targeted to SDK version 4 on my Thunderbolt with Android 2.2.1) results in being able to see the whole image horizontally

Resize/Scaling down a YouTubePlayerFragment while video is playing

三世轮回 提交于 2019-11-30 10:46:55
I am trying to replicate the video minimization in the Youtube app as shown here . In order to achieve this, I've tried using the Draggable Panel library. When I ran the sample, I noticed that the video does not scale but rather crops when minimized during playback. When the video is stopped (not paused) and displaying a thumbnail, the view scales as its supposed to. I read on another question that YouTubePlayerView is implemented with a SurfaceView. I also read in the docs that SurfaceView behaves differently from a normal view because of how it punches a hole in the screen. I believe because

Drawing to a SurfaceView in Android

给你一囗甜甜゛ 提交于 2019-11-30 10:35:52
I'm trying to do some very simple drawing into a SurfaceView but I can't get it working. There are no exceptions, but I don't see any result either. More precisely, I'm trying to create a SurfaceView and fill it with a single colour. Here goes my code: public class SvetlinSurfaceViewTestActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SurfaceRenderer renderer = new SurfaceRenderer(this); setContentView(renderer); } } class SurfaceRenderer extends ViewGroup implements

Antialiasing in TextureView

拈花ヽ惹草 提交于 2019-11-30 09:51:17
I tried to play the same video with a SurfaceView and a TextureView and noticed that the image rendered with the TextureView is more aliased (less 'smooth') than with the SurfaceView . What is the reason for this ? Is there any way to configure rendering of TextureView to look better ? The TextureView is used like this: TextureView textureView = new TextureView(this); textureView.setSurfaceTextureListener(new SurfaceTextureListener() { @Override public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height) { Log.i("test", "onSurfaceTextureAvailable()");

OpenGL example to render bitmap to MediaCodec surface

一世执手 提交于 2019-11-30 09:34:04
问题 I am looking for an example on how to render a bitmap to the surface provided by MediaCodec so I can encode and then mux them into mp4 video. The closest well know example I see is this EncodeAndMuxTest. Unfortunately with my limited OpenGL knowledge I have not been able to convert the example to use bitmaps instead of the raw OpenGL Frames it currently generates. Here is the example's Frame generation Method. private void generateSurfaceFrame(int frameIndex) { frameIndex %= 8; int startX,

Resizing surface view for aspect ratio change in video display in android

大憨熊 提交于 2019-11-30 08:55:50
I am working on a video conferencing project. My video display is using surface view. Now during a video call there is a chance of aspect ratio change for the incoming frames. So i have tried the following code for it public void surfaceResize() { // WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); Point size = new Point(); int screenWidth = 0; //Get the SurfaceView layout parameters float aspectRatio = (float) recv_frame_width / recv_frame_height; if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { //Get the width of

Difference between SurfaceView and GLSurfaceView in Android

女生的网名这么多〃 提交于 2019-11-30 08:48:24
Can anyone tell me what the basic difference is between SurfaceView and GLSurfaceView? When should I use SurfaceView, and when should I use GLSurfaceView? I read some already answered questions on Stack Overflow, but they did not satisfy my queries. Any help would be appreciated. A GLSurfaceView is a SurfaceView that you can render into with OpenGL. Choosing between them is simple: If you're familiar with OpenGL and need what it provides, use a GLSurfaceView . Otherwise, use a SurfaceView . OpenGL is low-level. If you're not already familiar with it, it's an undertaking to learn. If you only