android: preview window shown empty fix

parent 254681d3
......@@ -55,10 +55,10 @@ public class AndroidVideoWindowImpl {
* useful to Mediastreamer.
*/
public static interface VideoWindowListener{
void onVideoRenderingSurfaceReady(AndroidVideoWindowImpl vw);
void onVideoRenderingSurfaceReady(AndroidVideoWindowImpl vw, SurfaceView surface);
void onVideoRenderingSurfaceDestroyed(AndroidVideoWindowImpl vw);
void onVideoPreviewSurfaceReady(AndroidVideoWindowImpl vw);
void onVideoPreviewSurfaceReady(AndroidVideoWindowImpl vw, SurfaceView surface);
void onVideoPreviewSurfaceDestroyed(AndroidVideoWindowImpl vw);
};
......@@ -89,7 +89,7 @@ public class AndroidVideoWindowImpl {
mSurface=holder.getSurface();
}
}
if (mListener!=null) mListener.onVideoRenderingSurfaceReady(AndroidVideoWindowImpl.this);
if (mListener!=null) mListener.onVideoRenderingSurfaceReady(AndroidVideoWindowImpl.this, mVideoRenderingView);
Log.w("mediastream", "Video display surface changed");
}
......@@ -115,7 +115,7 @@ public class AndroidVideoWindowImpl {
int width, int height) {
Log.i("mediastream", "Video preview surface is being changed.");
if (mListener!=null)
mListener.onVideoPreviewSurfaceReady(AndroidVideoWindowImpl.this);
mListener.onVideoPreviewSurfaceReady(AndroidVideoWindowImpl.this, mVideoPreviewView);
Log.w("mediastream", "Video preview surface changed");
}
......
......@@ -202,9 +202,9 @@ static int video_set_native_preview_window(MSFilter *f, void *arg) {
if (d->androidCamera) {
if (d->previewWindow == 0) {
ms_message("Preview capture window set for the 1st time (rotation:%d)\n", d->rotation);
ms_message("Preview capture window set for the 1st time (win: %p rotation:%d)\n", w, d->rotation);
} else {
ms_message("Preview capture window changed (rotation:%d)\n", d->rotation);
ms_message("Preview capture window changed (oldwin: %p newwin: %p rotation:%d)\n", d->previewWindow, w, d->rotation);
env->DeleteGlobalRef(d->androidCamera);
if (w) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment