gst-plugins-base-0.10.35-tremor.patch 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. From 0088753651350de3060ece22c1be4153b6009515 Mon Sep 17 00:00:00 2001
  2. From: Peter Korsgaard <jacmet@sunsite.dk>
  3. Date: Wed, 25 Jan 2012 23:53:04 +0100
  4. Subject: [PATCH] base: vorbisdeclib: support modern Tremor versions
  5. Reported upstream as https://bugzilla.gnome.org/show_bug.cgi?id=668726
  6. Tremor changed to use standard libogg rather than its own incompatible
  7. copy back in Aug 2010 (r17375), causing gst-plugin-base build to fail.
  8. Tremolo so far unfortunately hasn't been updated. Restructure
  9. vorbisdeclib.h so the legacy _ogg_packet_wrapper code is only used for
  10. Tremolo.
  11. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  12. ---
  13. ext/vorbis/gstvorbisdeclib.h | 77 ++++++++++++++++++++++-------------------
  14. 1 files changed, 41 insertions(+), 36 deletions(-)
  15. diff --git a/ext/vorbis/gstvorbisdeclib.h b/ext/vorbis/gstvorbisdeclib.h
  16. index ca00af9..e147591 100644
  17. --- a/ext/vorbis/gstvorbisdeclib.h
  18. +++ b/ext/vorbis/gstvorbisdeclib.h
  19. @@ -29,11 +29,6 @@
  20. #ifndef TREMOR
  21. -#include <vorbis/codec.h>
  22. -
  23. -typedef float vorbis_sample_t;
  24. -typedef ogg_packet ogg_packet_wrapper;
  25. -
  26. #define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to float audio"
  27. #define GST_VORBIS_DEC_SRC_CAPS \
  28. @@ -47,6 +42,42 @@ typedef ogg_packet ogg_packet_wrapper;
  29. #define GST_VORBIS_DEC_GLIB_TYPE_NAME GstVorbisDec
  30. +#else /* TREMOR */
  31. +
  32. +#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio"
  33. +
  34. +#define GST_VORBIS_DEC_SRC_CAPS \
  35. + GST_STATIC_CAPS ("audio/x-raw-int, " \
  36. + "rate = (int) [ 1, MAX ], " \
  37. + "channels = (int) [ 1, 6 ], " \
  38. + "endianness = (int) BYTE_ORDER, " \
  39. + "width = (int) { 16, 32 }, " \
  40. + "depth = (int) 16, " \
  41. + "signed = (boolean) true")
  42. +
  43. +#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH (16)
  44. +
  45. +/* we need a different type name here */
  46. +#define GST_VORBIS_DEC_GLIB_TYPE_NAME GstIVorbisDec
  47. +
  48. +/* and still have it compile */
  49. +typedef struct _GstVorbisDec GstIVorbisDec;
  50. +typedef struct _GstVorbisDecClass GstIVorbisDecClass;
  51. +
  52. +#endif /* TREMOR */
  53. +
  54. +#ifndef USE_TREMOLO
  55. +
  56. +#ifdef TREMOR
  57. + #include <tremor/ivorbiscodec.h>
  58. + typedef ogg_int32_t vorbis_sample_t;
  59. +#else
  60. + #include <vorbis/codec.h>
  61. + typedef float vorbis_sample_t;
  62. +#endif
  63. +
  64. +typedef ogg_packet ogg_packet_wrapper;
  65. +
  66. static inline guint8 *
  67. gst_ogg_packet_data (ogg_packet * p)
  68. {
  69. @@ -72,17 +103,11 @@ gst_ogg_packet_from_wrapper (ogg_packet_wrapper * packet)
  70. return packet;
  71. }
  72. -#else
  73. -
  74. -#ifdef USE_TREMOLO
  75. - #include <Tremolo/ivorbiscodec.h>
  76. - #include <Tremolo/codec_internal.h>
  77. - typedef ogg_int16_t vorbis_sample_t;
  78. -#else
  79. - #include <tremor/ivorbiscodec.h>
  80. - typedef ogg_int32_t vorbis_sample_t;
  81. -#endif
  82. +#else /* USE_TREMOLO */
  83. +#include <Tremolo/ivorbiscodec.h>
  84. +#include <Tremolo/codec_internal.h>
  85. +typedef ogg_int16_t vorbis_sample_t;
  86. typedef struct _ogg_packet_wrapper ogg_packet_wrapper;
  87. struct _ogg_packet_wrapper {
  88. @@ -91,26 +116,6 @@ struct _ogg_packet_wrapper {
  89. ogg_buffer buf;
  90. };
  91. -#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio"
  92. -
  93. -#define GST_VORBIS_DEC_SRC_CAPS \
  94. - GST_STATIC_CAPS ("audio/x-raw-int, " \
  95. - "rate = (int) [ 1, MAX ], " \
  96. - "channels = (int) [ 1, 6 ], " \
  97. - "endianness = (int) BYTE_ORDER, " \
  98. - "width = (int) { 16, 32 }, " \
  99. - "depth = (int) 16, " \
  100. - "signed = (boolean) true")
  101. -
  102. -#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH (16)
  103. -
  104. -/* we need a different type name here */
  105. -#define GST_VORBIS_DEC_GLIB_TYPE_NAME GstIVorbisDec
  106. -
  107. -/* and still have it compile */
  108. -typedef struct _GstVorbisDec GstIVorbisDec;
  109. -typedef struct _GstVorbisDecClass GstIVorbisDecClass;
  110. -
  111. /* compensate minor variation */
  112. #define vorbis_synthesis(a, b) vorbis_synthesis (a, b, 1)
  113. @@ -154,7 +159,7 @@ gst_ogg_packet_from_wrapper (ogg_packet_wrapper * packet)
  114. return &(packet->packet);
  115. }
  116. -#endif
  117. +#endif /* USE_TREMOLO */
  118. typedef void (*CopySampleFunc)(vorbis_sample_t *out, vorbis_sample_t **in,
  119. guint samples, gint channels, gint width);
  120. --
  121. 1.7.8.3