audiotp/audioeq: Modify build warnings 96/64396/3
authorGilbok Lee <gilbok.lee@samsung.com>
Fri, 1 Apr 2016 03:01:34 +0000 (12:01 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Fri, 1 Apr 2016 05:08:01 +0000 (14:08 +0900)
Change-Id: I2d076f38f5ff2ab2b5293fa89916015fed4cd36a

audioeq/src/gstaudioeq.c
audiotp/src/gstaudiotp.c

index 1401dba..0a79e9e 100644 (file)
@@ -39,40 +39,40 @@ GST_DEBUG_CATEGORY_STATIC (gst_audioeq_debug);
 /* Filter signals and args */
 enum
 {
-       /* FILL ME */
-       LAST_SIGNAL
+  /* FILL ME */
+  LAST_SIGNAL
 };
 
 enum
 {
-       PROP_0,
-       PROP_FILTER_ACTION,
-       PROP_CUSTOM_EQ,
-       PROP_CUSTOM_EQ_NUM,
-       PROP_CUSTOM_EQ_FREQ,
-       PROP_CUSTOM_EQ_WIDTH,
+  PROP_0,
+  PROP_FILTER_ACTION,
+  PROP_CUSTOM_EQ,
+  PROP_CUSTOM_EQ_NUM,
+  PROP_CUSTOM_EQ_FREQ,
+  PROP_CUSTOM_EQ_WIDTH,
 };
 
 enum FilterActionType
 {
-       FILTER_NONE,
-       FILTER_PRESET,
-       FILTER_ADVANCED_SETTING
+  FILTER_NONE,
+  FILTER_PRESET,
+  FILTER_ADVANCED_SETTING
 };
 
 enum SampleRate
 {
-       SAMPLERATE_48000Hz,
-       SAMPLERATE_44100Hz,
-       SAMPLERATE_32000Hz,
-       SAMPLERATE_24000Hz,
-       SAMPLERATE_22050Hz,
-       SAMPLERATE_16000Hz,
-       SAMPLERATE_12000Hz,
-       SAMPLERATE_11025Hz,
-       SAMPLERATE_8000Hz,
-
-       SAMPLERATE_NUM
+  SAMPLERATE_48000Hz,
+  SAMPLERATE_44100Hz,
+  SAMPLERATE_32000Hz,
+  SAMPLERATE_24000Hz,
+  SAMPLERATE_22050Hz,
+  SAMPLERATE_16000Hz,
+  SAMPLERATE_12000Hz,
+  SAMPLERATE_11025Hz,
+  SAMPLERATE_8000Hz,
+
+  SAMPLERATE_NUM
 };
 
 #define DEFAULT_SAMPLE_SIZE                    2
@@ -84,28 +84,28 @@ enum SampleRate
 #define DEFAULT_CUSTOM_EQ_NUM          7
 
 static GstStaticPadTemplate sinktemplate =
-       GST_STATIC_PAD_TEMPLATE(
-               "sink",
-               GST_PAD_SINK,
-               GST_PAD_ALWAYS,
-               GST_STATIC_CAPS (
-                       "audio/x-raw, "
-                   "format = (string) " GST_AUDIO_NE(S16) ", "
-                       "channels = (int) [1,2]"
-                       )
-       );
+  GST_STATIC_PAD_TEMPLATE(
+    "sink",
+    GST_PAD_SINK,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (
+      "audio/x-raw, "
+      "format = (string) " GST_AUDIO_NE(S16) ", "
+      "channels = (int) [1,2]"
+    )
+  );
 
 static GstStaticPadTemplate srctemplate =
-       GST_STATIC_PAD_TEMPLATE(
-               "src",
-               GST_PAD_SRC,
-               GST_PAD_ALWAYS,
-               GST_STATIC_CAPS (
-                       "audio/x-raw, "
-                   "format = (string) " GST_AUDIO_NE(S16) ", "
-                       "channels = (int) [1,2]"
-                       )
-       );
+  GST_STATIC_PAD_TEMPLATE(
+    "src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (
+      "audio/x-raw, "
+      "format = (string) " GST_AUDIO_NE(S16) ", "
+      "channels = (int) [1,2]"
+    )
+  );
 
 static void gst_iir_equalizer_child_proxy_interface_init (gpointer g_iface,
     gpointer iface_data);
