summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2014-03-13 16:29:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 13:48:57 +0100
commit5b4b108d640eb1a6c6e2808eb5da0498bf507432 (patch)
treea560150968f8f668448979118c9b95d9dc1d3f72
parent8463aae9c0adba2a9d76db14d2e6938e1fed53fc (diff)
Android: print Java traces for MediaRecorder when in debug mode.
Change-Id: Ie39dd16227c49c8c07831750869e0cc28d2cc8ee Reviewed-by: Christian Stromme <christian.stromme@digia.com>
-rw-r--r--src/plugins/android/src/wrappers/jmediarecorder.cpp66
1 files changed, 56 insertions, 10 deletions
diff --git a/src/plugins/android/src/wrappers/jmediarecorder.cpp b/src/plugins/android/src/wrappers/jmediarecorder.cpp
index b2b93f893..2c3eaeab7 100644
--- a/src/plugins/android/src/wrappers/jmediarecorder.cpp
+++ b/src/plugins/android/src/wrappers/jmediarecorder.cpp
@@ -88,6 +88,9 @@ bool JMediaRecorder::prepare()
QJNIEnvironmentPrivate env;
callMethod<void>("prepare");
if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
return false;
}
@@ -104,6 +107,9 @@ bool JMediaRecorder::start()
QJNIEnvironmentPrivate env;
callMethod<void>("start");
if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
return false;
}
@@ -114,8 +120,12 @@ void JMediaRecorder::stop()
{
QJNIEnvironmentPrivate env;
callMethod<void>("stop");
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setAudioChannels(int numChannels)
@@ -127,8 +137,12 @@ void JMediaRecorder::setAudioEncoder(AudioEncoder encoder)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setAudioEncoder", "(I)V", int(encoder));
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setAudioEncodingBitRate(int bitRate)
@@ -145,8 +159,12 @@ void JMediaRecorder::setAudioSource(AudioSource source)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setAudioSource", "(I)V", int(source));
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setCamera(JCamera *camera)
@@ -159,8 +177,12 @@ void JMediaRecorder::setVideoEncoder(VideoEncoder encoder)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setVideoEncoder", "(I)V", int(encoder));
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setVideoEncodingBitRate(int bitRate)
@@ -172,40 +194,60 @@ void JMediaRecorder::setVideoFrameRate(int rate)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setVideoFrameRate", "(I)V", rate);
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setVideoSize(const QSize &size)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setVideoSize", "(II)V", size.width(), size.height());
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setVideoSource(VideoSource source)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setVideoSource", "(I)V", int(source));
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setOrientationHint(int degrees)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setOrientationHint", "(I)V", degrees);
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setOutputFormat(OutputFormat format)
{
QJNIEnvironmentPrivate env;
callMethod<void>("setOutputFormat", "(I)V", int(format));
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
void JMediaRecorder::setOutputFile(const QString &path)
@@ -214,8 +256,12 @@ void JMediaRecorder::setOutputFile(const QString &path)
callMethod<void>("setOutputFile",
"(Ljava/lang/String;)V",
QJNIObjectPrivate::fromString(path).object());
- if (env->ExceptionCheck())
+ if (env->ExceptionCheck()) {
+#ifdef QT_DEBUG
+ env->ExceptionDescribe();
+#endif
env->ExceptionClear();
+ }
}
static JNINativeMethod methods[] = {