[xiph-commits] r3561 - in liboggplay/trunk: . include/oggplay python src/liboggplay src/tests src/tools

conrad at svn.annodex.net conrad at svn.annodex.net
Mon Apr 21 12:27:30 PDT 2008


Author: conrad
Date: 2008-04-21 12:27:28 -0700 (Mon, 21 Apr 2008)
New Revision: 3561

Modified:
   liboggplay/trunk/README
   liboggplay/trunk/configure.ac
   liboggplay/trunk/include/oggplay/oggplay.h
   liboggplay/trunk/include/oggplay/oggplay_enums.h
   liboggplay/trunk/include/oggplay/oggplay_query.h
   liboggplay/trunk/oggplay.pc.in
   liboggplay/trunk/python/liboggplay.i
   liboggplay/trunk/src/liboggplay/Makefile.am
   liboggplay/trunk/src/liboggplay/Version_script.in
   liboggplay/trunk/src/liboggplay/oggplay.c
   liboggplay/trunk/src/liboggplay/oggplay_callback.c
   liboggplay/trunk/src/liboggplay/oggplay_callback_info.c
   liboggplay/trunk/src/liboggplay/oggplay_data.c
   liboggplay/trunk/src/liboggplay/oggplay_data.h
   liboggplay/trunk/src/liboggplay/oggplay_private.h
   liboggplay/trunk/src/liboggplay/oggplay_query.c
   liboggplay/trunk/src/tests/Makefile.am
   liboggplay/trunk/src/tools/Makefile.am
   liboggplay/trunk/src/tools/glut-player.c
   liboggplay/trunk/src/tools/mac-player.c
   liboggplay/trunk/src/tools/win32-player.c
Log:
Add Kate (karaoke text codec) support. Patch from ogg.k.ogg.k:

In addition to the Kate code:

- configure.ac checks for C++ compiler
- don't use imlib2 (nor dump-first-frame) if it isn't here (I didn't
have this when I started hacking on liboggplay)
- add $(FISHSOUND_CFLAGS) to src/liboggplay/Makefile.am
- oggplay_set_track_inactive is now exposed in the API (I needed this
to switch kate tracks on the fly in the browser plugin)


Modified: liboggplay/trunk/README
===================================================================
--- liboggplay/trunk/README	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/README	2008-04-21 19:27:28 UTC (rev 3561)
@@ -21,6 +21,10 @@
     svn co http://svn.annodex.net/liboggz/trunk liboggz
     svn co http://svn.annodex.net/libfishsound/branches/1.0-stable libfishsound
 
+Optionally, for Kate stream support, you need
+
+  * libkate -- from http://libkate.googlecode.com/
+
 See the README files associated with these libraries for installation
 instructions.
 

Modified: liboggplay/trunk/configure.ac
===================================================================
--- liboggplay/trunk/configure.ac	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/configure.ac	2008-04-21 19:27:28 UTC (rev 3561)
@@ -21,6 +21,8 @@
 AC_C_CONST
 AC_C_BIGENDIAN
 
+AM_PROG_CC_C_O
+
 dnl Add parameters for aclocal
 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
 
@@ -159,11 +161,29 @@
 AC_SUBST(THEORA_LIBS)
 
 dnl
+dnl  Detect libkate
+dnl
+PKG_CHECK_MODULES(KATE, kate, HAVE_KATE="yes", HAVE_KATE="no")
+if test "x$HAVE_KATE" = "xyes" ; then
+  AC_DEFINE(HAVE_KATE, [], [Define if have libkate])
+  AC_SUBST(KATE_CFLAGS)
+  AC_SUBST(KATE_LIBS)
+else
+  AC_MSG_RESULT($HAVE_KATE)
+fi
+
+dnl
 dnl Detect Imlib2 (used by dump-all-streams example)
 dnl