@@ -128,30 +128,30 @@ static GstStateChangeReturn
 gst_audioeq_change_state (GstElement * element, GstStateChange transition)
 {
   GST_DEBUG ("gst_audioeq_change_state");
-       GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
-       Gstaudioeq *audioeq = GST_AUDIOEQ (element);
-
-       switch (transition) {
-       case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
-               audioeq->need_update_filter = TRUE;
-               break;
-       default:
-               break;
-       }
-
-       ret = GST_ELEMENT_CLASS (gst_audioeq_parent_class)->change_state (element, transition);
-
-       if (ret == GST_STATE_CHANGE_FAILURE)
-               return ret;
-
-       switch (transition) {
-       case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
-               break;
-       default:
-               break;
-       }
-
-       return ret;
+  GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+  Gstaudioeq *audioeq = GST_AUDIOEQ (element);
+
+  switch (transition) {
+  case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+    audioeq->need_update_filter = TRUE;
+    break;
+  default:
+    break;
+  }
+
+  ret = GST_ELEMENT_CLASS (gst_audioeq_parent_class)->change_state (element, transition);
+
+  if (ret == GST_STATE_CHANGE_FAILURE)
+    return ret;
+
+  switch (transition) {
+  case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
+    break;
+  default:
+    break;
+  }
+
+  return ret;
 }
 
 #if 0
@@ -166,73 +166,73 @@ gst_audioeq_base_init (gpointer gclass)
 static void
 gst_audioeq_class_init (GstaudioeqClass * klass)
 {
-       GST_DEBUG ("gst_audioeq_class_init");
-       GObjectClass *gobject_class;
-       GstElementClass *gstelement_class;
-       GstBaseTransformClass *basetransform_class;
+  GST_DEBUG ("gst_audioeq_class_init");
+  GObjectClass *gobject_class;
+  GstElementClass *gstelement_class;
+  GstBaseTransformClass *basetransform_class;
 
-       gobject_class = G_OBJECT_CLASS (klass);
-       gstelement_class = GST_ELEMENT_CLASS (klass);
-       basetransform_class = GST_BASE_TRANSFORM_CLASS(klass);
+  gobject_class = G_OBJECT_CLASS (klass);
+  gstelement_class = GST_ELEMENT_CLASS (klass);
+  basetransform_class = GST_BASE_TRANSFORM_CLASS(klass);
 
-       gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_audioeq_set_property);
-       gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_audioeq_get_property);
+  gobject_class->set_property = GST_DEBUG_FUNCPTR(gst_audioeq_set_property);
+  gobject_class->get_property = GST_DEBUG_FUNCPTR(gst_audioeq_get_property);
 
-       gst_element_class_add_pad_template(gstelement_class,
-               gst_static_pad_template_get (&srctemplate));
-       gst_element_class_add_pad_template(gstelement_class,
-               gst_static_pad_template_get (&sinktemplate));
+  gst_element_class_add_pad_template(gstelement_class,
+  gst_static_pad_template_get (&srctemplate));
+  gst_element_class_add_pad_template(gstelement_class,
+  gst_static_pad_template_get (&sinktemplate));
 
-       gst_element_class_set_static_metadata(gstelement_class,
-               "Audio Equalizer",
-               "Filter/Effect/Audio",
-               "Set equalisation effect on audio/raw streams",
-               "Samsung Electronics <www.samsung.com>");
-       gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_audioeq_change_state);
+  gst_element_class_set_static_metadata(gstelement_class,
+    "Audio Equalizer",
+    "Filter/Effect/Audio",
+    "Set equalisation effect on audio/raw streams",
+    "Samsung Electronics <www.samsung.com>");
+  gstelement_class->change_state = GST_DEBUG_FUNCPTR(gst_audioeq_change_state);
 
-       g_object_class_install_property(gobject_class, PROP_FILTER_ACTION,
-               g_param_spec_uint("filter-action", "filter action", "(0)none (1)preset (2)advanced setting",
-               0, 2, DEFAULT_FILTER_ACTION, G_PARAM_READWRITE));
+  g_object_class_install_property(gobject_class, PROP_FILTER_ACTION,
+    g_param_spec_uint("filter-action", "filter action", "(0)none (1)preset (2)advanced setting",
+      0, 2, DEFAULT_FILTER_ACTION, G_PARAM_READWRITE));
 
