Después de pasar un tiempo en él, podría ser mejor preguntar. Gracias por ayudar, chicos!Procesamiento de video en Android 3.x/Google TV/SDK: Marco de video a SurfaceTexture/OpenGL/GLSL
Pregunta
- Cómo hacer que un fotograma de vídeo de MediaPlayer o VideoView a SurfaceTexture o una textura de OpenGL, con el fin de cambiar el/color de la textura fragmento través GLSL? (Lo necesitamos para fantasía rutinas de procesamiento de vídeo GLES/GLSL.)
Contexto
a) Google TV (LG G2 2012 dispositivo) es un 3,2 dispositivo Android con soporte SDK de sólo (sin NDK)
b) Es fácil renderizar desde la cámara a SurfaceTexture, pero ¿cómo renderizar video a SurfaceTexture en Android 3.x? Para la solución de la cámara, ver a continuación.
c) Ya estoy renderizando cuadros de video a un GLView/GLRenderer, pero no estoy agarrando un marco para cambiarlo a través de GLSL. Parece que no funciona. Pero necesito accessable texturas GLES/GLSL con datos de vídeo para el procesamiento de vídeo:
clase MainActivity:
public void onCreate(Bundle state) {
super.onCreate(state);
m_View = new GLSimpleView(this);
setContentView(m_View);
m_Holder = m_View.getHolder();
m_Holder.addCallback(this);
m_Holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
clase GLSimpleView: Clase
public GLSimpleView(Context context) {
super(context);
m_Renderer = new GLTextureRenderer(context);
this.setRenderer(m_Renderer);
}
GLTextureRender:
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
m_SurfaceTexture = textures[0];
GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID);
GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
m_Surface = new SurfaceTexture(m_SurfaceTexture);
m_Surface.setOnFrameAvailableListener(this);
// THIS ONE DOESN'T WORK WITH ANDROID 3.x!
// HOW TO BIND m_Surface TO m_MediaPlayer?
//Surface surface = new Surface(m_Surface);
//m_MediaPlayer.setSurface(surface);
//surface.release();
también compare esto:
SurfaceTexture para la cámara (necesito éste para MediaPlayer o VideoView!): Using SurfaceTexture in Android
vídeo a GLView (sin acceso a través de la textura GLSL!): Playing video in a GLSurfaceView instead of SurfaceView
Android 4.x SDK VideoSurfaceTexture muestra (3.2 no es compatible!): http://source-android.frandroid.com/cts/tests/src/android/media/cts/VideoSurfaceView.java
Android MediaPlayer (en Android 3.x ningún apoyo de setSurface()!): http://developer.android.com/reference/android/media/MediaPlayer.html
Por lo tanto, la pregunta principal sigue siendo: ¿Cómo acceder y manipular un cuadro de video con Android 3.x? Quizás una solución diferente? ¿Me estoy perdiendo algo, después de pasar demasiado tiempo? Tenga en cuenta que no hay compatibilidad con NDK en Google TV en absoluto, que estamos muy limitados si tratamos de manipular los datos de video.
¿Has visto: http://stackoverflow.com/questions/8620560/video-processing-in-android? También tengo curiosidad si has mirado la ahora obsoleta API Renderscript Graphics para tu proyecto. –