nicolas2k / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
1 stars 0 forks source link

When using ACTION_VIDEO_CAPTURE, thumbnail is either non-existent or not accessible #325

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
        Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
        startActivityForResult(intent, REQUEST_CODE);
2.     in onActivityResult(), attempt to retrieve the video and thumbnail.
example code:

        final String filePath = data.getStringExtra(CameraManager.EXTRA_VIDEO_FILE_PATH);
        final String screenshotPath = data.getStringExtra(CameraManager.EXTRA_THUMBNAIL_FILE_PATH);
        Log.d(TAG, "Camera video location : " + filePath);
        Log.d(TAG, "Camera screenshot location : " + screenshotPath);

        File screenshot = new File(screenshotPath);
        if (screenshot.exists()) {
            doStuff(filePath, screenshotPath);
        } else {
            Log.d(TAG, "Waiting for file to be written.");
            // wait for file to be written, then do stuff
            fileObs = new FileObserver(screenshot.getParentFile().getAbsolutePath(),
                    FileObserver.CLOSE_WRITE) {
                @Override
                public void onEvent(int event, String path) {
                    doStuff(filePath, screenshotPath);
                }
            };
            fileObs.startWatching();
        }
    }

What is the expected output? What do you see instead?
expected output is for both files to exist or eventually exist.

fileObs never observes a CLOSE_WRITE on the thumbnail file.

What version of the product are you using? On what operating system?
XE12

Please provide any additional information below.

log example output:
Camera video location : /mnt/sdcard/DCIM/Camera/20131226_151859_219.mp4
Camera screenshot location : /data/private-cache/t_thumb_20131226_151859_219.mp4

Original issue reported on code.google.com by yincrash on 26 Dec 2013 at 8:26

GoogleCodeExporter commented 8 years ago

Original comment by ala...@google.com on 6 Jan 2014 at 7:02

GoogleCodeExporter commented 8 years ago
The symptoms are identical to 
https://code.google.com/p/google-glass-api/issues/detail?id=355 (which is not 
fixed - only a workaround was suggested)

Original comment by eug...@wearableintelligence.com on 10 Jan 2014 at 10:53

GoogleCodeExporter commented 8 years ago
No, this is not the same issue as #355, I'm not attempting to set an output 
location, just monitoring the output location I was told (in the resulting 
data) would exist.

Original comment by yincrash on 10 Jan 2014 at 10:59

GoogleCodeExporter commented 8 years ago
I was not referring to the declared problem, but the stacktrace I got. It is 
also about thumbnails. Not only is it about thumbnails, but it is also 
complaining that thumbnail could not be created. This seems quite relevant to 
your problem, imo

Original comment by eug...@wearableintelligence.com on 10 Jan 2014 at 11:05

GoogleCodeExporter commented 8 years ago
This has been fixed as of XE16.

Original comment by ala...@google.com on 16 Apr 2014 at 3:51