[xiph-commits] r12747 - in experimental/j/theora-mashup: lib lib/dec lib/enc tests

j at svn.xiph.org j at svn.xiph.org
Tue Mar 13 02:02:08 PDT 2007


Author: j
Date: 2007-03-13 02:02:01 -0700 (Tue, 13 Mar 2007)
New Revision: 12747

Added:
   experimental/j/theora-mashup/lib/enc/comment.c
   experimental/j/theora-mashup/lib/enc/encoder_disabled.c
   experimental/j/theora-mashup/tests/commentexp-test.c
Modified:
   experimental/j/theora-mashup/lib/Makefile.am
   experimental/j/theora-mashup/lib/dec/apiwrapper.c
   experimental/j/theora-mashup/tests/
   experimental/j/theora-mashup/tests/Makefile.am
   experimental/j/theora-mashup/tests/comment-test.c
Log:
- disable comments in apiwrapper and use comment.c from trunk.
  comments are broken in theora-exp right now



Modified: experimental/j/theora-mashup/lib/Makefile.am
===================================================================
--- experimental/j/theora-mashup/lib/Makefile.am	2007-03-13 08:49:08 UTC (rev 12746)
+++ experimental/j/theora-mashup/lib/Makefile.am	2007-03-13 09:02:01 UTC (rev 12747)
@@ -28,6 +28,7 @@
 	enc/encoder_toplevel.c \
 	enc/blockmap.c \
 	enc/common.c \
+	enc/comment.c \
 	enc/dct.c \
 	enc/dct_decode.c \
 	enc/frarray.c \

Modified: experimental/j/theora-mashup/lib/dec/apiwrapper.c
===================================================================
--- experimental/j/theora-mashup/lib/dec/apiwrapper.c	2007-03-13 08:49:08 UTC (rev 12746)
+++ experimental/j/theora-mashup/lib/dec/apiwrapper.c	2007-03-13 09:02:01 UTC (rev 12747)
@@ -231,7 +231,7 @@
     return theora_granule_time_enc(_td, _gp);
   return th_granule_time(((th_api_wrapper *)_td->i->codec_setup)->decode,_gp);
 }
-
+/*
 void theora_comment_init(theora_comment *_tc){
   th_comment_init((th_comment *)_tc);
 }
@@ -254,4 +254,5 @@
 
 void theora_comment_add_tag(theora_comment *_tc, char *_tag, char *_value){
   th_comment_add_tag((th_comment *)_tc,_tag,_value);
-}
\ No newline at end of file
+}
+*/
\ No newline at end of file

Copied: experimental/j/theora-mashup/lib/enc/comment.c (from rev 12672, trunk/theora/lib/comment.c)

Copied: experimental/j/theora-mashup/lib/enc/encoder_disabled.c (from rev 12672, trunk/theora/lib/encoder_disabled.c)


Property changes on: experimental/j/theora-mashup/tests
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
noop
comment-test
.libs
.deps

   + Makefile
Makefile.in
noop
comment-test
commentexp-test
.libs
.deps
.gdb_history


Modified: experimental/j/theora-mashup/tests/Makefile.am
===================================================================
--- experimental/j/theora-mashup/tests/Makefile.am	2007-03-13 08:49:08 UTC (rev 12746)
+++ experimental/j/theora-mashup/tests/Makefile.am	2007-03-13 09:02:01 UTC (rev 12747)
@@ -19,6 +19,10 @@
 noop_LDADD = $(THEORA_LIBS)
 noop_CFLAGS = $(OGG_CFLAGS)
 
+#commentexp_test_SOURCES = commentexp-test.c
+#commentexp_test_LDADD = $(THEORA_LIBS)
+#commentexp_test_CFLAGS = $(OGG_CFLAGS)
+
 comment_test_SOURCES = comment-test.c
 comment_test_LDADD = $(THEORA_LIBS)
 comment_test_CFLAGS = $(OGG_CFLAGS)

Modified: experimental/j/theora-mashup/tests/comment-test.c
===================================================================
--- experimental/j/theora-mashup/tests/comment-test.c	2007-03-13 08:49:08 UTC (rev 12746)
+++ experimental/j/theora-mashup/tests/comment-test.c	2007-03-13 09:02:01 UTC (rev 12747)
@@ -29,6 +29,8 @@
 
   INFO ("+ Querying value of LICENSE");
   value = theora_comment_query (&tc, "LICENSE", 0);
+  printf("foo %s\n", value);
+
   if (strcmp (value, LICENSE))
     FAIL ("Incorrect value for LICENSE");
 

Added: experimental/j/theora-mashup/tests/commentexp-test.c
===================================================================
--- experimental/j/theora-mashup/tests/commentexp-test.c	2007-03-13 08:49:08 UTC (rev 12746)
+++ experimental/j/theora-mashup/tests/commentexp-test.c	2007-03-13 09:02:01 UTC (rev 12747)
@@ -0,0 +1,74 @@
+#include <theora/theoradec.h>
+
+#include <string.h>
+#include "tests.h"
+
+#define ARTIST1 "Bug-eyed Fish"
+#define ARTIST2 "VJ Fugu"
+#define COPYRIGHT "Copyright (C) 2005. Some Rights Reserved."
+#define LICENSE "Creative Commons Attribution-ShareAlike 2.5"
+
+static int
+test_comments ()
+{
+  th_comment tc;
+  int i, n;
+  char * value;
+
+  INFO ("+ Initializing theora_comment");
+  th_comment_init (&tc);
+
+  INFO ("+ Adding ARTIST1");
+  th_comment_add (&tc, "ARTIST=" ARTIST1);
+
+  INFO ("+ Adding LICENSE by tag");
+  th_comment_add_tag (&tc, "LICENSE", LICENSE);
+
+  INFO ("+ Adding ARTIST2 by tag");
+  th_comment_add_tag (&tc, "ARTIST", ARTIST2);
+
+  INFO ("+ Querying value of LICENSE");
+  value = th_comment_query (&tc, "LICENSE", 0);
+  printf("foo %s\n", value);
+
+  if (strcmp (value, LICENSE))
+    FAIL ("Incorrect value for LICENSE");
+
+  INFO ("+ Querying count of ARTIST comments");
+  n = th_comment_query_count (&tc, "ARTIST");
+
+  if (n != 2)
+    FAIL ("Incorrect count of ARTIST comments");
+
+  INFO ("+ Querying value of ARTIST index 0");
+  value = th_comment_query (&tc, "ARTIST", 0);
+  if (strcmp (value, ARTIST1))
+    FAIL ("Incorrect value for ARTIST index 0");
+
+  INFO ("+ Querying value of ARTIST index 1");
+  value = th_comment_query (&tc, "ARTIST", 1);
+  if (strcmp (value, ARTIST2))
+    FAIL ("Incorrect value for ARTIST index 1");
+
+  INFO ("+ Querying value of ARTIST index 2 (out of bounds)");
+  value = th_comment_query (&tc, "ARTIST", 2);
+  if (value != NULL)
+    FAIL ("Non-NULL value for ARTIST index 2 (out of bounds)");
+
+  INFO ("+ Querying value of UNDEF index 7 (tag not defined)");
+  value = th_comment_query (&tc, "UNDEF", 7);
+  if (value != NULL)
+    FAIL ("Non-NULL value for UNDEF index 7 (tag not defined)");
+
+  INFO ("+ Clearing theora_comment");
+  th_comment_clear (&tc);
+
+  return 0;
+}
+
+int main(int argc, char *argv[])
+{
+  test_comments ();
+
+  exit (0);
+}



More information about the commits mailing list