栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Android Camera缩率图所成的图像不是录像播放的第一帧

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Android Camera缩率图所成的图像不是录像播放的第一帧

修改方法如下:
vendor/mediatek/proprietary/packages/apps/Camera2/common/src/com/mediatek/camera/common/utils/BitmapCreator.java

-            bitmap = retriever.getframeAtTime(-1);
+            bitmap = retriever.getframeAtTime(0);

getframeAtTime 这个方法的参数代表啥意思?

public @Nullable Bitmap getframeAtTime(long timeUs, @Option int option) {
    if (option < OPTION_PREVIOUS_SYNC ||
        option > OPTION_CLOSEST) {
        throw new IllegalArgumentException("Unsupported option: " + option);
    }

    return _getframeAtTime(timeUs, option, -1 , -1 , null);
}
@param timeUs The time position where the frame will be retrieved.
When retrieving the frame at the given time position, there is no
guarantee that the data source has a frame located at the position.
When this happens, a frame nearby will be returned. If timeUs is
negative, time position and option will ignored, and any frame
that the implementation considers as representative may be returned.

从上面这段注释中可以看出,如果 timeUs 参数是负数,time position 和 option 参数会被忽略,可能返回可以代表这个视频的任何帧
如果 timeUs 是非负数,就优先返回 timeUs 所在帧,如果找不到就找附近的帧。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/591907.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号