-PKG_CHECK_MODULES(IMLIB2, imlib2)
-AC_SUBST(IMLIB2_LIBS)
-AC_SUBST(IMLIB2_CFLAGS)
+PKG_CHECK_MODULES(IMLIB2, imlib2, HAVE_IMLIB2="yes", HAVE_IMLIB2="no")
+if test "x$HAVE_IMLIB2" = "xyes" ; then
+  AC_DEFINE(HAVE_IMLIB2, [], [Define if have Imlib2])
+  AC_SUBST(IMLIB2_LIBS)
+  AC_SUBST(IMLIB2_CFLAGS)
+else
+  AC_MSG_RESULT($HAVE_IMLIB2)
+fi
+AM_CONDITIONAL(HAVE_IMLIB2, [test "x$HAVE_IMLIB2" = "xyes"])
 
 dnl
 
@@ -385,6 +405,8 @@
     ${TESTS_INFO}
 
   Example programs will be built but not installed.
+
+  Kate support: .................. ${HAVE_KATE}
 ------------------------------------------------------------------------
 ])
 

Modified: liboggplay/trunk/include/oggplay/oggplay.h
===================================================================
--- liboggplay/trunk/include/oggplay/oggplay.h	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/include/oggplay/oggplay.h	2008-04-21 19:27:28 UTC (rev 3561)
@@ -105,6 +105,12 @@
 oggplay_get_video_fps(OggPlay *me, int track, int* fps_denom, int* fps_num);
 
 OggPlayErrorCode
+oggplay_get_kate_category(OggPlay *me, int track, const char** category);
+
+OggPlayErrorCode
+oggplay_get_kate_language(OggPlay *me, int track, const char** language);
+
+OggPlayErrorCode
 oggplay_start_decoding(OggPlay *me);
 
 OggPlayErrorCode

Modified: liboggplay/trunk/include/oggplay/oggplay_enums.h
===================================================================
--- liboggplay/trunk/include/oggplay/oggplay_enums.h	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/include/oggplay/oggplay_enums.h	2008-04-21 19:27:28 UTC (rev 3561)
@@ -61,6 +61,7 @@
   E_OGGPLAY_SOCKET_ERROR      = -16,
   E_OGGPLAY_TIMEOUT           = -17,
   E_OGGPLAY_CANT_SEEK         = -18,
+  E_OGGPLAY_NO_KATE_SUPPORT   = -19,
   E_OGGPLAY_NOTCHICKENPAYBACK = -777
 } OggPlayErrorCode;
 
@@ -70,7 +71,8 @@
   OGGPLAY_SHORTS_AUDIO  = 1000,
   OGGPLAY_FLOATS_AUDIO  = 1001,
   OGGPLAY_CMML          = 2000,
-  OGGPLAY_TYPE_UNKNOWN  = 3000
+  OGGPLAY_KATE          = 3000,
+  OGGPLAY_TYPE_UNKNOWN  = 9000 /* higher to be able to add more types without changing value */
 } OggPlayDataType;
 
 typedef enum OggPlayStreamInfo {

Modified: liboggplay/trunk/include/oggplay/oggplay_query.h
===================================================================
--- liboggplay/trunk/include/oggplay/oggplay_query.h	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/include/oggplay/oggplay_query.h	2008-04-21 19:27:28 UTC (rev 3561)
@@ -53,4 +53,7 @@
 OggPlayErrorCode
 oggplay_set_track_active(OggPlay *me, int track_num);
 
+OggPlayErrorCode
+oggplay_set_track_inactive(OggPlay *me, int track_num);
+
 #endif

Modified: liboggplay/trunk/oggplay.pc.in
===================================================================
--- liboggplay/trunk/oggplay.pc.in	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/oggplay.pc.in	2008-04-21 19:27:28 UTC (rev 3561)
@@ -8,5 +8,5 @@
 Requires: oggz fishsound theora
 Version: @VERSION@
 Libs: -L${libdir} -loggplay 
-Libs.private: @OGGZ_LIBS@ @FISHSOUND_LIBS@ @THEORA_LIBS@
+Libs.private: @OGGZ_LIBS@ @FISHSOUND_LIBS@ @THEORA_LIBS@ @KATE_LIBS@
 Cflags: -I${includedir}

Modified: liboggplay/trunk/python/liboggplay.i
===================================================================
--- liboggplay/trunk/python/liboggplay.i	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/python/liboggplay.i	2008-04-21 19:27:28 UTC (rev 3561)
@@ -24,6 +24,7 @@
   E_OGGPLAY_SOCKET_ERROR      = -16,
   E_OGGPLAY_TIMEOUT           = -17,
   E_OGGPLAY_CANT_SEEK         = -18,
+  E_OGGPLAY_NO_KATE_SUPPORT   = -19,
   E_OGGPLAY_NOTCHICKENPAYBACK = -777
 } OggPlayErrorCode;
 