-       g_object_class_install_property (gobject_class, PROP_CUSTOM_EQ,
-               g_param_spec_pointer("custom-eq", "custom eq",
-               "pointer for 9 bands of EQ array", G_PARAM_READWRITE));
+  g_object_class_install_property (gobject_class, PROP_CUSTOM_EQ,
+    g_param_spec_pointer("custom-eq", "custom eq",
+      "pointer for 9 bands of EQ array", G_PARAM_READWRITE));
 
-       g_object_class_install_property(gobject_class, PROP_CUSTOM_EQ_NUM,
-               g_param_spec_uint("custom-eq-num", "custom eq num", "number of custom EQ bands",
-               0, 9, DEFAULT_CUSTOM_EQ_NUM, G_PARAM_READABLE));
+  g_object_class_install_property(gobject_class, PROP_CUSTOM_EQ_NUM,
+    g_param_spec_uint("custom-eq-num", "custom eq num", "number of custom EQ bands",
+      0, 9, DEFAULT_CUSTOM_EQ_NUM, G_PARAM_READABLE));
 
-       g_object_class_install_property(gobject_class, PROP_CUSTOM_EQ_FREQ,
-               g_param_spec_pointer("custom-eq-freq", "custom eq freq", "pointer for EQ bands central frequency(Hz) array",
-               G_PARAM_READABLE));
+  g_object_class_install_property(gobject_class, PROP_CUSTOM_EQ_FREQ,
+    g_param_spec_pointer("custom-eq-freq", "custom eq freq", "pointer for EQ bands central frequency(Hz) array",
+      G_PARAM_READABLE));
 
-       g_object_class_install_property(gobject_class, PROP_CUSTOM_EQ_WIDTH,
-               g_param_spec_pointer("custom-eq-width", "custom eq width", "pointer for EQ bands width(Hz) array",
-               G_PARAM_READABLE));
+  g_object_class_install_property(gobject_class, PROP_CUSTOM_EQ_WIDTH,
+    g_param_spec_pointer("custom-eq-width", "custom eq width", "pointer for EQ bands width(Hz) array",
+      G_PARAM_READABLE));
 
-       gobject_class->finalize = GST_DEBUG_FUNCPTR(gst_iir_equalizer_finalize);
+  gobject_class->finalize = GST_DEBUG_FUNCPTR(gst_iir_equalizer_finalize);
 
 /* It is possible to reduce memcpy by setting output same as input of AudioEq_InOutConfig */
 #ifdef AUDIOEQ_REDUCE_MEMCPY
-       basetransform_class->transform_ip = GST_DEBUG_FUNCPTR(gst_audioeq_transform_ip);
+  basetransform_class->transform_ip = GST_DEBUG_FUNCPTR(gst_audioeq_transform_ip);
 #endif
-       basetransform_class->set_caps = GST_DEBUG_FUNCPTR(gst_audioeq_set_caps);
+  basetransform_class->set_caps = GST_DEBUG_FUNCPTR(gst_audioeq_set_caps);
 }
 
 static void
 gst_audioeq_init (Gstaudioeq * audioeq)
 {
   GST_DEBUG ("gst_audioeq_init");
-       audioeq->samplerate = DEFAULT_SAMPLE_RATE;
-       audioeq->channels = DEAFULT_CHANNELS;
+  audioeq->samplerate = DEFAULT_SAMPLE_RATE;
+  audioeq->channels = DEAFULT_CHANNELS;
 
-       audioeq->filter_action = DEFAULT_FILTER_ACTION;
-       memset(audioeq->custom_eq, 0x00, sizeof(gint) * CUSTOM_EQ_BAND_MAX);
-       audioeq->need_update_filter = TRUE;
+  audioeq->filter_action = DEFAULT_FILTER_ACTION;
+  memset(audioeq->custom_eq, 0x00, sizeof(gint) * CUSTOM_EQ_BAND_MAX);
+  audioeq->need_update_filter = TRUE;
 
-       g_mutex_init(&audioeq->equ.bands_lock);
-       audioeq->equ.need_new_coefficients = TRUE;
-       gst_iir_equalizer_compute_frequencies (audioeq, DEFAULT_CUSTOM_EQ_NUM);
+  g_mutex_init(&audioeq->equ.bands_lock);
+  audioeq->equ.need_new_coefficients = TRUE;
+  gst_iir_equalizer_compute_frequencies (audioeq, DEFAULT_CUSTOM_EQ_NUM);
 }
 /* equalizer implementation */
 
