Skip to content

Bugfixes - Video Capture for A4.3 && Aync IO #8

Closed
wants to merge 2 commits into from

4 participants

@agrieve
agrieve commented Dec 6, 2013

Relevant JIRA issue for the async IO problem:
https://issues.apache.org/jira/browse/CB-5517

And for the ACTION_VIDEO_CAPTURE Uri problem:
https://issues.apache.org/jira/browse/CB-5202

@agrieve agrieve commented on the diff Dec 6, 2013
src/android/Capture.java
@@ -374,35 +390,58 @@ else if (resultCode == Activity.RESULT_CANCELED) {
* @return a JSONObject that represents a File
* @throws IOException
*/
- private JSONObject createMediaFile(Uri data) {
- File fp = webView.getResourceApi().mapUriToFile(data);
- JSONObject obj = new JSONObject();
+ private JSONObject createMediaFile(final Uri data) {
+ Future<JSONObject> result = cordova.getThreadPool().submit(new Callable<JSONObject>()
@agrieve
agrieve added a note Dec 6, 2013

createMediaFile is just a helper method, so it shouldn't do any multithreading. Instead, you should put the async logic into the caller. This is done already except for in onActivityResult().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@agrieve
agrieve commented Dec 6, 2013

Before we can merge your code, I need to confirm that you have signed the Apache Contributor License Agreement?
http://www.apache.org/licenses/#clas

@infil00p
infil00p commented Dec 9, 2013

Async IO has already been fixed on this plugin. Can you please update your patch to work with the latest code?

@agrieve
agrieve commented Dec 9, 2013

FYI - CB-5517 was just fixed by pull request #10 (which was essentially the same fix). So, there's just CB-5202 to look at here now.

@mbillau
mbillau commented Jan 31, 2014

Hey guys, any word on this? I looked on the ASF page and couldn't find @lubogospod listed anywhere as having signed a CLA. I implemented a stripped down version of this to verify that it fixes the video capture issue on Android 4.3 (nexus devices) since we are getting some requests for this fix.

@lubogospod

Closing, I believe these are already fixed.

@lubogospod lubogospod closed this Feb 6, 2014
@mbillau
mbillau commented Feb 6, 2014

Sorry, but I'm still not able to record video on 4.3. The plugin works fine on 4.2 and 4.4 but with 4.3 it still needs the null fencing [1] because of this specific 4.3 regression [2]. I can work on putting this specific change in unless you want to submit a new pull request. Also, sorry to bug but did you sign an ICLA? For tiny fixes like null-fencing where there is really only one solution it's probably not a big deal but it's always better to be safe then sorry.

[1] https://github.com/apache/cordova-plugin-media-capture/pull/8/files#diff-163d1c08eb8ae99453136db2878340d7R330
[2] https://code.google.com/p/android/issues/detail?id=57996

@mbillau mbillau referenced this pull request Feb 12, 2014
Closed

CB-5202 fix from lubogospod #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.