add some stubs to make NewPipe video player work again

This commit is contained in:
Julian Winkler
2024-02-03 23:40:20 +01:00
parent f107328bf4
commit 850fd2f076
4 changed files with 18 additions and 1 deletions

View File

@@ -42,6 +42,9 @@ JNIEXPORT jlong JNICALL Java_android_graphics_Bitmap_native_1bitmap_1from_1path(
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobject this)
{
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
if (!pixbuf) {
return 10;
}
return gdk_pixbuf_get_width(pixbuf);
}
@@ -49,6 +52,9 @@ JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getWidth(JNIEnv *env, jobjec
JNIEXPORT jint JNICALL Java_android_graphics_Bitmap_getHeight(JNIEnv *env, jobject this)
{
GdkPixbuf *pixbuf = _PTR(_GET_LONG_FIELD(this, "pixbuf"));
if (!pixbuf) {
return 10;
}
return gdk_pixbuf_get_height(pixbuf);
}

View File

@@ -719,4 +719,8 @@ public class TypedArray {
public String toString() {
return Arrays.toString(mData);
}
public int getChangingConfigurations() {
return 0;
}
}

View File

@@ -1251,7 +1251,8 @@ public final class Bitmap {
* that config, otherwise return null.
*/
public final Config getConfig() {
return Config.nativeToConfig(nativeConfig(mNativeBitmap));
// return Config.nativeToConfig(nativeConfig(mNativeBitmap));
return Config.ARGB_8888;
}
/**

View File

@@ -13,10 +13,12 @@ import org.xmlpull.v1.XmlPullParserException;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.content.res.Resources.Theme;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.TypedValue;
public class Drawable {
@@ -131,6 +133,10 @@ public class Drawable {
return null;
}
public static Drawable createFromXmlInner(Resources resources, XmlPullParser parser, AttributeSet attrs, Theme theme) {
return null;
}
public static Drawable createFromResourceStream(Resources resources, TypedValue value, InputStream is, String file,
Object object) {
Path path = Paths.get(android.os.Environment.getExternalStorageDirectory().getPath(), file);