处理两个surfaceViews两个、surfaceViews

2023-09-06 04:38:01 作者:﹏ /巨☉蟒

我有两个面观 1> MediaRecorder显示surfaceview。 2> MediaPlayer的SurfaceView显示记录MediaRecorder媒体。

我想在屏幕Z下令同屏显示的看法。

在MediaPlayer将palying在全屏和MediaRecorder preVIEW SHD出现在右上角有一些更小的尺寸。

我可以用两个表面要做到这一点,但问题是,MediaRecorder preVIEW总是转到后台Z顺序和被隐藏的媒体播放器全屏幕显示。

时的任何方式来定义的表面观的Z顺序。

或者是他们的任何其他suzzestion我可以做,使这项工作。我可以在一个单一的表面同时启动MediaRecorder和MediaPlayer的?

请建议。谢谢!

解决方案   

我想在屏幕Z下令同屏显示的看法。

AFAIK,不是由Android的支持。 Android无法合成多个 SurfaceViews 。它可以处理普通的查看(例如,按钮)上的 SurfaceView ,而不是两个 SurfaceViews 以Z排序。

我建议重新设计你的应用程序有一个 SurfaceView 的时间。

I have two surface Views 1> MediaRecorder display surfaceview. 2> MediaPlayer SurfaceView displaying the Media recorded by MediaRecorder.

I want to display both the views simultaneously on the screen z ordered.

请为数字娱乐新生活打call

The mediaPlayer will be palying in full screen and the MediaRecorderPreview shd appear in the top right corner with some smaller size.

I am able to do this using two surfaces but the issue is that the MediaRecorder Preview always goes to the background z order and gets hidden by the mediaplayer full screen display.

Is their any way to define the Z order of Surface View.

Or is their any other suzzestion i can do to make this work. Can i start both MediaRecorder and MediaPlayer in a single surface?

Pls suggest. Thanks!!

解决方案

I want to display both the views simultaneously on the screen z ordered.

AFAIK, that is not supported by Android. Android cannot composite multiple SurfaceViews. It can handle a regular View (e.g., Button) on top of a SurfaceView, but not two SurfaceViews Z ordered.

I recommend redesigning your application to have a single SurfaceView at a time.