Explorar o código

只使用glide加载帧图片;
隐藏视频详情界面的分享功能;
拍摄视频后直接进入剪切视频界面

zengjiebin %!s(int64=7) %!d(string=hai) anos
pai
achega
733c9ceb96

+ 15 - 15
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -21,26 +21,26 @@ public class DaoMaster extends AbstractDaoMaster {
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
-        ProcessRecordDao.createTable(db, ifNotExists);
-        AppdownloadBeanDao.createTable(db, ifNotExists);
-        SdkLoginUserDao.createTable(db, ifNotExists);
-        ScreenShotRecordDao.createTable(db, ifNotExists);
         AcceptTaskRecordDao.createTable(db, ifNotExists);
         AccountDao.createTable(db, ifNotExists);
-        SearchRecordDao.createTable(db, ifNotExists);
+        AppdownloadBeanDao.createTable(db, ifNotExists);
         DownLoadInfoDao.createTable(db, ifNotExists);
+        ProcessRecordDao.createTable(db, ifNotExists);
+        ScreenShotRecordDao.createTable(db, ifNotExists);
+        SdkLoginUserDao.createTable(db, ifNotExists);
+        SearchRecordDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
-        ProcessRecordDao.dropTable(db, ifExists);
-        AppdownloadBeanDao.dropTable(db, ifExists);
-        SdkLoginUserDao.dropTable(db, ifExists);
-        ScreenShotRecordDao.dropTable(db, ifExists);
         AcceptTaskRecordDao.dropTable(db, ifExists);
         AccountDao.dropTable(db, ifExists);
-        SearchRecordDao.dropTable(db, ifExists);
+        AppdownloadBeanDao.dropTable(db, ifExists);
         DownLoadInfoDao.dropTable(db, ifExists);
+        ProcessRecordDao.dropTable(db, ifExists);
+        ScreenShotRecordDao.dropTable(db, ifExists);
+        SdkLoginUserDao.dropTable(db, ifExists);
+        SearchRecordDao.dropTable(db, ifExists);
     }
 
     /**
@@ -59,14 +59,14 @@ public class DaoMaster extends AbstractDaoMaster {
 
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
-        registerDaoClass(ProcessRecordDao.class);
-        registerDaoClass(AppdownloadBeanDao.class);
-        registerDaoClass(SdkLoginUserDao.class);
-        registerDaoClass(ScreenShotRecordDao.class);
         registerDaoClass(AcceptTaskRecordDao.class);
         registerDaoClass(AccountDao.class);
-        registerDaoClass(SearchRecordDao.class);
+        registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(DownLoadInfoDao.class);
+        registerDaoClass(ProcessRecordDao.class);
+        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(SdkLoginUserDao.class);
+        registerDaoClass(SearchRecordDao.class);
     }
 
     public DaoSession newSession() {

+ 61 - 61
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -8,23 +8,23 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 
-import com.sheep.gamegroup.greendao.download.ProcessRecord;
-import com.sheep.gamegroup.greendao.download.AppdownloadBean;
-import com.sheep.gamegroup.greendao.download.SdkLoginUser;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.Account;
-import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.DownLoadInfo;
+import com.sheep.gamegroup.greendao.download.ProcessRecord;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.SearchRecord;
 
-import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
-import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
-import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
 import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.AccountDao;
-import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
+import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.SearchRecordDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -35,112 +35,112 @@ import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
  */
 public class DaoSession extends AbstractDaoSession {
 
-    private final DaoConfig processRecordDaoConfig;
-    private final DaoConfig appdownloadBeanDaoConfig;
-    private final DaoConfig sdkLoginUserDaoConfig;
-    private final DaoConfig screenShotRecordDaoConfig;
     private final DaoConfig acceptTaskRecordDaoConfig;
     private final DaoConfig accountDaoConfig;
-    private final DaoConfig searchRecordDaoConfig;
+    private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig downLoadInfoDaoConfig;
+    private final DaoConfig processRecordDaoConfig;
+    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig sdkLoginUserDaoConfig;
+    private final DaoConfig searchRecordDaoConfig;
 
-    private final ProcessRecordDao processRecordDao;
-    private final AppdownloadBeanDao appdownloadBeanDao;
-    private final SdkLoginUserDao sdkLoginUserDao;
-    private final ScreenShotRecordDao screenShotRecordDao;
     private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final AccountDao accountDao;
-    private final SearchRecordDao searchRecordDao;
+    private final AppdownloadBeanDao appdownloadBeanDao;
     private final DownLoadInfoDao downLoadInfoDao;
+    private final ProcessRecordDao processRecordDao;
+    private final ScreenShotRecordDao screenShotRecordDao;
+    private final SdkLoginUserDao sdkLoginUserDao;
+    private final SearchRecordDao searchRecordDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
         super(db);
 
-        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
-        processRecordDaoConfig.initIdentityScope(type);
+        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
+        acceptTaskRecordDaoConfig.initIdentityScope(type);
+
+        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
+        accountDaoConfig.initIdentityScope(type);
 
         appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
         appdownloadBeanDaoConfig.initIdentityScope(type);
 
-        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
-        sdkLoginUserDaoConfig.initIdentityScope(type);
+        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
+        downLoadInfoDaoConfig.initIdentityScope(type);
+
+        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
+        processRecordDaoConfig.initIdentityScope(type);
 
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
 
-        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
-        acceptTaskRecordDaoConfig.initIdentityScope(type);
-
-        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
-        accountDaoConfig.initIdentityScope(type);
+        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
+        sdkLoginUserDaoConfig.initIdentityScope(type);
 
         searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
         searchRecordDaoConfig.initIdentityScope(type);
 
-        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
-        downLoadInfoDaoConfig.initIdentityScope(type);
-
-        processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
-        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
-        sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
-        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
         acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         accountDao = new AccountDao(accountDaoConfig, this);
-        searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
+        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
+        processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
+        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
+        searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
 
-        registerDao(ProcessRecord.class, processRecordDao);
-        registerDao(AppdownloadBean.class, appdownloadBeanDao);
-        registerDao(SdkLoginUser.class, sdkLoginUserDao);
-        registerDao(ScreenShotRecord.class, screenShotRecordDao);
         registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(Account.class, accountDao);
-        registerDao(SearchRecord.class, searchRecordDao);
+        registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(DownLoadInfo.class, downLoadInfoDao);
+        registerDao(ProcessRecord.class, processRecordDao);
+        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(SdkLoginUser.class, sdkLoginUserDao);
+        registerDao(SearchRecord.class, searchRecordDao);
     }
     
     public void clear() {
-        processRecordDaoConfig.clearIdentityScope();
-        appdownloadBeanDaoConfig.clearIdentityScope();
-        sdkLoginUserDaoConfig.clearIdentityScope();
-        screenShotRecordDaoConfig.clearIdentityScope();
         acceptTaskRecordDaoConfig.clearIdentityScope();
         accountDaoConfig.clearIdentityScope();
-        searchRecordDaoConfig.clearIdentityScope();
+        appdownloadBeanDaoConfig.clearIdentityScope();
         downLoadInfoDaoConfig.clearIdentityScope();
+        processRecordDaoConfig.clearIdentityScope();
+        screenShotRecordDaoConfig.clearIdentityScope();
+        sdkLoginUserDaoConfig.clearIdentityScope();
+        searchRecordDaoConfig.clearIdentityScope();
     }
 
