textureview

Replace the camera stream in a Wikitude ArchitectView with an external video stream

对着背影说爱祢 提交于 2019-12-25 08:34:00
问题 I'm working on an Android mobile app oriented to the real time augmented visualization of a drone's camera view (specifically I'm working on a DJI Phantom 3 Professional with relative SDK). I'm using Wikitude framework for the AR part. Every Wikitude sample works by augmenting the smartphone's camera view, so I need to redirect the input video stream. At this stage, by using the DJI SDK features, I have a TextureView object containing the correctly decoded stream coming from the drone. The

Record frames displayed on TextureView to mp4

纵饮孤独 提交于 2019-12-24 10:48:01
问题 I managed to write a demo displaying a 3D model on TextureView and the model can move according to the sensors of the phone. The 3D engine is wrote by C++ and what I need to do is giving the SurfaceTexture of TextureView to the 3D engine. The engine calls the function ANativeWindow_fromSurface to retrieve a native window and draw 3D model on it. 3D engine is not the key point I want to talk about in this question. Now I want to record the moving 3d model to a video. One way is using GL

(RK3399)使用TextureView+MediaPlayer实现视频播放器

做~自己de王妃 提交于 2019-12-24 05:09:48
(RK3399)使用TextureView+MediaPlayer实现视频播放器 为何使用TextureView SurfaceView TextureView 遇到的问题 测试 总结 为何使用TextureView 原因是公司导师要求,原本RkVideoPlayer是用的SurfaceView,现在给我的任务就是使用TextureView来替换SurfaceView。原因是原本使用SurfaceView,在播放中按电源键休眠,再打开,视频会暂停,不会继续播放,所以替换成TextureView看看是不是能继续播放。那么就先来看一下TextureView和SurfaceView的区别吧。 SurfaceView和TextureView均继承于android.view.View,与其它View不同的是,两者都能在独立的线程中绘制和渲染,在专用的GPU线程中大大提高渲染的性能。 对于SurfaceView来说,1.不能加上动画、平移、缩放;2.两个SurfaceView不能相互覆盖; 而TextureView更像是一般的View,像TextView那样能被缩放、平移,也能加上动画,还有必须在开启了硬件加速的window里使用。 弄清楚了这俩的区别以后,就开始研究研究具体如何替换吧。 SurfaceView public class VideoDisplayView extends

Android multiple camera preview

一个人想着一个人 提交于 2019-12-23 12:44:09
问题 Is it possible to broadcast the android camera preview into 2 different SurfaceView controls at the same time? I have seen some apps that show effects into different previews in real-time, how do they achieve that? I read about the TextureView, is this the view to use? where can I find examples of multiple simultaneous camera previews? Thanks 回答1: I don't think that it is possible to independently open 2 camera previews at the same time, as the camera is treated as a shared resource. However,

Z-order issue with MediaCodec and TextureView

痴心易碎 提交于 2019-12-22 21:26:07
问题 In my Android app I have the need to render three views with the following Z-order: At bottom, the output surface of a MediaCodec decoder covering the whole screen. I have the requirement that I have to transform the image produced by MediaCodec (e.g. scale it) In the middle, a GLSurfaceView (or other surface/view running GL shaders I define), covering the whole screen. Obviously some of the pixels in this layer will be transparent, in order to see the MediaCodec output beneath. On top, any

How to apply video effects (filters like sepia, vintage, etc.) on TextureView in android?

柔情痞子 提交于 2019-12-22 05:22:00
问题 How can we apply filters like sepia, vintage, etc. to a video, and consequently post the same on our servers? Likewise, we can bluff user by creating a filter layer on TextureView, and consequently applying the corresponding filter on the server. CODE : package com.example.mediaplayerdemo_video; import java.io.IOException; import android.app.Activity; import android.content.res.AssetFileDescriptor; import android.graphics.Matrix; import android.graphics.SurfaceTexture; import android.media

How to apply video effects (filters like sepia, vintage, etc.) on TextureView in android?

两盒软妹~` 提交于 2019-12-22 05:21:16
问题 How can we apply filters like sepia, vintage, etc. to a video, and consequently post the same on our servers? Likewise, we can bluff user by creating a filter layer on TextureView, and consequently applying the corresponding filter on the server. CODE : package com.example.mediaplayerdemo_video; import java.io.IOException; import android.app.Activity; import android.content.res.AssetFileDescriptor; import android.graphics.Matrix; import android.graphics.SurfaceTexture; import android.media

How to clear SurfaceTexture after using it with a MediaPlayer?

我是研究僧i 提交于 2019-12-21 03:42:52
问题 I'm using a ListView with TextureView children. The TextureView uses a MediaPlayer to play videos. When the TextureView gets recycled, the last frame remains on the surface until the next MediaPlayer makes use of it. What is the easiest way to "clear" the TextureView's surface (e.g black) so the old frames do not appear? 回答1: After struggling with this for a while, I've come up with a couple of possible solutions: a) clear the surface using GLES. You can see an example in Grafika (check out

Android TextureView / Drawing / Painting Performance

流过昼夜 提交于 2019-12-18 12:07:54
问题 I am attempting to make a drawing/painting app using TextureView on Android. I want to support a drawing surface of up to 4096x4096 pixels, which seems reasonable for my minimum target device (which I use for testing) which is a Google Nexus 7 2013 which has a nice quad core CPU and 2GB memory. One of my requirements is that my view must be inside of a view that allows it to be zoomed in and out and panned, which is all custom code I have written (think UIScrollView from iOS). I've tried

MediaPlayer cannot render to TextureView after image render

与世无争的帅哥 提交于 2019-12-17 19:48:13
问题 I have a MediaPlayer rendering videos to a TextureView . This is working. Now, I want to display a still image on this TextureView for a given time, then get the MediaPlayer to render a video to the same TextureView . Here's my code to render the bitmap: Canvas canvas = mTextureView.lockCanvas(); canvas.drawBitmap(sourceBitmap, matrix, new Paint()); mTextureView.unlockCanvasAndPost(canvas); After this, any attempts to play videos result in ERROR_INVALID_OPERATION (-38) being triggered from