Skip to content

Commit

Permalink
解决第二次录制无画面的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WangShuo1143368701 committed Mar 30, 2018
1 parent 41871e5 commit a584561
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ public void setMirror(boolean isEnableMirror,boolean isEnablePreviewMirror,boole
videoClient.setMirror(isEnableMirror,isEnablePreviewMirror,isEnableStreamMirror);
}

public void setNeedResetEglContext(boolean bol){
videoClient.setNeedResetEglContext(bol);
}

static {
System.loadLibrary("restreaming");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,4 +460,7 @@ public void setVideoEncoder(final MediaVideoEncoder encoder) {
public void setMirror(boolean isEnableMirror,boolean isEnablePreviewMirror,boolean isEnableStreamMirror) {
videoCore.setMirror(isEnableMirror,isEnablePreviewMirror,isEnableStreamMirror);
}
public void setNeedResetEglContext(boolean bol){
videoCore.setNeedResetEglContext(bol);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -877,5 +877,9 @@ private void processStMatrix(float[] matrix, boolean needMirror) {

return;
}

public void setNeedResetEglContext(boolean bol){
mNeedResetEglContext = bol;
}
//encoder mp4 end
}
Original file line number Diff line number Diff line change
Expand Up @@ -548,5 +548,8 @@ public void setVideoEncoder(final MediaVideoEncoder encoder) {
@Override
public void setMirror(boolean isEnableMirror, boolean isEnablePreviewMirror, boolean isEnableStreamMirror) {

}
public void setNeedResetEglContext(boolean bol){

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ public interface RESVideoCore {
void setVideoEncoder(final MediaVideoEncoder encoder);

void setMirror(boolean isEnableMirror,boolean isEnablePreviewMirror,boolean isEnableStreamMirror);
void setNeedResetEglContext(boolean bol);


}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public void stopStreaming(){
private boolean isRecord = false;
public void startRecord(){
if(resClient != null){
resClient.setNeedResetEglContext(true);
try {
mMuxer = new MediaMuxerWrapper(".mp4"); // if you record audio only, ".m4a" is also OK.
new MediaVideoEncoder(mMuxer, mMediaEncoderListener, StreamAVOption.recordVideoWidth, StreamAVOption.recordVideoHeight);
Expand Down Expand Up @@ -385,7 +386,7 @@ public void onSurfaceTextureUpdated(SurfaceTexture surface) {
/**
* callback methods from encoder
*/
private final MediaEncoder.MediaEncoderListener mMediaEncoderListener = new MediaEncoder.MediaEncoderListener() {
MediaEncoder.MediaEncoderListener mMediaEncoderListener = new MediaEncoder.MediaEncoderListener() {
@Override
public void onPrepared(final MediaEncoder encoder) {
if (encoder instanceof MediaVideoEncoder && resClient != null)
Expand Down

0 comments on commit a584561

Please sign in to comment.