medianative converted to java
This commit is contained in:
@@ -0,0 +1,502 @@
|
||||
package com.vk.medianative;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Process;
|
||||
import android.os.*;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Scanner;
|
||||
|
||||
public final class MediaNative {
|
||||
private static final String a = NativeMediaEncoder.class.getSimpleName();
|
||||
private static final Object f17443d = new Object();
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@Keep
|
||||
public static volatile Context context;
|
||||
private static boolean isMediaLoaded = false;
|
||||
private static boolean isMediaMasksLoaded = false;
|
||||
|
||||
public static int HSLToIntRGB(float f2, float f3, float f4) {
|
||||
int[] iArr = new int[3];
|
||||
waitForContext();
|
||||
nativeHSLToRGB(f2, f3, f4, iArr);
|
||||
return Color.argb(255, iArr[0], iArr[1], iArr[2]);
|
||||
}
|
||||
|
||||
public static void HSLToRGB(float f2, float f3, float f4, int[] iArr) {
|
||||
waitForContext();
|
||||
nativeHSLToRGB(f2, f3, f4, iArr);
|
||||
}
|
||||
|
||||
public static int HSVToIntRGB(float f2, float f3, float f4) {
|
||||
int[] iArr = new int[3];
|
||||
waitForContext();
|
||||
nativeHSVToRGB(f2, f3, f4, iArr);
|
||||
return Color.argb(255, iArr[0], iArr[1], iArr[2]);
|
||||
}
|
||||
|
||||
public static void HSVToRGB(float f2, float f3, float f4, int[] iArr) {
|
||||
waitForContext();
|
||||
nativeHSVToRGB(f2, f3, f4, iArr);
|
||||
}
|
||||
|
||||
public static int LabToIntRGB(float f2, float f3, float f4) {
|
||||
int[] iArr = new int[3];
|
||||
waitForContext();
|
||||
nativeLabToRGB(f2, f3, f4, iArr);
|
||||
return Color.argb(255, iArr[0], iArr[1], iArr[2]);
|
||||
}
|
||||
|
||||
public static void LabToRGB(float f2, float f3, float f4, int[] iArr) {
|
||||
waitForContext();
|
||||
nativeLabToRGB(f2, f3, f4, iArr);
|
||||
}
|
||||
|
||||
public static void RGBToHSL(int i, int i2, int i3, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeRGBToHSL(i, i2, i3, fArr);
|
||||
}
|
||||
|
||||
public static void RGBToHSV(int i, int i2, int i3, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeRGBToHSV(i, i2, i3, fArr);
|
||||
}
|
||||
|
||||
public static void RGBToLab(int i, int i2, int i3, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeRGBToLab(i, i2, i3, fArr);
|
||||
}
|
||||
|
||||
public static long animationPlayerCreate(String str, int i, int i2, boolean z) {
|
||||
waitForContext();
|
||||
return nativeAnimationPlayerCreate(str, i, i2, z);
|
||||
}
|
||||
|
||||
public static int animationPlayerDecode(long j, Bitmap bitmap) {
|
||||
waitForContext();
|
||||
return nativeAnimationPlayerDecode(j, bitmap);
|
||||
}
|
||||
|
||||
public static int animationPlayerGetSize(long j) {
|
||||
waitForContext();
|
||||
return nativeAnimationPlayerGetSize(j);
|
||||
}
|
||||
|
||||
public static void animationPlayerRelease(long j) {
|
||||
waitForContext();
|
||||
nativeAnimationPlayerRelease(j);
|
||||
}
|
||||
|
||||
public static boolean animationPlayerSeek(long j, int i) {
|
||||
waitForContext();
|
||||
return nativeAnimationPlayerSeek(j, i);
|
||||
}
|
||||
|
||||
public static void applyCurveAndSaturationBitmap(Bitmap bitmap, int[] iArr, float f2) {
|
||||
waitForContext();
|
||||
nativeCurveSaturation(bitmap, iArr, f2, Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
public static long audioGetTotalPcmDuration() {
|
||||
waitForContext();
|
||||
return nativeAudioGetTotalPcmDuration();
|
||||
}
|
||||
|
||||
public static byte[] audioGetWaveform(short[] sArr, int i) {
|
||||
waitForContext();
|
||||
return nativeAudioGetWaveform(sArr, i);
|
||||
}
|
||||
|
||||
public static int audioIsOpusFile(String str) {
|
||||
waitForContext();
|
||||
return nativeAudioIsOpusFile(str);
|
||||
}
|
||||
|
||||
public static void audioReadOpusFile(ByteBuffer byteBuffer, int i, int[] iArr) {
|
||||
waitForContext();
|
||||
nativeAudioReadOpusFile(byteBuffer, i, iArr);
|
||||
}
|
||||
|
||||
public static int audioSeekOpusFile(float f2) {
|
||||
waitForContext();
|
||||
return nativeAudioSeekOpusFile(f2);
|
||||
}
|
||||
|
||||
public static int audioStartRecord(String str) {
|
||||
waitForContext();
|
||||
return nativeAudioStartRecord(str);
|
||||
}
|
||||
|
||||
public static void audioStopRecord() {
|
||||
waitForContext();
|
||||
nativeAudioStopRecord();
|
||||
}
|
||||
|
||||
public static int audioWriteFrame(ByteBuffer byteBuffer, int i) {
|
||||
waitForContext();
|
||||
return nativeAudioWriteFrame(byteBuffer, i);
|
||||
}
|
||||
|
||||
private static void waitForContext() {
|
||||
synchronized (f17443d) {
|
||||
if (context == null) {
|
||||
try {
|
||||
f17443d.wait();
|
||||
} catch (InterruptedException e2) {
|
||||
Log.e(a, "Interrupted while waiting for context", e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void blurBitmap(Bitmap bitmap, int i) {
|
||||
waitForContext();
|
||||
nativeBlur(bitmap, i);
|
||||
}
|
||||
|
||||
private static String c() {
|
||||
return getProcMaps(String.valueOf(Process.myPid()));
|
||||
}
|
||||
|
||||
public static void cameraProcessorCreate() {
|
||||
waitForContext();
|
||||
nativeProcessorCreate();
|
||||
}
|
||||
|
||||
public static boolean cameraProcessorDo(byte[] bArr, long[] jArr) {
|
||||
waitForContext();
|
||||
return nativeProcessorDo(bArr, jArr);
|
||||
}
|
||||
|
||||
public static int cameraProcessorGetVersion() {
|
||||
waitForContext();
|
||||
return nativeProcessorGetVersion();
|
||||
}
|
||||
|
||||
public static boolean cameraProcessorInit(String str, int i, int i2) {
|
||||
waitForContext();
|
||||
return nativeProcessorInit(str, i, i2);
|
||||
}
|
||||
|
||||
public static boolean cameraProcessorLoad(String str, boolean z) {
|
||||
waitForContext();
|
||||
return nativeProcessorLoad(str, z);
|
||||
}
|
||||
|
||||
public static void cameraProcessorMouseTap(int i, float f2, float f3) {
|
||||
waitForContext();
|
||||
nativeProcessorMouseTap(i, f2, f3);
|
||||
}
|
||||
|
||||
public static void cameraProcessorRelease() {
|
||||
waitForContext();
|
||||
nativeProcessorRelease();
|
||||
}
|
||||
|
||||
public static void colorCorrectionBitmap(Bitmap bitmap, Bitmap bitmap2, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeColorCorrection(bitmap, bitmap2, fArr, fArr.length, Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
public static byte[] compressBitmapJpeg(Bitmap bitmap, int i) {
|
||||
waitForContext();
|
||||
return nativeJpegTurboCompress(bitmap, i);
|
||||
}
|
||||
|
||||
public static String createAllInOneShader() {
|
||||
waitForContext();
|
||||
return nativeAllInOneShader();
|
||||
}
|
||||
|
||||
public static void createCurve(int[] iArr, int[] iArr2, int[] iArr3, int[] iArr4, int[] iArr5, float f2, float f3, float f4, float f5, float f6) {
|
||||
waitForContext();
|
||||
nativeCreateCurve(iArr, iArr2, iArr3, iArr4, iArr5, f2, f3, f4, f5, f6);
|
||||
}
|
||||
|
||||
public static String createOneInAllShader() {
|
||||
waitForContext();
|
||||
return nativeOneInAllShader();
|
||||
}
|
||||
|
||||
private static String d() {
|
||||
return getProcMaps("self");
|
||||
}
|
||||
|
||||
public static String dump() {
|
||||
return "LD_LIBRARY_PATH:\n" + SoLoader.makeLdLibraryPath() + "\nSELF_MAPS:\n" + d() + "\nPID_MAPS:\n" + c() + "\n";
|
||||
}
|
||||
|
||||
private static void e() {
|
||||
isMediaMasksLoaded = NativeLibLoader.loadLibrary("vkmediamasks");
|
||||
}
|
||||
|
||||
public static void enhanceBitmap(Bitmap bitmap, float f2) {
|
||||
waitForContext();
|
||||
nativeEnhance(bitmap, f2, Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
private static void f() {
|
||||
if (isMediaLoaded) {
|
||||
return;
|
||||
}
|
||||
NativeLibLoader.loadLibrary("ffmpeg");
|
||||
isMediaLoaded = NativeLibLoader.loadLibrary("vkmedia");
|
||||
isMediaLoaded = NativeLibLoader.loadLibrary("vkmediaencoder");
|
||||
}
|
||||
|
||||
public static void flipHorizontallyBitmap(Bitmap bitmap) {
|
||||
waitForContext();
|
||||
nativeFlipHorizontally(bitmap);
|
||||
}
|
||||
|
||||
public static void flipVerticallyBitmap(Bitmap bitmap) {
|
||||
waitForContext();
|
||||
nativeFlipVertically(bitmap);
|
||||
}
|
||||
|
||||
public static void generateHistogram(Bitmap bitmap, int[] iArr, int[] iArr2, int[] iArr3, int[] iArr4) {
|
||||
waitForContext();
|
||||
nativeHistogram(bitmap, iArr, iArr2, iArr3, iArr4);
|
||||
}
|
||||
|
||||
public static void init(Context context2) {
|
||||
synchronized (f17443d) {
|
||||
context = context2;
|
||||
SoLoader.init(context2, false);
|
||||
NativeLibLoader.loadLibrary("gnustl_shared");
|
||||
NativeLibLoader.loadLibrary("vkchronicle");
|
||||
f();
|
||||
f17443d.notifyAll();
|
||||
}
|
||||
}
|
||||
|
||||
public static void intRGBToHSL(int i, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeRGBToHSL(Color.red(i), Color.green(i), Color.blue(i), fArr);
|
||||
}
|
||||
|
||||
public static void intRGBToHSV(int i, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeRGBToHSV(Color.red(i), Color.green(i), Color.blue(i), fArr);
|
||||
}
|
||||
|
||||
public static void intRGBToLab(int i, float[] fArr) {
|
||||
waitForContext();
|
||||
nativeRGBToLab(Color.red(i), Color.green(i), Color.blue(i), fArr);
|
||||
}
|
||||
|
||||
public static boolean isAsus() {
|
||||
return "asus".equalsIgnoreCase(Build.MANUFACTURER);
|
||||
}
|
||||
|
||||
public static boolean isMediaSupported() {
|
||||
if (!isMediaMasksLoaded) {
|
||||
e();
|
||||
}
|
||||
return isMediaMasksLoaded;
|
||||
}
|
||||
|
||||
public static boolean isX86() {
|
||||
try {
|
||||
String str = Build.SUPPORTED_ABIS[0];
|
||||
if (str != null) {
|
||||
return str.startsWith("x86");
|
||||
}
|
||||
return false;
|
||||
} catch (Throwable unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void lookupBitmap(Bitmap bitmap, Bitmap bitmap2) {
|
||||
waitForContext();
|
||||
nativeLookup(bitmap, bitmap2, Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
public static long mediaEncoderCreate(MediaEncoderSettings mediaEncoderSettings) {
|
||||
waitForContext();
|
||||
return nativeCreateEncoder(mediaEncoderSettings);
|
||||
}
|
||||
|
||||
public static int mediaEncoderDoEncode(long j) {
|
||||
waitForContext();
|
||||
return nativeDoEncode(j);
|
||||
}
|
||||
|
||||
public static void mediaEncoderDoRelease(long j) {
|
||||
waitForContext();
|
||||
nativeReleaseEncoder(j);
|
||||
}
|
||||
|
||||
private static native String nativeAllInOneShader();
|
||||
|
||||
private static native long nativeAnimationPlayerCreate(String str, int i, int i2, boolean z);
|
||||
|
||||
private static native int nativeAnimationPlayerDecode(long j, Bitmap bitmap);
|
||||
|
||||
private static native int nativeAnimationPlayerGetSize(long j);
|
||||
|
||||
private static native void nativeAnimationPlayerRelease(long j);
|
||||
|
||||
private static native boolean nativeAnimationPlayerSeek(long j, int i);
|
||||
|
||||
private static native long nativeAudioGetTotalPcmDuration();
|
||||
|
||||
private static native byte[] nativeAudioGetWaveform(short[] sArr, int i);
|
||||
|
||||
private static native int nativeAudioIsOpusFile(String str);
|
||||
|
||||
private static native int nativeAudioOpenOpusFile(String str);
|
||||
|
||||
private static native void nativeAudioReadOpusFile(ByteBuffer byteBuffer, int i, int[] iArr);
|
||||
|
||||
private static native int nativeAudioSeekOpusFile(float f2);
|
||||
|
||||
private static native int nativeAudioStartRecord(String str);
|
||||
|
||||
private static native void nativeAudioStopRecord();
|
||||
|
||||
private static native int nativeAudioWriteFrame(ByteBuffer byteBuffer, int i);
|
||||
|
||||
private static native void nativeBlur(Bitmap bitmap, int i);
|
||||
|
||||
private static native void nativeColorCorrection(Bitmap bitmap, Bitmap bitmap2, float[] fArr, int i, int i2);
|
||||
|
||||
private static native String nativeCreateColorCorrectionShader(float[] fArr, int i, int i2);
|
||||
|
||||
private static native void nativeCreateCurve(int[] iArr, int[] iArr2, int[] iArr3, int[] iArr4, int[] iArr5, float f2, float f3, float f4, float f5, float f6);
|
||||
|
||||
private static native long nativeCreateEncoder(MediaEncoderSettings mediaEncoderSettings);
|
||||
|
||||
private static native void nativeCurveSaturation(Bitmap bitmap, int[] iArr, double d2, int i);
|
||||
|
||||
private static native int nativeDoEncode(long j);
|
||||
|
||||
private static native void nativeEnhance(Bitmap bitmap, double d2, int i);
|
||||
|
||||
private static native void nativeFlipHorizontally(Bitmap bitmap);
|
||||
|
||||
private static native void nativeFlipVertically(Bitmap bitmap);
|
||||
|
||||
private static native void nativeHSLToRGB(float f2, float f3, float f4, int[] iArr);
|
||||
|
||||
private static native void nativeHSVToRGB(float f2, float f3, float f4, int[] iArr);
|
||||
|
||||
private static native void nativeHistogram(Bitmap bitmap, int[] iArr, int[] iArr2, int[] iArr3, int[] iArr4);
|
||||
|
||||
private static native byte[] nativeJpegTurboCompress(Bitmap bitmap, int i);
|
||||
|
||||
private static native void nativeLabToRGB(float f2, float f3, float f4, int[] iArr);
|
||||
|
||||
private static native void nativeLookup(Bitmap bitmap, Bitmap bitmap2, int i);
|
||||
|
||||
private static native String nativeOneInAllShader();
|
||||
|
||||
private static native void nativePinBitmap(Bitmap bitmap);
|
||||
|
||||
private static native void nativeProcessorCreate();
|
||||
|
||||
private static native boolean nativeProcessorDo(byte[] bArr, long[] jArr);
|
||||
|
||||
private static native int nativeProcessorGetVersion();
|
||||
|
||||
private static native boolean nativeProcessorInit(String str, int i, int i2);
|
||||
|
||||
private static native boolean nativeProcessorLoad(String str, boolean z);
|
||||
|
||||
private static native void nativeProcessorMouseTap(int i, float f2, float f3);
|
||||
|
||||
private static native void nativeProcessorRelease();
|
||||
|
||||
private static native void nativeRGBToHSL(int i, int i2, int i3, float[] fArr);
|
||||
|
||||
private static native void nativeRGBToHSV(int i, int i2, int i3, float[] fArr);
|
||||
|
||||
private static native void nativeRGBToLab(int i, int i2, int i3, float[] fArr);
|
||||
|
||||
private static native void nativeReleaseEncoder(long j);
|
||||
|
||||
private static native void nativeResize(Bitmap bitmap, Bitmap bitmap2, int i);
|
||||
|
||||
public static int openOpusFile(String str) {
|
||||
waitForContext();
|
||||
return nativeAudioOpenOpusFile(str);
|
||||
}
|
||||
|
||||
public static void pinBitmap(Bitmap bitmap) {
|
||||
waitForContext();
|
||||
nativePinBitmap(bitmap);
|
||||
}
|
||||
|
||||
public static void resizeBitmap(Bitmap bitmap, Bitmap bitmap2) {
|
||||
waitForContext();
|
||||
nativeResize(bitmap, bitmap2, Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
private static String getProcMaps(String str) {
|
||||
try (InputStream inputStream = Runtime.getRuntime().exec("cat /proc/" + str + "/maps").getInputStream()) {
|
||||
return new Scanner(inputStream).useDelimiter("\\A").next();
|
||||
} catch (Exception e) {
|
||||
return "empty";
|
||||
}
|
||||
}
|
||||
|
||||
public static class EncoderHandler extends Handler {
|
||||
private Callback a;
|
||||
|
||||
public EncoderHandler(Looper looper) {
|
||||
super(looper);
|
||||
}
|
||||
|
||||
@Keep
|
||||
public static Object postEventFromNative(Object obj, int i, int i2, int i3) {
|
||||
EncoderHandler encoderHandler;
|
||||
if (obj != null && (encoderHandler = (EncoderHandler) ((WeakReference<?>) obj).get()) != null) {
|
||||
if (i == 2) {
|
||||
return encoderHandler.a.getLayerBitmap(i2, i3);
|
||||
}
|
||||
encoderHandler.sendMessage(encoderHandler.obtainMessage(i, i2, i3, null));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
Callback callback = this.a;
|
||||
if (callback == null) {
|
||||
return;
|
||||
}
|
||||
int i = message.what;
|
||||
if (i == 0) {
|
||||
callback.onBytes(message.arg1);
|
||||
} else if (i != 1) {
|
||||
String str = MediaNative.a;
|
||||
Log.e(str, "Unknown message type " + message.what);
|
||||
} else {
|
||||
callback.onProgress(message.arg1);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCallback(Callback callback) {
|
||||
this.a = callback;
|
||||
}
|
||||
|
||||
public interface Callback {
|
||||
@Nullable
|
||||
Bitmap getLayerBitmap(int i, int i2);
|
||||
|
||||
void onBytes(int i);
|
||||
|
||||
void onProgress(int i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.StrictMode;
|
||||
import com.vk.medianative.MediaImageEncoder;
|
||||
import com.vk.medianative.MediaNative;
|
||||
import com.vtosters.lite.data.Users;
|
||||
import com.vtosters.lite.fragments.SettingsListFragment;
|
||||
import ru.vtosters.hooks.GmsHook;
|
||||
@@ -24,6 +25,8 @@ public class Preferences {
|
||||
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
|
||||
StrictMode.setThreadPolicy(policy); // fix profiles hide hook
|
||||
|
||||
MediaNative.init(application);
|
||||
|
||||
GmsHook.fixGapps();
|
||||
ProxyUtils.setProxy();
|
||||
NewsFeedFiltersUtils.setupFilters();
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
.class public interface abstract Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;
|
||||
.super Ljava/lang/Object;
|
||||
.source "MediaNative.java"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
||||
value = Lcom/vk/medianative/MediaNative$EncoderHandler;
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/InnerClass;
|
||||
accessFlags = 0x609
|
||||
name = "Callback"
|
||||
.end annotation
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public abstract getLayerBitmap(II)Landroid/graphics/Bitmap;
|
||||
.annotation build Landroidx/annotation/Nullable;
|
||||
.end annotation
|
||||
.end method
|
||||
|
||||
.method public abstract onBytes(I)V
|
||||
.end method
|
||||
|
||||
.method public abstract onProgress(I)V
|
||||
.end method
|
||||
@@ -1,157 +0,0 @@
|
||||
.class public Lcom/vk/medianative/MediaNative$EncoderHandler;
|
||||
.super Landroid/os/Handler;
|
||||
.source "MediaNative.java"
|
||||
|
||||
|
||||
# annotations
|
||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
||||
value = Lcom/vk/medianative/MediaNative;
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/InnerClass;
|
||||
accessFlags = 0x9
|
||||
name = "EncoderHandler"
|
||||
.end annotation
|
||||
|
||||
.annotation system Ldalvik/annotation/MemberClasses;
|
||||
value = {
|
||||
Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;
|
||||
}
|
||||
.end annotation
|
||||
|
||||
|
||||
# instance fields
|
||||
.field private a:Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;
|
||||
|
||||
|
||||
# direct methods
|
||||
.method constructor <init>(Landroid/os/Looper;)V
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
invoke-direct {p0, p1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public static postEventFromNative(Ljava/lang/Object;III)Ljava/lang/Object;
|
||||
.locals 2
|
||||
.annotation build Landroidx/annotation/Keep;
|
||||
.end annotation
|
||||
|
||||
const/4 v0, 0x0
|
||||
|
||||
if-nez p0, :cond_0
|
||||
|
||||
return-object v0
|
||||
|
||||
.line 1
|
||||
:cond_0
|
||||
check-cast p0, Ljava/lang/ref/WeakReference;
|
||||
|
||||
invoke-virtual {p0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
check-cast p0, Lcom/vk/medianative/MediaNative$EncoderHandler;
|
||||
|
||||
if-eqz p0, :cond_2
|
||||
|
||||
const/4 v1, 0x2
|
||||
|
||||
if-ne p1, v1, :cond_1
|
||||
|
||||
.line 2
|
||||
iget-object p0, p0, Lcom/vk/medianative/MediaNative$EncoderHandler;->a:Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;
|
||||
|
||||
invoke-interface {p0, p2, p3}, Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;->getLayerBitmap(II)Landroid/graphics/Bitmap;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
return-object p0
|
||||
|
||||
.line 3
|
||||
:cond_1
|
||||
invoke-virtual {p0, p1, p2, p3, v0}, Landroid/os/Handler;->obtainMessage(IIILjava/lang/Object;)Landroid/os/Message;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
.line 4
|
||||
invoke-virtual {p0, p1}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
|
||||
|
||||
:cond_2
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
|
||||
# virtual methods
|
||||
.method public handleMessage(Landroid/os/Message;)V
|
||||
.locals 3
|
||||
|
||||
.line 1
|
||||
iget-object v0, p0, Lcom/vk/medianative/MediaNative$EncoderHandler;->a:Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;
|
||||
|
||||
if-nez v0, :cond_0
|
||||
|
||||
return-void
|
||||
|
||||
.line 2
|
||||
:cond_0
|
||||
iget v1, p1, Landroid/os/Message;->what:I
|
||||
|
||||
if-eqz v1, :cond_2
|
||||
|
||||
const/4 v2, 0x1
|
||||
|
||||
if-eq v1, v2, :cond_1
|
||||
|
||||
.line 3
|
||||
invoke-static {}, Lcom/vk/medianative/MediaNative;->a()Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
new-instance v1, Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
||||
|
||||
const-string v2, "Unknown message type "
|
||||
|
||||
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||
|
||||
iget p1, p1, Landroid/os/Message;->what:I
|
||||
|
||||
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
||||
|
||||
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
||||
|
||||
return-void
|
||||
|
||||
.line 4
|
||||
:cond_1
|
||||
iget p1, p1, Landroid/os/Message;->arg1:I
|
||||
|
||||
invoke-interface {v0, p1}, Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;->onProgress(I)V
|
||||
|
||||
return-void
|
||||
|
||||
.line 5
|
||||
:cond_2
|
||||
iget p1, p1, Landroid/os/Message;->arg1:I
|
||||
|
||||
invoke-interface {v0, p1}, Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;->onBytes(I)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
.method public setCallback(Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;)V
|
||||
.locals 0
|
||||
|
||||
.line 1
|
||||
iput-object p1, p0, Lcom/vk/medianative/MediaNative$EncoderHandler;->a:Lcom/vk/medianative/MediaNative$EncoderHandler$Callback;
|
||||
|
||||
return-void
|
||||
.end method
|
||||
File diff suppressed because it is too large
Load Diff
@@ -758,7 +758,7 @@
|
||||
.line 3
|
||||
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
||||
|
||||
invoke-static {v0}, Lcom/vk/medianative/MediaNative;->init(Landroid/content/Context;)V
|
||||
# invoke-static {v0}, Lcom/vk/medianative/MediaNative;->init(Landroid/content/Context;)V
|
||||
|
||||
.line 4
|
||||
sget-object v0, Lcom/vk/libvideo/storage/VideoPositionStorage;->e:Lcom/vk/libvideo/storage/VideoPositionStorage$c;
|
||||
|
||||
Reference in New Issue
Block a user