@@ -307,13 +307,13 @@ typedef struct _GstIirEqualizerBandClass GstIirEqualizerBandClass;
 #define GST_TYPE_IIR_EQUALIZER_BAND \
   (gst_iir_equalizer_band_get_type())
 #define GST_IIR_EQUALIZER_BAND(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_IIR_EQUALIZER_BAND,GstIirEqualizerBand))
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_IIR_EQUALIZER_BAND, GstIirEqualizerBand))
 #define GST_IIR_EQUALIZER_BAND_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_IIR_EQUALIZER_BAND,GstIirEqualizerBandClass))
+  (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_IIR_EQUALIZER_BAND, GstIirEqualizerBandClass))
 #define GST_IS_IIR_EQUALIZER_BAND(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_IIR_EQUALIZER_BAND))
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_IIR_EQUALIZER_BAND))
 #define GST_IS_IIR_EQUALIZER_BAND_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_IIR_EQUALIZER_BAND))
+  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_IIR_EQUALIZER_BAND))
 
 struct _GstIirEqualizerBand
 {
@@ -1026,8 +1026,8 @@ guint size, guint channels)                                             \
 }
 
 CREATE_OPTIMIZED_FUNCTIONS_INT (gint16, gfloat, -32768.0, 32767.0);
-CREATE_OPTIMIZED_FUNCTIONS (gfloat);
-CREATE_OPTIMIZED_FUNCTIONS (gdouble);
+/* CREATE_OPTIMIZED_FUNCTIONS (gfloat); */
+/* CREATE_OPTIMIZED_FUNCTIONS (gdouble); */
 
 #ifdef AUDIOEQ_REDUCE_MEMCPY
 static GstFlowReturn
@@ -1083,160 +1083,159 @@ gst_audioeq_transform_ip (GstBaseTransform * base, GstBuffer * buf)
 #endif
 
 static gboolean
