summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/SnailSource.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-03-22 17:42:33 +0800
committerChih-Chung Chang <chihchung@google.com>2012-04-02 11:24:23 +0800
commit037e06c5e11ca4a4e40b0741f2d6604b2fd9337a (patch)
tree047235a4ce31aa2c013db38d99056a7196b491e1 /src/com/android/gallery3d/data/SnailSource.java
parentb10f96d2141fae10073ec48f25d7b824647f8f31 (diff)
downloadandroid_packages_apps_Snap-037e06c5e11ca4a4e40b0741f2d6604b2fd9337a.tar.gz
android_packages_apps_Snap-037e06c5e11ca4a4e40b0741f2d6604b2fd9337a.tar.bz2
android_packages_apps_Snap-037e06c5e11ca4a4e40b0741f2d6604b2fd9337a.zip
Use SurfaceTexture to show Camera preview.
Change-Id: I8bf63dfc5b969ecce51841378b093a650b6f91d8
Diffstat (limited to 'src/com/android/gallery3d/data/SnailSource.java')
-rw-r--r--src/com/android/gallery3d/data/SnailSource.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/data/SnailSource.java b/src/com/android/gallery3d/data/SnailSource.java
index 17b899dba..e74a8bb94 100644
--- a/src/com/android/gallery3d/data/SnailSource.java
+++ b/src/com/android/gallery3d/data/SnailSource.java
@@ -55,14 +55,23 @@ public class SnailSource extends MediaSource {
return null;
}
- // Register a ScreenNail. Returns the Path of the MediaSet
- // containing the MediaItem associated with the ScreenNail.
- public static synchronized Path registerScreenNail(ScreenNail s) {
+ // Registers a ScreenNail and returns the id of it. You can obtain the Path
+ // of the MediaItem associated with the ScreenNail by getItemPath(), and the
+ // Path of the MediaSet containing that MediaItem by getSetPath().
+ public static synchronized int registerScreenNail(ScreenNail s) {
int id = sNextId++;
sRegistry.put(id, s);
+ return id;
+ }
+
+ public static Path getSetPath(int id) {
return Path.fromString("/snail/set").getChild(id);
}
+ public static Path getItemPath(int id) {
+ return Path.fromString("/snail/item").getChild(id);
+ }
+
public static synchronized void unregisterScreenNail(ScreenNail s) {
int index = sRegistry.indexOfValue(s);
sRegistry.removeAt(index);