|
|
@@ -33,6 +33,8 @@ import org.wysaid.view.VideoPlayerGLSurfaceView;
|
|
|
|
|
|
import java.util.Locale;
|
|
|
|
|
|
+import cn.finalteam.rxgalleryfinal.utils.MediaUtils;
|
|
|
+
|
|
|
/**
|
|
|
* Created by realicing on 2018/11/9.
|
|
|
* realicing@sina.com
|
|
|
@@ -147,10 +149,16 @@ public class ActEditVideo extends BaseContainerActivity implements Filterble, Le
|
|
|
String outputFilename = String.format(Locale.CHINA, "%s_%d_%f.mp4", srcFilPath.substring(0, srcFilPath.lastIndexOf(".")), mCurrentConfig.hashCode(), mIntensity);
|
|
|
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.media_sheep_logo_3);
|
|
|
//left 30px top 60px width 750
|
|
|
- Bitmap logo = BitmapUtil.createBigLogo(bmp, new Size().setWidth(data.getWidth()).setHeight(data.getHeight()).setX(data.getWidth() * 30 / 750).setY(data.getWidth() * 60 / 750));
|
|
|
+ Bitmap logo = data.getOrientation() / 90 % 2 == 0 ?
|
|
|
+ BitmapUtil.createBigLogo(bmp, new Size().setWidth(data.getWidth()).setHeight(data.getHeight()).setX(data.getWidth() * 30 / 750).setY(data.getWidth() * 60 / 750)) :
|
|
|
+ BitmapUtil.createBigLogo(bmp, new Size().setWidth(data.getHeight()).setHeight(data.getWidth()).setX(data.getHeight() * 30 / 750).setY(data.getHeight() * 60 / 750));
|
|
|
+ Bitmap rotateBmp = data.getOrientation() != 0 ? MediaUtils.rotateBimap(360 - data.getOrientation(), logo) : logo;
|
|
|
+ if(logo != rotateBmp)
|
|
|
+ logo.recycle();
|
|
|
bmp.recycle();
|
|
|
- CGEFFmpegNativeLibrary.generateVideoWithFilter(outputFilename, srcFilPath, mCurrentConfig, mIntensity, logo, CGENativeLibrary.TextureBlendMode.CGE_BLEND_ADDREV, 1.0f, false);
|
|
|
|
|
|
+ CGEFFmpegNativeLibrary.generateVideoWithFilter(outputFilename, srcFilPath, mCurrentConfig, mIntensity, rotateBmp, CGENativeLibrary.TextureBlendMode.CGE_BLEND_ADDREV, 1.0f, false);
|
|
|
+ rotateBmp.recycle();
|
|
|
LogUtil.println(ActEditVideo.class.getSimpleName(), "Done! The file is generated at: " + outputFilename);
|
|
|
return outputFilename;
|
|
|
}
|