-gst_audioeq_set_caps (GstBaseTransform * base, GstCaps * incaps,
-       GstCaps * outcaps)
+gst_audioeq_set_caps (GstBaseTransform * base, GstCaps * incaps, GstCaps * outcaps)
 {
   GST_DEBUG ("gst_audioeq_set_caps");
-       Gstaudioeq *audioeq = GST_AUDIOEQ(base);
-       GstStructure *ins;
-       GstPad *pad;
-       gint samplerate;
-       gint channels;
-       gshort old_samplerate;
-       gshort old_channels;
-
-       pad = gst_element_get_static_pad(GST_ELEMENT(audioeq), "src");
-
-       /* forward-negotiate */
-       if(!gst_pad_set_caps(pad, incaps)) {
-               gst_object_unref(pad);
-               return FALSE;
-       }
-
-       /* negotiation succeeded, so now configure ourselves */
-       ins = gst_caps_get_structure(incaps, 0);
-
-       /* get samplerate from caps & convert */
-       old_samplerate = audioeq->samplerate;
-       old_channels = audioeq->channels;
-       gst_structure_get_int(ins, "rate", &samplerate);
-       switch (samplerate) {
-       case 48000:
-               audioeq->samplerate = SAMPLERATE_48000Hz;
-               break;
-       case 44100:
-               audioeq->samplerate = SAMPLERATE_44100Hz;
-               break;
-       case 32000:
-               audioeq->samplerate = SAMPLERATE_32000Hz;
-               break;
-       case 24000:
-               audioeq->samplerate = SAMPLERATE_24000Hz;
-               break;
-       case 22050:
-               audioeq->samplerate = SAMPLERATE_22050Hz;
-               break;
-       case 16000:
-               audioeq->samplerate = SAMPLERATE_16000Hz;
-               break;
-       case 12000:
-               audioeq->samplerate = SAMPLERATE_12000Hz;
-               break;
-       case 11025:
-               audioeq->samplerate = SAMPLERATE_11025Hz;
-               break;
-       case 8000:
-               audioeq->samplerate = SAMPLERATE_8000Hz;
-               break;
-       default:
-               if (samplerate < 8000) {
-                       audioeq->samplerate = SAMPLERATE_8000Hz;
-               } else if (samplerate > 48000) {
-                       audioeq->samplerate = SAMPLERATE_48000Hz;
-               }
-               break;
-       }
-       /* get number of channels from caps */
-       gst_structure_get_int(ins, "channels", &channels);
-       audioeq->channels = (gshort)channels;
-
-       if ((old_samplerate != audioeq->samplerate)
-               || (old_channels != audioeq->channels)) {
-               audioeq->need_update_filter = TRUE;
-       }
-
-       gst_object_unref (pad);
-
-       return TRUE;
+  Gstaudioeq *audioeq = GST_AUDIOEQ(base);
+  GstStructure *ins;
+  GstPad *pad;
+  gint samplerate;
+  gint channels;
+  gshort old_samplerate;
+  gshort old_channels;
+
+  pad = gst_element_get_static_pad(GST_ELEMENT(audioeq), "src");
+
+  /* forward-negotiate */
+  if(!gst_pad_set_caps(pad, incaps)) {
+    gst_object_unref(pad);
+    return FALSE;
+  }
+
+  /* negotiation succeeded, so now configure ourselves */
+  ins = gst_caps_get_structure(incaps, 0);
+
+  /* get samplerate from caps & convert */
+  old_samplerate = audioeq->samplerate;
+  old_channels = audioeq->channels;
+  gst_structure_get_int(ins, "rate", &samplerate);
+  switch (samplerate) {
+  case 48000:
+  audioeq->samplerate = SAMPLERATE_48000Hz;
+    break;
+  case 44100:
+    audioeq->samplerate = SAMPLERATE_44100Hz;
+    break;
+  case 32000:
+    audioeq->samplerate = SAMPLERATE_32000Hz;
+    break;
+  case 24000:
+    audioeq->samplerate = SAMPLERATE_24000Hz;
+    break;
+  case 22050:
+    audioeq->samplerate = SAMPLERATE_22050Hz;
+    break;
+  case 16000:
+    audioeq->samplerate = SAMPLERATE_16000Hz;
+    break;
+  case 12000:
+    audioeq->samplerate = SAMPLERATE_12000Hz;
+    break;
+  case 11025:
+    audioeq->samplerate = SAMPLERATE_11025Hz;
+    break;
+  case 8000:
+    audioeq->samplerate = SAMPLERATE_8000Hz;
+    break;
+  default:
+    if (samplerate < 8000) {
+      audioeq->samplerate = SAMPLERATE_8000Hz;
+    } else if (samplerate > 48000) {
+      audioeq->samplerate = SAMPLERATE_48000Hz;
+    }
+    break;
+  }
+  /* get number of channels from caps */
+  gst_structure_get_int(ins, "channels", &channels);
+  audioeq->channels = (gshort)channels;
+
+  if ((old_samplerate != audioeq->samplerate)
+    || (old_channels != audioeq->channels)) {
+    audioeq->need_update_filter = TRUE;
+  }
+
+  gst_object_unref (pad);
+
+  return TRUE;
 }
 
 static void
 gst_audioeq_set_property (GObject * object, guint prop_id,
-       const GValue * value, GParamSpec * pspec)
+    const GValue * value, GParamSpec * pspec)
 {
-       GST_DEBUG ("gst_audioeq_set_property");
-       Gstaudioeq *audioeq = GST_AUDIOEQ (object);
-       GstIirEqualizer *equ = &audioeq->equ;
-       gshort *pointer;
-
-       switch (prop_id) {
-
-       case PROP_FILTER_ACTION:
-               audioeq->filter_action = g_value_get_uint(value);
-               BANDS_LOCK(equ);
-               equ->need_new_coefficients = TRUE;
-               BANDS_UNLOCK(equ);
-               break;
-
-       case PROP_CUSTOM_EQ:
-               pointer = g_value_get_pointer(value);
-               if (pointer) {
-                       memcpy(audioeq->custom_eq, pointer, sizeof(gint) * CUSTOM_EQ_BAND_MAX);
-                       if (audioeq->filter_action == FILTER_ADVANCED_SETTING) {
-                               BANDS_LOCK(equ);
-                               equ->need_new_coefficients = TRUE;
-                               gst_audioeq_band_set_property(audioeq);
-                               BANDS_UNLOCK(equ);
-                       }
-               }
-               break;
-
-       default:
-               break;
-       }
-       GST_DEBUG ("gst_audioeq_set_property need_update_filter %d", audioeq->need_update_filter);
+  GST_DEBUG ("gst_audioeq_set_property");
+  Gstaudioeq *audioeq = GST_AUDIOEQ (object);
+  GstIirEqualizer *equ = &audioeq->equ;
+  gshort *pointer;
+
+  switch (prop_id) {
+
+  case PROP_FILTER_ACTION:
+    audioeq->filter_action = g_value_get_uint(value);
+    BANDS_LOCK(equ);
+    equ->need_new_coefficients = TRUE;
+    BANDS_UNLOCK(equ);
+    break;
+
+  case PROP_CUSTOM_EQ:
+    pointer = g_value_get_pointer(value);
+    if (pointer) {
+      memcpy(audioeq->custom_eq, pointer, sizeof(gint) * CUSTOM_EQ_BAND_MAX);
+      if (audioeq->filter_action == FILTER_ADVANCED_SETTING) {
+        BANDS_LOCK(equ);
+        equ->need_new_coefficients = TRUE;
+        gst_audioeq_band_set_property(audioeq);
+        BANDS_UNLOCK(equ);
+      }
+    }
+    break;
+
+  default:
+    break;
+  }
+  GST_DEBUG ("gst_audioeq_set_property need_update_filter %d", audioeq->need_update_filter);
 }
 
 static void
 gst_audioeq_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec)
 {
-GST_DEBUG ("gst_audioeq_get_property");
-
-       Gstaudioeq *audioeq = GST_AUDIOEQ (object);
-       GstIirEqualizer *equ = &audioeq->equ;
-       gshort i;
-       gdouble widtharr[DEFAULT_CUSTOM_EQ_NUM],freqarr[DEFAULT_CUSTOM_EQ_NUM];
-
-       switch (prop_id) {
-       case PROP_FILTER_ACTION:
-               g_value_set_uint(value, audioeq->filter_action);
-               break;
-
-       case PROP_CUSTOM_EQ:
-               g_value_set_pointer(value, audioeq->custom_eq);
-               break;
-
-       case PROP_CUSTOM_EQ_NUM:
-               g_value_set_uint(value, DEFAULT_CUSTOM_EQ_NUM);
-               break;
-
-       case PROP_CUSTOM_EQ_FREQ:
-               for(i=0;i<DEFAULT_CUSTOM_EQ_NUM;i++) {
-                        freqarr[i] =   equ->bands[i]->freq;
-               }
-               g_value_set_pointer(value, &freqarr);
-               break;
-
-       case PROP_CUSTOM_EQ_WIDTH:
-               for(i=0;i<DEFAULT_CUSTOM_EQ_NUM;i++) {
-                        widtharr[i] =  equ->bands[i]->width;
-               }
-               g_value_set_pointer(value, &widtharr);
-               break;
-
-       default:
-               break;
-       }
+  GST_DEBUG ("gst_audioeq_get_property");
+
+  Gstaudioeq *audioeq = GST_AUDIOEQ (object);
+  GstIirEqualizer *equ = &audioeq->equ;
+  gshort i;
+  gdouble widtharr[DEFAULT_CUSTOM_EQ_NUM],freqarr[DEFAULT_CUSTOM_EQ_NUM];
+
+  switch (prop_id) {
+  case PROP_FILTER_ACTION:
+    g_value_set_uint(value, audioeq->filter_action);
+    break;
+
+  case PROP_CUSTOM_EQ:
+    g_value_set_pointer(value, audioeq->custom_eq);
+    break;
+
+  case PROP_CUSTOM_EQ_NUM:
+    g_value_set_uint(value, DEFAULT_CUSTOM_EQ_NUM);
+    break;
+
+  case PROP_CUSTOM_EQ_FREQ:
+    for(i=0;i<DEFAULT_CUSTOM_EQ_NUM;i++) {
+      freqarr[i] =     equ->bands[i]->freq;
+    }
+    g_value_set_pointer(value, &freqarr);
+    break;
+
+  case PROP_CUSTOM_EQ_WIDTH:
+    for(i=0;i<DEFAULT_CUSTOM_EQ_NUM;i++) {
+      widtharr[i] =    equ->bands[i]->width;
+    }
+    g_value_set_pointer(value, &widtharr);
+    break;
+
+  default:
+    break;
+  }
 }
 
 #if 0
