[libav-commits] lavr: typedef internal structs in internal.h

Justin Ruggles git at libav.org
Tue Jan 8 03:53:32 CET 2013


Module: libav
Branch: master
Commit: 4d68269d58ca4f6f71b4baa30e0cf9fbde52bbc3

Author:    Justin Ruggles <justin.ruggles at gmail.com>
Committer: Justin Ruggles <justin.ruggles at gmail.com>
Date:      Fri Dec 21 16:26:51 2012 -0500

lavr: typedef internal structs in internal.h

Simplifies header dependencies by not including all other internal headers
in internal.h.

---

 libavresample/audio_convert.c |    1 -
 libavresample/audio_convert.h |    3 +--
 libavresample/audio_data.h    |    5 +++--
 libavresample/audio_mix.h     |    3 +--
 libavresample/internal.h      |    9 +++++----
 libavresample/resample.c      |    1 +
 libavresample/resample.h      |    3 +--
 libavresample/utils.c         |    5 ++++-
 8 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/libavresample/audio_convert.c b/libavresample/audio_convert.c
index eb3bc1f..288f0f4 100644
--- a/libavresample/audio_convert.c
+++ b/libavresample/audio_convert.c
@@ -30,7 +30,6 @@
 #include "audio_convert.h"
 #include "audio_data.h"
 #include "dither.h"
-#include "internal.h"
 
 enum ConvFuncType {
     CONV_FUNC_TYPE_FLAT,
diff --git a/libavresample/audio_convert.h b/libavresample/audio_convert.h
index b8808f1..7d47b15 100644
--- a/libavresample/audio_convert.h
+++ b/libavresample/audio_convert.h
@@ -23,10 +23,9 @@
 
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
+#include "internal.h"
 #include "audio_data.h"
 
-typedef struct AudioConvert AudioConvert;
-
 /**
  * Set conversion function if the parameters match.
  *
diff --git a/libavresample/audio_data.h b/libavresample/audio_data.h
index 558e7e6..4e53e31 100644
--- a/libavresample/audio_data.h
+++ b/libavresample/audio_data.h
@@ -27,11 +27,12 @@
 #include "libavutil/log.h"
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
+#include "internal.h"
 
 /**
  * Audio buffer used for intermediate storage between conversion phases.
  */
-typedef struct AudioData {
+struct AudioData {
     const AVClass *class;               /**< AVClass for logging            */
     uint8_t *data[AVRESAMPLE_MAX_CHANNELS]; /**< data plane pointers        */
     uint8_t *buffer;                    /**< data buffer                    */
@@ -50,7 +51,7 @@ typedef struct AudioData {
     int ptr_align;                      /**< minimum data pointer alignment */
     int samples_align;                  /**< allocated samples alignment    */
     const char *name;                   /**< name for debug logging         */
-} AudioData;
+};
 
 int ff_audio_data_set_channels(AudioData *a, int channels);
 
diff --git a/libavresample/audio_mix.h b/libavresample/audio_mix.h
index 4ccfc1f..5bae5ab 100644
--- a/libavresample/audio_mix.h
+++ b/libavresample/audio_mix.h
@@ -25,13 +25,12 @@
 
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
+#include "internal.h"
 #include "audio_data.h"
 
 typedef void (mix_func)(uint8_t **src, void **matrix, int len, int out_ch,
                         int in_ch);
 
-typedef struct AudioMix AudioMix;
-
 /**
  * Set mixing function if the parameters match.
  *
diff --git a/libavresample/internal.h b/libavresample/internal.h
index 2e139ab..c094f08 100644
--- a/libavresample/internal.h
+++ b/libavresample/internal.h
@@ -26,10 +26,11 @@
 #include "libavutil/opt.h"
 #include "libavutil/samplefmt.h"
 #include "avresample.h"
-#include "audio_convert.h"
-#include "audio_data.h"
-#include "audio_mix.h"
-#include "resample.h"
+
+typedef struct AudioData AudioData;
+typedef struct AudioConvert AudioConvert;
+typedef struct AudioMix AudioMix;
+typedef struct ResampleContext ResampleContext;
 
 struct AVAudioResampleContext {
     const AVClass *av_class;        /**< AVClass for logging and AVOptions  */
diff --git a/libavresample/resample.c b/libavresample/resample.c
index dc121fe..69c9bab 100644
--- a/libavresample/resample.c
+++ b/libavresample/resample.c
@@ -23,6 +23,7 @@
 #include "libavutil/libm.h"
 #include "libavutil/log.h"
 #include "internal.h"
+#include "resample.h"
 #include "audio_data.h"
 
 struct ResampleContext {
diff --git a/libavresample/resample.h b/libavresample/resample.h
index 7534e26..4544dab 100644
--- a/libavresample/resample.h
+++ b/libavresample/resample.h
@@ -22,10 +22,9 @@
 #define AVRESAMPLE_RESAMPLE_H
 
 #include "avresample.h"
+#include "internal.h"
 #include "audio_data.h"
 
-typedef struct ResampleContext ResampleContext;
-
 /**
  * Allocate and initialize a ResampleContext.
  *
diff --git a/libavresample/utils.c b/libavresample/utils.c
index ed7f470..a303880 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -26,8 +26,11 @@
 #include "libavutil/opt.h"
 
 #include "avresample.h"
-#include "audio_data.h"
 #include "internal.h"
+#include "audio_data.h"
+#include "audio_convert.h"
+#include "audio_mix.h"
+#include "resample.h"
 
 int avresample_open(AVAudioResampleContext *avr)
 {



More information about the libav-commits mailing list