OSDN Git Service

Add timestamp as a port to GLTextureSource.
authorEino-Ville Talvala <etalvala@google.com>
Wed, 10 Aug 2011 22:41:01 +0000 (15:41 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Wed, 10 Aug 2011 22:46:34 +0000 (15:46 -0700)
Allows filter chains using external texture sources to propagate
timestamps provided by the external source.

Bug: 5149729
Change-Id: Ic365257306636ea1083ad23a811a48a5e872bd5b

mca/filterfw/java/android/filterfw/basefilters/GLTextureSource.java

index 1eb894d..1776820 100644 (file)
@@ -45,6 +45,14 @@ public class GLTextureSource extends Filter {
     @GenerateFieldPort(name = "repeatFrame", hasDefault = true)
     private boolean mRepeatFrame = false;
 
+    /* This timestamp will be used for all output frames from this source.  They
+     * represent nanoseconds, and should be positive and monotonically
+     * increasing.  Set to Frame.TIMESTAMP_UNKNOWN if timestamps are not
+     * meaningful for these textures.
+     */
+    @GenerateFieldPort(name = "timestamp", hasDefault = true)
+    private long mTimestamp = Frame.TIMESTAMP_UNKNOWN;
+
     private Frame mFrame;
 
     public GLTextureSource(String name) {
@@ -76,7 +84,7 @@ public class GLTextureSource extends Filter {
             mFrame = context.getFrameManager().newBoundFrame(outputFormat,
                                                              GLFrame.EXISTING_TEXTURE_BINDING,
                                                              mTexId);
-            mFrame.setTimestamp(Frame.TIMESTAMP_UNKNOWN);
+            mFrame.setTimestamp(mTimestamp);
         }
 
         // Push output