@@ -1277,18 +1276,18 @@ GST_DEBUG ("gst_iir_equalizer_setup");
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-    GST_DEBUG_CATEGORY_INIT(gst_audioeq_debug, "audioeq", 0, "Audio Equalizer Plugin");
-       GST_DEBUG ("audioeq plugin_init ");
-       return gst_element_register(plugin, "audioeq", GST_RANK_NONE, GST_TYPE_AUDIOEQ);
+  GST_DEBUG_CATEGORY_INIT(gst_audioeq_debug, "audioeq", 0, "Audio Equalizer Plugin");
+  GST_DEBUG ("audioeq plugin_init ");
+  return gst_element_register(plugin, "audioeq", GST_RANK_NONE, GST_TYPE_AUDIOEQ);
 }
 
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
-       GST_VERSION_MINOR,
-       audioeq,
-       "Audio Equalizer Plugin",
-       plugin_init,
-       VERSION,
-       "LGPL",
-       "gst-plugins-ext",
-       "https://www.tizen.org/")
+  GST_VERSION_MINOR,
+  audioeq,
+  "Audio Equalizer Plugin",
+  plugin_init,
+  VERSION,
+  "LGPL",
+  "gst-plugins-ext",
+  "https://www.tizen.org/")
index ac05aec..3af6cb8 100644 (file)
@@ -63,7 +63,6 @@ GST_DEBUG_CATEGORY_STATIC(gst_audiotp_debug);
 
 G_DEFINE_TYPE_WITH_CODE(Gstaudiotp, gst_audiotp, GST_TYPE_ELEMENT, _do_init(G_TYPE_INVALID));
 