@@ -38,6 +39,8 @@
   OGGZ_CONTENT_FLAC0,
   OGGZ_CONTENT_FLAC,
   OGGZ_CONTENT_ANXDATA,
+  OGGZ_CONTENT_CELT,
+  OGGZ_CONTENT_KATE,
   OGGZ_CONTENT_UNKNOWN
 } OggzStreamContent;
 
@@ -240,6 +243,12 @@
 oggplay_get_video_fps(OggPlay *me, int track, int* fps_denom, int* fps_num);
 
 OggPlayErrorCode
+oggplay_get_kate_language(OggPlay *me, int track, const char** language);
+
+OggPlayErrorCode
+oggplay_get_kate_category(OggPlay *me, int track, const char** category);
+
+OggPlayErrorCode
 oggplay_start_decoding(OggPlay *me);
 
 OggPlayErrorCode

Modified: liboggplay/trunk/src/liboggplay/Makefile.am
===================================================================
--- liboggplay/trunk/src/liboggplay/Makefile.am	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/Makefile.am	2008-04-21 19:27:28 UTC (rev 3561)
@@ -31,6 +31,6 @@
 	oggplay_seek.c		\
 	oggplay_tools.c
 
-liboggplay_la_CFLAGS = $(AM_CFLAGS) $(OGGZ_CFLAGS)
+liboggplay_la_CFLAGS = $(AM_CFLAGS) $(OGGZ_CFLAGS) $(FISHSOUND_CFLAGS)
 liboggplay_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@ 
-liboggplay_la_LIBADD = @OGGZ_LIBS@ @FISHSOUND_LIBS@ @THEORA_LIBS@
+liboggplay_la_LIBADD = @OGGZ_LIBS@ @FISHSOUND_LIBS@ @THEORA_LIBS@ @KATE_LIBS@

Modified: liboggplay/trunk/src/liboggplay/Version_script.in
===================================================================
--- liboggplay/trunk/src/liboggplay/Version_script.in	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/Version_script.in	2008-04-21 19:27:28 UTC (rev 3561)
@@ -26,6 +26,7 @@
                 oggplay_step_decoding;
 
                 oggplay_set_track_active;  
+                oggplay_set_track_inactive;  
                 
                 oggplay_set_offset;
                 oggplay_get_video_y_size;
@@ -33,6 +34,8 @@
                 oggplay_get_video_fps;
                 oggplay_get_audio_channels;
                 oggplay_get_audio_samplerate;				
+                oggplay_get_kate_category;
+                oggplay_get_kate_language;
                 oggplay_get_stream_state;
 
                 oggplay_callback_info_get_type;
@@ -43,6 +46,7 @@
                 oggplay_callback_info_get_video_data;
                 oggplay_callback_info_get_audio_data;
                 oggplay_callback_info_get_text_data;
+                oggplay_callback_info_get_kate_data;
                 oggplay_callback_info_get_presentation_time;
                 oggplay_callback_info_get_stream_info;
 

Modified: liboggplay/trunk/src/liboggplay/oggplay.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -360,6 +360,60 @@
 
 }
 
