[xiph-commits] r3748 - libannodex/trunk/src/importers

conrad at svn.annodex.net conrad at svn.annodex.net
Wed Oct 29 04:06:10 PDT 2008


Author: conrad
Date: 2008-10-29 04:06:10 -0700 (Wed, 29 Oct 2008)
New Revision: 3748

Modified:
   libannodex/trunk/src/importers/anx_import_ogg.c
Log:
anx_import_ogg: remove support for deprecated content types
(anxv2 AnxData, theora < beta3, ogm)


Modified: libannodex/trunk/src/importers/anx_import_ogg.c
===================================================================
--- libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-29 11:06:02 UTC (rev 3747)
+++ libannodex/trunk/src/importers/anx_import_ogg.c	2008-10-29 11:06:10 UTC (rev 3748)
@@ -73,13 +73,10 @@
 #define VORBIS_CONTENT_TYPE "audio/vorbis"
 #define SPEEX_CONTENT_TYPE "audio/speex"
 #define THEORA_CONTENT_TYPE "video/theora"
-#define XVID_CONTENT_TYPE "video/xvid"
 
 /** well-defined sizeof(AnxData) binary portion for Annodex v2 */
 #define ANX_DATA_SIZE 28
 
-#undef  USE_THEORA_PRE_ALPHA_3_FORMAT
-
 #define SUBSECONDS 1000.0
 
 /***********************************************************
@@ -114,7 +111,6 @@
 
 struct _AnxOggTrack {
   AnxSourceTrack source_track;
-  int anxv2_ignore_packet;
   int need_keygranule;
   ogg_int64_t keygranule;
   double keygranule_time;
@@ -381,62 +377,9 @@
         need_insert = 0;
         aod->skeleton_serialno = serialno;
         break;
-      case OGGZ_CONTENT_ANX2: /* AnxData */
-        {
-          AnxParams * params;
-          long n;
-          char * buf;
-
-          /* Mark this track as anxv2, and don't copy the AnxData packet
-           * into the bitstream */
-          aot->anxv2_ignore_packet = 1;
-
-          /* Set default values, these will be overwritten if the track
-           * actually contains a content type we can parse */
-
-          /* Ensure params is NUL terminated */
-          n = op->bytes - ANX_DATA_SIZE;
-          buf = anx_malloc (n+1);
-          memcpy (buf, (char *)header + ANX_DATA_SIZE, n);
-          buf[n] = '\0';
-
-          params = anx_params_new_parse (buf, ANX_PARAMS_HEADERS);
-          track->content_type =
-	         anxogg_strdup (anx_params_get (params, "Content-Type"));
-          track->id =
-	         anxogg_strdup (anx_params_get (params, "ID"));
-          anx_params_free (params);
-
-          anx_free (buf);
-
-          track->preroll = 0;
-
-          if (!strcmp (track->content_type, CMML_CONTENT_TYPE)) {
-             need_insert = 0;
-             aod->cmml_serialno = serialno;
-             aod->cmml_granuleshift = 0;
-#ifdef DEBUG
-             fprintf(aod->df,
-                     "read_packet_headers: setting need_keygranule to 0\n");
-#endif
-	             aod->cmml_need_keygranule = 0;
-	  }
-        }
-        break;
       default:
-        /* Content type not known by Oggz */
-        if ( !strncmp ((char *)&op->packet[1], "video", 5) && !strncmp ((char *)&op->packet[9], "XVID", 4)) {
-          track->content_type = anxogg_strdup (XVID_CONTENT_TYPE);
-          track->granule_rate_n = (ogg_int64_t) 25;
-          track->granule_rate_d = 1;
-          track->nr_header_packets = 2;
-          track->basegranule = 0;
-          track->preroll = 0;
-          track->granuleshift = 0;
-        } else {
-          anx_free (aot);
-          return OGGZ_STOP_ERR;
-        }
+        anx_free (aot);
+        return OGGZ_STOP_ERR;
       }
 
       aod->nr_headers_remaining += track->nr_header_packets;
@@ -500,11 +443,6 @@
     aod->got_non_bos = 1;
   }
 
-  if (aot && aot->anxv2_ignore_packet) {
-    aot->anxv2_ignore_packet = 0;
-    op->b_o_s = 1;
-  }
-
   if (aod->nr_headers_remaining > 0) {
     aod->nr_headers_remaining--;
   }
@@ -989,13 +927,7 @@
     }
   }
 
-  if (op->b_o_s) {
-    if (!strncmp ((char *)&op->packet[0], "AnxData", 7)) {
-      /* Mark this track as anxv2, and don't copy the AnxData packet
-       * into the bitstream */
-      if (aot) aot->anxv2_ignore_packet = 1;
-    }
-  } else {
+  if (!op->b_o_s) {
     if (aod->cmml_serialno != -1 && serialno == aod->cmml_serialno) {
       double at_time;
 
@@ -1042,12 +974,7 @@
       }
       return OGGZ_CONTINUE;
     } else {
-      if (aot->anxv2_ignore_packet) {
-        aot->anxv2_ignore_packet = 0;
-        op->b_o_s = 1;
-      } else {
-        aod->got_non_bos = 1;
-      }
+      aod->got_non_bos = 1;
     }
   }
 
@@ -1076,9 +1003,8 @@
         aod->state == STATE_FILTER ? "USE_FN" : "NO_FN");
 #endif
 
-  if (!aod->ignore_media && !aod->got_end && !aot->anxv2_ignore_packet &&
-      (aod->state != STATE_FILTER ||
-       filter (aod, aot, serialno, op))) {
+  if (!aod->ignore_media && !aod->got_end &&
+      (aod->state != STATE_FILTER || filter (aod, aot, serialno, op))) {
 #ifdef DEBUG
     fprintf (aod->df, "anxogg::read_packet_data: no, copy out\n");
 #endif
@@ -1408,15 +1334,6 @@
   THEORA_CONTENT_TYPE
 };
 
-static struct _AnxImporter anx_xvid_importer = {
-  (AnxImporterOpenFunc)anxogg_open,
-  (AnxImporterOpenFDFunc)NULL,
-  (AnxImporterCloseFunc)anxogg_close,
-  (AnxImporterReadFunc)anxogg_read,
-  (AnxImporterSizeofNextReadFunc)anxogg_sizeof_next_read,
-  XVID_CONTENT_TYPE
-};
-
 AnxImporter *
 anx_importer_init (int i)
 {
@@ -1431,8 +1348,6 @@
     return &anx_speex_importer;
   case 4:
     return &anx_theora_importer;
-  case 5:
-    return &anx_xvid_importer;
   default:
     return NULL;
   }



More information about the commits mailing list