-static void gst_audiotp_base_init(gpointer klass);
 static void gst_audiotp_class_init(GstaudiotpClass *klass);
 static void gst_audiotp_init(Gstaudiotp *dec);
 static GstFlowReturn gst_audiotp_chain(GstPad *pad, GstObject *parent, GstBuffer *buf);
@@ -78,22 +77,6 @@ static GstFlowReturn gst_audiotp_push_silent_frame (Gstaudiotp *audiotp, GstBuff
 //        Gstreamer Base Functions                    //
 ////////////////////////////////////////////////////////
 
-#if 0
-/**
- **
- **  Description: The element details and pad templates are registered with the plugin
- **  In Params    : @ gclass instance of Element class
- **  return    : None
- **  Comments    : 1. Adding templates of source and sink pad to element
- **           2. Setting element class deatils to element
- **
- */
-static void
-gst_audiotp_base_init(gpointer klass)
-{
-}
-#endif
-
 /**
  **
  **  Description: Initialization of the Element Class
@@ -265,12 +248,12 @@ gst_audiotp_sink_event (GstPad *pad, GstObject *parent, GstEvent *event)
 
       /* If we receive new_segment without FLUSH events, then we will push all the frame in queue */
       while (!g_queue_is_empty (audiotp->reverse)) {
-           GstBuffer *MetaDataBuf;
+        GstBuffer *MetaDataBuf;
         GstFlowReturn ret = GST_FLOW_OK;
-               if(audiotp->is_reversed)
+        if(audiotp->is_reversed)
           MetaDataBuf = g_queue_pop_head (audiotp->reverse);
-               else
-                 MetaDataBuf = g_queue_pop_tail (audiotp->reverse);
+        else
+          MetaDataBuf = g_queue_pop_tail (audiotp->reverse);
         ret = gst_audiotp_push_silent_frame (audiotp, MetaDataBuf);
         if (GST_FLOW_OK != ret)
         {
@@ -286,12 +269,12 @@ gst_audiotp_sink_event (GstPad *pad, GstObject *parent, GstEvent *event)
     case GST_EVENT_EOS: {
       /* queue all buffer timestamps till we receive next discontinuity */
       while (!g_queue_is_empty (audiotp->reverse)) {
-           GstBuffer *MetaDataBuf;
+        GstBuffer *MetaDataBuf;
         GstFlowReturn ret = GST_FLOW_OK;
-               if(audiotp->is_reversed)
+        if(audiotp->is_reversed)
           MetaDataBuf = g_queue_pop_head (audiotp->reverse);
-               else
-                 MetaDataBuf = g_queue_pop_tail (audiotp->reverse);
+        else
+          MetaDataBuf = g_queue_pop_tail (audiotp->reverse);
         ret = gst_audiotp_push_silent_frame (audiotp, MetaDataBuf);
         if (GST_FLOW_OK != ret) {
           GST_WARNING_OBJECT (audiotp, "pad_push returned = %s", gst_flow_get_name (ret));
@@ -352,7 +335,7 @@ gst_audiotp_chain(GstPad *pad, GstObject *parent, GstBuffer *buf)
 
   if(buf == NULL) {
     ret = GST_FLOW_ERROR;
-       goto error_exit;
+    goto error_exit;
   }
 
   GST_LOG_OBJECT (audiotp, "Input buffer : ts =%" GST_TIME_FORMAT ", dur=%" GST_TIME_FORMAT ", size=%d %s",
@@ -378,7 +361,7 @@ send_reverse:
   {
     GstBuffer *MetaDataBuf = NULL;
     GstClockTime headbuf_ts = GST_CLOCK_TIME_NONE;
-       GstClockTime tailbuf_ts = GST_CLOCK_TIME_NONE;
+    GstClockTime tailbuf_ts = GST_CLOCK_TIME_NONE;
 
     /* Discont buffers is mostly due to seek, when buffers of seeked timestamp gets pushed */
     if (GST_BUFFER_IS_DISCONT(buf)) {
@@ -387,7 +370,7 @@ send_reverse:
         GstBuffer *tailbuf = (GstBuffer*) (audiotp->reverse->tail->data);
 
         headbuf_ts = GST_BUFFER_TIMESTAMP(headbuf);
-               tailbuf_ts = GST_BUFFER_TIMESTAMP(tailbuf);
+        tailbuf_ts = GST_BUFFER_TIMESTAMP(tailbuf);
 
         GST_DEBUG_OBJECT(audiotp,"Headbuf ts =%" GST_TIME_FORMAT ", TailBuf ts =%" GST_TIME_FORMAT "",
             GST_TIME_ARGS(GST_BUFFER_TIMESTAMP(headbuf)),
@@ -416,12 +399,12 @@ send_reverse:
           goto error_exit;
         }
 
-          /* If buffers arrive in forward order, compare the MetaDatabuf with
-               * previous head buffer timestamp.
-               * If buffers arrive in reverse order, compare the MetaDataBuf with
-               * previous tail buffer timestamp */
-        if((GST_BUFFER_TIMESTAMP(MetaDataBuf) < audiotp->head_prev && !audiotp->is_reversed)
-                               || (GST_BUFFER_TIMESTAMP(MetaDataBuf) < audiotp->tail_prev && audiotp->is_reversed)) {
+          /* If buffers arrive in forward order, compare the MetaDatabuf with
+           * previous head buffer timestamp.
+           * If buffers arrive in reverse order, compare the MetaDataBuf with
+           * previous tail buffer timestamp */
+          if((GST_BUFFER_TIMESTAMP(MetaDataBuf) < audiotp->head_prev && !audiotp->is_reversed)
+            || (GST_BUFFER_TIMESTAMP(MetaDataBuf) < audiotp->tail_prev && audiotp->is_reversed)) {
           ret = gst_audiotp_push_silent_frame (audiotp, MetaDataBuf);
           if (MetaDataBuf) {
             gst_buffer_unref (MetaDataBuf);
@@ -447,7 +430,7 @@ send_reverse:
       }
 
       audiotp->head_prev = headbuf_ts;
-         audiotp->tail_prev = tailbuf_ts;
+      audiotp->tail_prev = tailbuf_ts;
     }
 
     MetaDataBuf = gst_buffer_new ();