+int
+oggplay_get_kate_category(OggPlay *me, int track, const char** category) {
+
+  OggPlayKateDecode * decode;
+
+  if (me == NULL) {
+    return E_OGGPLAY_BAD_OGGPLAY;
+  }
+
+  if (track < 0 || track >= me->num_tracks) {
+    return E_OGGPLAY_BAD_TRACK;
+  }
+
+  if (me->decode_data[track]->decoded_type != OGGPLAY_KATE) {
+    return E_OGGPLAY_WRONG_TRACK_TYPE;
+  }
+
+  decode = (OggPlayKateDecode *)(me->decode_data[track]);
+
+#ifdef HAVE_KATE
+  (*category) = decode->k.ki->category;
+  return E_OGGPLAY_OK;
+#else
+  return E_OGGPLAY_NO_KATE_SUPPORT;
+#endif
+}
+
+int
+oggplay_get_kate_language(OggPlay *me, int track, const char** language) {
+
+  OggPlayKateDecode * decode;
+
+  if (me == NULL) {
+    return E_OGGPLAY_BAD_OGGPLAY;
+  }
+
+  if (track < 0 || track >= me->num_tracks) {
+    return E_OGGPLAY_BAD_TRACK;
+  }
+
+  if (me->decode_data[track]->decoded_type != OGGPLAY_KATE) {
+    return E_OGGPLAY_WRONG_TRACK_TYPE;
+  }
+
+  decode = (OggPlayKateDecode *)(me->decode_data[track]);
+
+#ifdef HAVE_KATE
+  (*language) = decode->k.ki->language;
+  return E_OGGPLAY_OK;
+#else
+  return E_OGGPLAY_NO_KATE_SUPPORT;
+#endif
+}
+
 #define MAX_CHUNK_COUNT   10
 
 OggPlayErrorCode
@@ -419,6 +473,8 @@
         continue;
       if (me->decode_data[i]->content_type == OGGZ_CONTENT_CMML)
         continue;
+      if (me->decode_data[i]->content_type == OGGZ_CONTENT_KATE)
+        continue;
       if 
       (
         me->decode_data[i]->current_loc 

Modified: liboggplay/trunk/src/liboggplay/oggplay_callback.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -357,6 +357,79 @@
   return 0;
 }
 