-    public ProcessRecordDao getProcessRecordDao() {
-        return processRecordDao;
+    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
+        return acceptTaskRecordDao;
+    }
+
+    public AccountDao getAccountDao() {
+        return accountDao;
     }
 
     public AppdownloadBeanDao getAppdownloadBeanDao() {
         return appdownloadBeanDao;
     }
 
-    public SdkLoginUserDao getSdkLoginUserDao() {
-        return sdkLoginUserDao;
+    public DownLoadInfoDao getDownLoadInfoDao() {
+        return downLoadInfoDao;
     }
 
-    public ScreenShotRecordDao getScreenShotRecordDao() {
-        return screenShotRecordDao;
+    public ProcessRecordDao getProcessRecordDao() {
+        return processRecordDao;
     }
 
-    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
-        return acceptTaskRecordDao;
+    public ScreenShotRecordDao getScreenShotRecordDao() {
+        return screenShotRecordDao;
     }
 
-    public AccountDao getAccountDao() {
-        return accountDao;
+    public SdkLoginUserDao getSdkLoginUserDao() {
+        return sdkLoginUserDao;
     }
 
     public SearchRecordDao getSearchRecordDao() {
         return searchRecordDao;
     }
 
-    public DownLoadInfoDao getDownLoadInfoDao() {
-        return downLoadInfoDao;
-    }
-
 }

+ 39 - 11
app/src/main/java/com/sheep/gamegroup/module/find/activity/ActMediaChoose.java

@@ -20,6 +20,7 @@ import com.sheep.gamegroup.module.find.fragment.FgtMediaPickerImg;
 import com.sheep.gamegroup.module.find.fragment.FgtMediaPickerVideo;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.ListUtil;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
@@ -35,8 +36,13 @@ import java.util.List;
 
 import butterknife.BindView;
 import cn.finalteam.rxgalleryfinal.api.CameraCallBack;
+import cn.finalteam.rxgalleryfinal.bean.MediaBean;
 import cn.finalteam.rxgalleryfinal.utils.CameraUtil;
 import cn.finalteam.rxgalleryfinal.utils.MediaUtils;
+import io.reactivex.Observable;
+import io.reactivex.ObservableOnSubscribe;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
 
 /**
  * Created by realicing on 2018/11/26.
@@ -66,13 +72,13 @@ public class ActMediaChoose extends BaseActivity {
                 .setTitle(this, "选择媒体")
                 .setTitleFinish(this)
                 .setRightImgBotton(this, R.mipmap.ic_open_camera, new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
+                    @Override
+                    public void onClick(View view) {
 //                Jump2View.getInstance().goActEditVideo(video);
-                boolean isVideo = mAdapter.getItem(viewPager.getCurrentItem()) instanceof FgtMediaPickerVideo;
-                filePath = CameraUtil.openCamera(ActMediaChoose.this, !isVideo);
-            }
-        });
+                        boolean isVideo = mAdapter.getItem(viewPager.getCurrentItem()) instanceof FgtMediaPickerVideo;
+                        filePath = CameraUtil.openCamera(ActMediaChoose.this, !isVideo);
+                    }
+                });
 
         mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
         mAdapter.add(new FgtMediaPickerVideo(), "视频");
@@ -103,6 +109,7 @@ public class ActMediaChoose extends BaseActivity {
     }
 
     private String filePath;
+
     @Override
     protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent intent) {
         super.onActivityResult(requestCode, resultCode, intent);
@@ -139,9 +146,30 @@ public class ActMediaChoose extends BaseActivity {
 
                 @Override
                 public void onGetVideoSuccess() {
-                    if (mAdapter.getItem(0) instanceof IRefresh) {
-                        refreshData(0);
-                    }
+                    Observable.create((ObservableOnSubscribe<MediaBean>) emitter -> {
+                        MediaBean mediaBean = null;
+                        if (filePath != null) {
+                            mediaBean = MediaUtils.getMediaBeanWithVideo(getApplicationContext(), filePath);
+                        }
+                        if (mediaBean == null) {
+                            emitter.onError(new Throwable(filePath));
+                        }
+                        emitter.onNext(mediaBean);
+                    }).subscribeOn(Schedulers.io())
+                            .observeOn(AndroidSchedulers.mainThread())
+                            .subscribe(new AbsObserver<MediaBean>() {
+                                @Override
+                                public void onNext(MediaBean item) {
+                                    Jump2View.getInstance().goActCutVideo(ActMediaChoose.this, Video.from(item));
+                                }
+
+                                @Override
+                                public void onError(Throwable e) {
+                                    if (mAdapter.getItem(0) instanceof IRefresh) {
+                                        refreshData(0);
+                                    }
+                                }
+                            });
                 }
 
                 @Override
@@ -155,10 +183,10 @@ public class ActMediaChoose extends BaseActivity {
     }
 
     private void refreshData(int position) {
-        ViewUtil.delay(new AbsObserver<Integer>(){
+        ViewUtil.delay(new AbsObserver<Integer>() {
             @Override
             public void onNext(Integer integer) {
-                if(!ActMediaChoose.this.isDestroyed())
+                if (!ActMediaChoose.this.isDestroyed())
                     ((IRefresh) mAdapter.getItem(position)).refreshData();
             }
         }, 1);

+ 1 - 3
app/src/main/java/com/sheep/gamegroup/view/activity/ActPublishArticle.java

@@ -128,9 +128,7 @@ public class ActPublishArticle extends BaseActivity {
     }
 
     private void addVideo() {
-        if(EmotionKeyboard.checkInputMethodVisible(editText)){
-            return;
-        }
+        EmotionKeyboard.checkInputMethodVisible(editText);
         Jump2View.getInstance().gotoActMediaChoose(MEDIA_TYPE_NONE);
     }
 

+ 1 - 0
app/src/main/res/layout/include_article_video_bottom.xml

@@ -44,6 +44,7 @@
         android:layout_height="wrap_content"
         android:layout_marginBottom="17dp"
         android:drawableStart="@mipmap/ic_share"
+        android:visibility="gone"
         android:drawablePadding="9dp"
         android:onClick="onClickVideoShare"
         android:padding="8dp"

+ 5 - 4
media/app/build.gradle

@@ -14,7 +14,8 @@ android {
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 
         ndk {
-            abiFilters "armeabi-v7a", 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
+//            abiFilters "armeabi-v7a"//, 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
+            abiFilters 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
         }
     }
 
@@ -43,7 +44,7 @@ android {
 //        abi {
 //            enable true
 //            reset()
-//            include 'x86', 'armeabi-v7a', 'arm64-v8a'
+//            include 'x86', 'armeabi-v7a'//, 'arm64-v8a'
 ////            include 'mips', 'arm64-v8a', 'x86', 'x86_64', 'armeabi', 'armeabi-v7a'
 //            universalApk false
 //        }
@@ -69,7 +70,7 @@ dependencies {
     androidTestImplementation 'com.android.support.test:runner:1.0.2'
     androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
     //显示图片视频帧,在插件中不兼容x86模拟器,所以x86不考虑
-    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
+//    implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
     implementation project(':share_library')
     implementation("com.android.support:recyclerview-v7:$supportLibVersion")
     implementation 'com.android.support.constraint:constraint-layout:1.1.3'
@@ -107,7 +108,7 @@ android.applicationVariants.all {
             output ->
 //                if (buildType.name == "release") {
                 outputFileName = "media_release.apk"
-//                outputFileName = "media_${output.getFilter(com.android.build.OutputFile.ABI)}.apk"
+//                outputFileName = "media_release_${output.getFilter(com.android.build.OutputFile.ABI)}.apk"
 //                outputFileName = "media_v${versionCode}-${releaseTime()}_${output.getFilter(com.android.build.OutputFile.ABI)}.apk"
 //                }
 

+ 1 - 1
media/app/src/main/java/com/kfzs/cfyl/media/customview/VideoFramesView.java

@@ -349,7 +349,7 @@ public class VideoFramesView extends RelativeLayout {
         if(TextUtils.equals(android.os.Build.CPU_ABI, "x86")) {//x86不兼容,不能在模拟器中连续调用FFmpegMediaMetadataRetriever
             return showVideoList1(activity);
         } else {
-            return showVideoList2(activity);
+            return showVideoList1(activity);
         }
     }
     /**

+ 46 - 44
media/app/src/main/java/com/kfzs/cfyl/media/util/VideoUtil.java

@@ -17,7 +17,7 @@ import java.util.Locale;
 
 import cn.finalteam.rxgalleryfinal.utils.MediaUtils;
 import rx.functions.Action1;
-import wseemann.media.FFmpegMediaMetadataRetriever;
+//import wseemann.media.FFmpegMediaMetadataRetriever;
 
 /**
  * Created by realicing on 2018/12/6.
@@ -26,52 +26,54 @@ import wseemann.media.FFmpegMediaMetadataRetriever;
 public class VideoUtil {
 
     public static Bitmap getScaledFrameAtTime(VideoFrame videoFrame) {
-        long time = System.currentTimeMillis();
-        long durationTime = time;
-        FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
-        try {
-            mmr.setDataSource(videoFrame.getVideoPath());
-            durationTime = System.currentTimeMillis();
-//            LogUtil.println(VideoFramesView.class.getSimpleName(), "getScaledFrameAtTime", videoFrame.getWidth(), videoFrame.getHeight(), videoFrame.getAtTime());
-            Bitmap bitmap = mmr.getScaledFrameAtTime(videoFrame.getAtTime(), FFmpegMediaMetadataRetriever.OPTION_CLOSEST, videoFrame.getWidth(), videoFrame.getHeight());
-            switch (videoFrame.getOrientation()) {
-                case 0:
-                    return bitmap;
-                default:
-                    Bitmap newBitmap = MediaUtils.rotateBimap(videoFrame.getOrientation(), bitmap);
-                    try {
-                        bitmap.recycle();
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    return newBitmap;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t"+ (durationTime - time) + "\t" + e.getMessage());
-        } finally {
-            mmr.release();
-            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t" + (durationTime - time) + "\t 成功");
-        }
+//        long time = System.currentTimeMillis();
+//        long durationTime = time;
+//        FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
+//        try {
+//            mmr.setDataSource(videoFrame.getVideoPath());
+//            durationTime = System.currentTimeMillis();
+////            LogUtil.println(VideoFramesView.class.getSimpleName(), "getScaledFrameAtTime", videoFrame.getWidth(), videoFrame.getHeight(), videoFrame.getAtTime());
+//            Bitmap bitmap = mmr.getScaledFrameAtTime(videoFrame.getAtTime(), FFmpegMediaMetadataRetriever.OPTION_CLOSEST, videoFrame.getWidth(), videoFrame.getHeight());
+//            if(bitmap == null)
+//                return null;
+//            switch (videoFrame.getOrientation()) {
+//                case 0:
+//                    return bitmap;
+//                default:
+//                    Bitmap newBitmap = MediaUtils.rotateBimap(videoFrame.getOrientation(), bitmap);
+//                    try {
+//                        bitmap.recycle();
+//                    } catch (Exception e) {
+//                        e.printStackTrace();
+//                    }
+//                    return newBitmap;
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t"+ (durationTime - time) + "\t" + e.getMessage());
+//        } finally {
+//            mmr.release();
+//            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t" + (durationTime - time) + "\t 成功");
+//        }
         return null;
     }
     public static Bitmap getFrameAtTime(VideoFrame videoFrame) {
-        long time = System.currentTimeMillis();
-        long durationTime = time;
-        FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
-        try {
-            mmr.setDataSource(videoFrame.getVideoPath());
-//            long duration = Long.parseLong(mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION));
-//            LogUtil.println(VideoFramesView.class.getSimpleName(), "getFrameAtTime", duration, videoFrame.getAtTime());
-            durationTime = System.currentTimeMillis();
-            return mmr.getFrameAtTime(videoFrame.getAtTime(), FFmpegMediaMetadataRetriever.OPTION_CLOSEST);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t"+ (durationTime - time) + "\t" + e.getMessage());
-        } finally {
-            mmr.release();
-            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t" + (durationTime - time) + "\t 成功");
-        }
+//        long time = System.currentTimeMillis();
+//        long durationTime = time;
+//        FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
+//        try {
+//            mmr.setDataSource(videoFrame.getVideoPath());
+////            long duration = Long.parseLong(mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION));
+////            LogUtil.println(VideoFramesView.class.getSimpleName(), "getFrameAtTime", duration, videoFrame.getAtTime());
+//            durationTime = System.currentTimeMillis();
+//            return mmr.getFrameAtTime(videoFrame.getAtTime(), FFmpegMediaMetadataRetriever.OPTION_CLOSEST);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t"+ (durationTime - time) + "\t" + e.getMessage());
+//        } finally {
+//            mmr.release();
+//            Log.i("videoUtil", (System.currentTimeMillis() - time) + "\t" + (durationTime - time) + "\t 成功");
+//        }
         return null;
     }
 //    public synchronized static Bitmap getVideoFrameBitmap2(VideoFrame videoFrame) {