[Android] jni: do not prevent thumbnailing of large videos (e.g. 4K)
Felix Abecassis
git at videolan.org
Thu Feb 20 16:52:59 CET 2014
vlc-ports/android | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Thu Feb 20 16:39:27 2014 +0100| [f687f14ae400940d3c2b4942e7672feffa28d832] | committer: Felix Abecassis
jni: do not prevent thumbnailing of large videos (e.g. 4K)
Bump upper bound on video dimension to 4096x2304, this format is used
by some 4K cameras and thus many samples are using this resolution.
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f687f14ae400940d3c2b4942e7672feffa28d832
---
vlc-android/jni/thumbnailer.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index 9bb644c..2a95d21 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -34,6 +34,10 @@
#define THUMBNAIL_POSITION 0.5
#define PIXEL_SIZE 4 /* RGBA */
+#define THUMBNAIL_MIN_WIDTH 32
+#define THUMBNAIL_MAX_WIDTH 4096
+#define THUMBNAIL_MIN_HEIGHT 32
+#define THUMBNAIL_MAX_HEIGHT 2304
/*
@@ -207,7 +211,8 @@ jbyteArray Java_org_videolan_libvlc_LibVLC_getThumbnail(JNIEnv *env, jobject thi
goto end;
}
- if( videoWidth < 32 || videoHeight < 32 || videoWidth > 2048 || videoWidth > 2048 )
+ if( videoWidth < THUMBNAIL_MIN_WIDTH || videoHeight < THUMBNAIL_MIN_HEIGHT
+ || videoWidth > THUMBNAIL_MAX_WIDTH || videoHeight > THUMBNAIL_MAX_HEIGHT )
{
LOGE("Wrong video dimensions.\n");
goto end;
More information about the Android
mailing list