]> git.sesse.net Git - vlc/blobdiff - include/codecs.h
Forgot this file in my last commit.
[vlc] / include / codecs.h
index 9ce54270463e96990d751c18fecb78115aa9dc08..a1447655331673d40bb424dfc8365a2236c6bdf9 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 1999-2001 VideoLAN
  * $Id$
  *
- * Author: Gildas Bazin <gbazin@netcourrier.com>
+ * Author: Gildas Bazin <gbazin@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -120,11 +120,29 @@ typedef struct {
 } BITMAPINFO, *LPBITMAPINFO;
 #endif
 
-/* dvb_spuinfo_t exports the id of the selected track to the decoder */
 typedef struct
+#ifdef HAVE_ATTRIBUTE_PACKED
+    __attribute__((__packed__))
+#endif
+{
+    int left, top, right, bottom;
+} RECT32;
+
+typedef int64_t REFERENCE_TIME;
+
+typedef struct
+#ifdef HAVE_ATTRIBUTE_PACKED
+    __attribute__((__packed__))
+#endif
 {
-    unsigned int i_id;
-} dvb_spuinfo_t;
+    RECT32            rcSource;
+    RECT32            rcTarget;
+    uint32_t          dwBitRate;
+    uint32_t          dwBitErrorRate;
+    REFERENCE_TIME    AvgTimePerFrame;
+    BITMAPINFOHEADER  bmiHeader;
+    //int               reserved[3];
+} VIDEOINFOHEADER;
 
 /* WAVE format wFormatTag IDs */
 #define WAVE_FORMAT_UNKNOWN             0x0000 /* Microsoft Corporation */
@@ -137,6 +155,7 @@ typedef struct
 #define WAVE_FORMAT_IMA_ADPCM           0x0011 /* Intel Corporation */
 #define WAVE_FORMAT_GSM610              0x0031 /* Microsoft Corporation */
 #define WAVE_FORMAT_MSNAUDIO            0x0032 /* Microsoft Corporation */
+#define WAVE_FORMAT_G726                0x0045 /* ITU-T standard  */
 #define WAVE_FORMAT_MPEG                0x0050 /* Microsoft Corporation */
 #define WAVE_FORMAT_MPEGLAYER3          0x0055 /* ISO/MPEG Layer3 Format Tag */
 #define WAVE_FORMAT_DOLBY_AC3_SPDIF     0x0092 /* Sonic Foundry */
@@ -191,6 +210,7 @@ wave_format_tag_to_fourcc[] =
     { WAVE_FORMAT_ALAW,     VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
     { WAVE_FORMAT_MULAW,    VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
     { WAVE_FORMAT_IMA_ADPCM,VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-Adpcm" },
+    { WAVE_FORMAT_G726,     VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 Adpcm" },
     { WAVE_FORMAT_MPEGLAYER3,VLC_FOURCC('m', 'p', 'g', 'a' ), "Mpeg Audio" },
     { WAVE_FORMAT_MPEG,     VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
     { WAVE_FORMAT_A52,      VLC_FOURCC( 'a', '5', '2', ' ' ), "A/52" },
@@ -205,25 +225,26 @@ wave_format_tag_to_fourcc[] =
     { WAVE_FORMAT_UNKNOWN,  VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
 };
 
-static inline void wf_tag_to_fourcc( uint16_t i_tag,
-                                     vlc_fourcc_t *fcc, char **ppsz_name )
+static inline void wf_tag_to_fourcc( uint16_t i_tag, vlc_fourcc_t *fcc,
+                                     char **ppsz_name )
 {
     int i;
     for( i = 0; wave_format_tag_to_fourcc[i].i_tag != 0; i++ )
     {
-        if( wave_format_tag_to_fourcc[i].i_tag == i_tag )
-        {
-            break;
-        }
-    }
-    if( fcc )
-    {
-        *fcc = wave_format_tag_to_fourcc[i].i_fourcc;
+        if( wave_format_tag_to_fourcc[i].i_tag == i_tag ) break;
     }
-    if( ppsz_name )
+    if( fcc ) *fcc = wave_format_tag_to_fourcc[i].i_fourcc;
+    if( ppsz_name ) *ppsz_name = wave_format_tag_to_fourcc[i].psz_name;
+}
+
+static inline void fourcc_to_wf_tag( vlc_fourcc_t fcc, uint16_t *pi_tag )
+{
+    int i;
+    for( i = 0; wave_format_tag_to_fourcc[i].i_tag != 0; i++ )
     {
-        *ppsz_name = wave_format_tag_to_fourcc[i].psz_name;
+        if( wave_format_tag_to_fourcc[i].i_fourcc == fcc ) break;
     }
+    if( pi_tag ) *pi_tag = wave_format_tag_to_fourcc[i].i_tag;
 }
 
 /**
@@ -250,6 +271,7 @@ typedef struct es_sys_t
     vlc_bool_t          b_forced_subs;
     unsigned int        palette[16];
     unsigned int        colors[4];
+
 } subtitle_data_t;
 
 #endif /* "codecs.h" */