+void
+oggplay_init_kate(void *user_data) {
+
+#ifdef HAVE_KATE
+  OggPlayKateDecode   * decoder     = (OggPlayKateDecode *)user_data;
+
+  kate_high_decode_init(&(decoder->k));
+  decoder->decoder.decoded_type = OGGPLAY_KATE;
+#endif
+}
+
+void
+oggplay_shutdown_kate(void *user_data) {
+
+#ifdef HAVE_KATE
+  OggPlayKateDecode   * decoder = (OggPlayKateDecode *)user_data;
+
+  kate_high_decode_clear(&(decoder->k));
+#endif
+}
+
+int
+oggplay_callback_kate (OGGZ * oggz, ogg_packet * op, long serialno, 
+                void * user_data) {
+
+#ifdef HAVE_KATE
+  OggPlayKateDecode     * decoder     = (OggPlayKateDecode *)user_data;
+  OggPlayDecode         * common      = &(decoder->decoder);
+  ogg_int64_t             granulepos  = oggz_tell_granulepos(oggz);
+  int                     granuleshift;
+  ogg_int64_t             base, offset;
+  kate_packet kp;
+  const kate_event *ev = NULL;
+  int ret;
+
+  kate_packet_wrap(&kp, op->bytes, op->packet);
+  ret = kate_high_decode_packetin(&(decoder->k), &kp, &ev);
+
+  if (granulepos != -1) {
+    granuleshift = oggz_get_granuleshift(oggz, serialno);
+    base = (granulepos >> granuleshift);
+    offset = granulepos - (base << granuleshift);
+    common->current_loc = (base+offset) * common->granuleperiod;
+  } else {
+    common->current_loc = -1;
+  }
+
+  if 
+  (
+    (common->current_loc == -1) 
+    || 
+    (common->current_loc >= common->player->presentation_time)
+  )
+  {
+    /*
+     * process the data from the packet
+     * */     
+    if (ev) {
+      oggplay_data_handle_kate_data(decoder, ev);
+    }
+  }
+  
+  if (op->e_o_s) {
+    common->active = 0;
+    common->player->active_tracks--;
+  }
+  
+#endif
+
+  return 0;
+
+}
+
 OggPlayCallbackFunctions callbacks[] = {
   {oggplay_init_theora, oggplay_callback_theora, oggplay_shutdown_theora, 
         sizeof(OggPlayTheoraDecode)},        /* THEORA */
@@ -372,6 +445,9 @@
   {NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* FLAC0 */
   {NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* FLAC */
   {NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* ANXDATA */
+  {NULL, NULL, NULL, sizeof(OggPlayDecode)}, /* CELT */
+  {oggplay_init_kate, oggplay_callback_kate, oggplay_shutdown_kate, 
+        sizeof(OggPlayKateDecode)},          /* KATE */
   {NULL, NULL, NULL, sizeof(OggPlayDecode)}  /* UNKNOWN */
 };
 

Modified: liboggplay/trunk/src/liboggplay/oggplay_callback_info.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_callback_info.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay_callback_info.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -203,6 +203,8 @@
     (
       track->decoded_type != OGGPLAY_CMML 
       && 
+      track->decoded_type != OGGPLAY_KATE // TODO: check this is the right thing to do
+      && 
       track_info->required_records == 0
       &&
       track->active == 1
@@ -232,7 +234,7 @@
   if (tcount > 0 && added_required_record == 0) {
     for (i = 0; i < me->num_tracks; i++) {
       OggPlayCallbackInfo * track_info = me->callback_info + i;
-      if (track_info->data_type == OGGPLAY_CMML) {
+      if (track_info->data_type == OGGPLAY_CMML || track_info->data_type == OGGPLAY_KATE) {
         continue;
       }
       if (track_info->available_records > 0) {
@@ -429,3 +431,4 @@
   return ((OggPlayTextRecord *)header)->data;
 
 }
+

Modified: liboggplay/trunk/src/liboggplay/oggplay_data.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_data.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay_data.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -362,3 +362,25 @@
 
   oggplay_data_add_to_list((OggPlayDecode *)decode, &(record->header));
 }
+
+#ifdef HAVE_KATE
+void
+oggplay_data_handle_kate_data(OggPlayKateDecode *decode, const kate_event *ev) {
+
+  // TODO: should be able to send the data rendered as YUV data, but just text for now
+
+  OggPlayTextRecord * record;
+  
+  record = (OggPlayTextRecord*)calloc (sizeof(OggPlayTextRecord) + ev->len0, 1);
+  oggplay_data_initialise_header(&decode->decoder, &(record->header));
+
+  //record->header.presentation_time = (ogg_int64_t)(ev->start_time*1000);
+  record->header.samples_in_record = (ev->end_time-ev->start_time)*1000;
+  record->data = (char *)(record + 1);
+
+  memcpy(record->data, ev->text, ev->len0);
+
+  oggplay_data_add_to_list(&decode->decoder, &(record->header));
+}
+#endif
+

Modified: liboggplay/trunk/src/liboggplay/oggplay_data.h
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_data.h	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay_data.h	2008-04-21 19:27:28 UTC (rev 3561)
@@ -53,7 +53,13 @@
 oggplay_data_handle_cmml_data(OggPlayDecode *decode, unsigned char *data, 
                                 int size);
 
+#ifdef HAVE_KATE
 void
+oggplay_data_handle_kate_data(OggPlayKateDecode *decode,
+                              const kate_event *ev);
+#endif
+
+void
 oggplay_data_clean_list (OggPlayDecode *decode);
 
 void

Modified: liboggplay/trunk/src/liboggplay/oggplay_private.h
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_private.h	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay_private.h	2008-04-21 19:27:28 UTC (rev 3561)
@@ -39,12 +39,17 @@
 #ifndef __OGGPLAY_PRIVATE_H__
 #define __OGGPLAY_PRIVATE_H__
 
+#include <config.h>
 #include <oggplay/oggplay.h>
 
 #include <oggz/oggz.h>
 #include <theora/theora.h>
 #include <fishsound/fishsound.h>
 
+#ifdef HAVE_KATE
+#include <kate/kate.h>
+#endif
+
 #ifdef WIN32
 #include "config_win32.h"
 #ifdef HAVE_WINSOCK2
@@ -178,6 +183,14 @@
   ogg_int64_t     base_time;
 } OggPlaySkeletonDecode;
 
+typedef struct {
+  OggPlayDecode   decoder;
+#ifdef HAVE_KATE
+  int             granuleshift;
+  kate_state      k;
+#endif
+} OggPlayKateDecode;
+
 struct OggPlaySeekTrash;
 
 typedef struct OggPlaySeekTrash {

Modified: liboggplay/trunk/src/liboggplay/oggplay_query.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_query.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/liboggplay/oggplay_query.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -144,9 +144,10 @@
      * CMML tracks aren't counted when deciding whether we've read enough data
      * from the stream.  This is because CMML data is not continuous, and 
      * determining that we've read enough data from each other stream is enough
-     * to determing that we've read any CMML data that is available
+     * to determing that we've read any CMML data that is available.
+     * This also applies to Kate streams.
      */
-    if (me->decode_data[track_num]->content_type != OGGZ_CONTENT_CMML) {
+    if (me->decode_data[track_num]->content_type != OGGZ_CONTENT_CMML && me->decode_data[track_num]->content_type != OGGZ_CONTENT_KATE) {
       me->active_tracks ++;
     }
   }
@@ -184,7 +185,7 @@
     /*
      * see above comment in oggplay_set_track_active
      */
-    if (me->decode_data[track_num]->content_type != OGGZ_CONTENT_CMML) {
+    if (me->decode_data[track_num]->content_type != OGGZ_CONTENT_CMML && me->decode_data[track_num]->content_type != OGGZ_CONTENT_KATE) {
       me->active_tracks --;
     }
   }

Modified: liboggplay/trunk/src/tests/Makefile.am
===================================================================
--- liboggplay/trunk/src/tests/Makefile.am	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/tests/Makefile.am	2008-04-21 19:27:28 UTC (rev 3561)
@@ -1,13 +1,13 @@
 ## Process this file with automake to produce Makefile.in
 
 AM_CFLAGS = -Wall \
-            @OGGZ_CFLAGS@ @THEORA_CFLAGS@ @FISHSOUND_CFLAGS@
+            @OGGZ_CFLAGS@ @THEORA_CFLAGS@ @FISHSOUND_CFLAGS@ @KATE_CFLAGS@
 
 INCLUDES = -I$(top_srcdir)/include
 
 OGGPLAYDIR = ../liboggplay
 OGGPLAY_LIBS = $(OGGPLAYDIR)/liboggplay.la @OGGZ_LIBS@ @THEORA_LIBS@ \
-	       @FISHSOUND_LIBS@ @SEMAPHORE_LIBS@
+	       @FISHSOUND_LIBS@ @KATE_LIBS@ @SEMAPHORE_LIBS@
 
 # Test programs
 

Modified: liboggplay/trunk/src/tools/Makefile.am
===================================================================
--- liboggplay/trunk/src/tools/Makefile.am	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/tools/Makefile.am	2008-04-21 19:27:28 UTC (rev 3561)
@@ -9,13 +9,13 @@
 	mac/gplayer.xcodeproj/project.pbxproj
 
 AM_CFLAGS = -Wall \
-            @OGGZ_CFLAGS@ @THEORA_CFLAGS@ @FISHSOUND_CFLAGS@
+            @OGGZ_CFLAGS@ @THEORA_CFLAGS@ @FISHSOUND_CFLAGS@ @KATE_CFLAGS@
 
 INCLUDES = -I$(top_srcdir)/include
 
 OGGPLAYDIR = ../liboggplay
 OGGPLAY_LIBS = $(OGGPLAYDIR)/liboggplay.la @OGGZ_LIBS@ @THEORA_LIBS@ \
-	       @FISHSOUND_LIBS@ @SEMAPHORE_LIBS@
+	       @FISHSOUND_LIBS@ @KATE_LIBS@ @SEMAPHORE_LIBS@
 
 if HAVE_GLUT
 glut_tools = glut-player
@@ -25,9 +25,13 @@
 sndfile_tools = dump-all-streams
 endif
 
+if HAVE_IMLIB2
+imlib2_tools = dump-first-frame
+endif
+
 # Tools
 
-bin_PROGRAMS = oggplay-info dump-first-frame
+bin_PROGRAMS = oggplay-info $(imlib2_tools)
 noinst_PROGRAMS = get-stream-info $(glut_tools) $(sndfile_tools)
 
 oggplay_info_SOURCES = oggplay-info.c
@@ -37,11 +41,11 @@
 get_stream_info_LDADD = $(OGGPLAY_LIBS) 
 
 dump_all_streams_SOURCES = dump-all-streams.c
-dump_all_streams_CFLAGS = @SNDFILE_CFLAGS@
+dump_all_streams_CFLAGS = $(AM_CFLAGS) @SNDFILE_CFLAGS@
 dump_all_streams_LDADD = $(OGGPLAY_LIBS) @SNDFILE_LIBS@ 
 
 dump_first_frame_SOURCES = dump-first-frame.c
-dump_first_frame_CFLAGS = @IMLIB2_CFLAGS@
+dump_first_frame_CFLAGS = $(AM_CFLAGS) @IMLIB2_CFLAGS@
 dump_first_frame_LDADD = $(OGGPLAY_LIBS) @IMLIB2_LIBS@
 
 glut_player_SOURCES = glut-player.c

Modified: liboggplay/trunk/src/tools/glut-player.c
===================================================================
--- liboggplay/trunk/src/tools/glut-player.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/tools/glut-player.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -293,6 +293,18 @@
         case OGGPLAY_CMML:
           if (oggplay_callback_info_get_required(track_info[i]) > 0)
             printf("%s\n", oggplay_callback_info_get_text_data(headers[0]));
+          break;
+
+        case OGGPLAY_KATE:
+          required = oggplay_callback_info_get_required(track_info[i]);
+          for (j = 0; j < required; j++) {
+            printf("[%d] [duration %ld] %s\n",
+                i,
+                oggplay_callback_info_get_record_size(headers[j]),
+                oggplay_callback_info_get_text_data(headers[j]));
+          }
+          break;
+
         default:
           break;
       }
@@ -469,6 +481,12 @@
       ret = oggplay_get_audio_channels(player, i, &channels);
       printf("samplerate: %d channels: %d\n", rate, channels);
     }
+    else if (oggplay_get_track_type (player, i) == OGGZ_CONTENT_KATE) {
+      const char *category = "<unknown>", *language = "<unknown>";
+      int ret = oggplay_get_kate_category(player, i, &category);
+      ret = oggplay_get_kate_language(player, i, &language);
+      printf("category %s, language %s\n", category, language);
+    }
 
     if (oggplay_set_track_active(player, i) < 0) {
       printf("\tNote: Could not set this track active!\n");

Modified: liboggplay/trunk/src/tools/mac-player.c
===================================================================
--- liboggplay/trunk/src/tools/mac-player.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/tools/mac-player.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -225,6 +225,15 @@
           if (oggplay_callback_info_get_required(track_info[i]) > 0)
             printf("%s\n", oggplay_callback_info_get_text_data(headers[0]));
           break;
+
+        case OGGPLAY_KATE:
+          required = oggplay_callback_info_get_required(track_info[i]);
+          for (j = 0; j < required; j++)
+            printf("[%d] %s\n", j, oggplay_callback_info_get_text_data(headers[j]));
+          break;
+
+        default:
+          break;
       }
     }
     

Modified: liboggplay/trunk/src/tools/win32-player.c
===================================================================
--- liboggplay/trunk/src/tools/win32-player.c	2008-04-21 07:12:06 UTC (rev 3560)
+++ liboggplay/trunk/src/tools/win32-player.c	2008-04-21 19:27:28 UTC (rev 3561)
@@ -537,6 +537,14 @@
         case OGGPLAY_CMML:
           if (oggplay_callback_info_get_required(track_info[i]) > 0)
             printf("%s\n", oggplay_callback_info_get_text_data(headers[0]));
+          break;
+
+        case OGGPLAY_KATE:
+          required = oggplay_callback_info_get_required(track_info[i]);
+          for (j = 0; j < required; j++)
+            printf("[%d] %s\n", j, oggplay_callback_info_get_text_data(headers[j]));
+          break;
+
         default:
           break;
       }



More information about the commits mailing list