From fe2b350bfadfcea0e136f531200a90031d635c10 Mon Sep 17 00:00:00 2001 From: dengyuhan <464958567@qq.com> Date: Mon, 5 Jun 2017 19:41:51 +0800 Subject: [PATCH] =?UTF-8?q?1.0.1=20-=20=E5=A2=9E=E5=8A=A0=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=AF=94=E4=BE=8B=E5=AE=BD=E9=AB=98=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 2 +- .../dyhdyh/compat/mmrc/MediaMetadataRetrieverCompat.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config.gradle b/config.gradle index f55d7f8..a4bd1ce 100644 --- a/config.gradle +++ b/config.gradle @@ -2,7 +2,7 @@ ext { android = [ versionCode : 1, - versionName : "1.0.0", + versionName : "1.0.1", compileSdkVersion: 25, buildToolsVersion: "25.0.2", diff --git a/media-metadata-retriever-compat/src/main/java/com/dyhdyh/compat/mmrc/MediaMetadataRetrieverCompat.java b/media-metadata-retriever-compat/src/main/java/com/dyhdyh/compat/mmrc/MediaMetadataRetrieverCompat.java index 4886290..e71ce8c 100644 --- a/media-metadata-retriever-compat/src/main/java/com/dyhdyh/compat/mmrc/MediaMetadataRetrieverCompat.java +++ b/media-metadata-retriever-compat/src/main/java/com/dyhdyh/compat/mmrc/MediaMetadataRetrieverCompat.java @@ -132,6 +132,14 @@ public Bitmap getScaledFrameAtTime(long timeUs, int option, int width, int heigh return frame; } + public Bitmap getScaledFrameAtTime(long timeUs, int option, float widthScale, float heightScale, float rotate) { + String widthText = extractMetadata(METADATA_KEY_VIDEO_WIDTH); + String heightText = extractMetadata(METADATA_KEY_VIDEO_HEIGHT); + int width = TextUtils.isEmpty(widthText) ? 0 : (int) (Integer.parseInt(widthText) * widthScale); + int height = TextUtils.isEmpty(heightText) ? 0 : (int) (Integer.parseInt(heightText) * heightScale); + return getScaledFrameAtTime(timeUs, option, width, height, rotate); + } + public byte[] getEmbeddedPicture() { return impl.getEmbeddedPicture(); }