aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:34:33 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-18 19:34:33 +0100
commit2d859063677ec2a46b3ae3c49d5fa722ff9f7cf8 (patch)
tree40794735d3ac0c354df6c56f79b1def82538acf1
parentecore_audio: Change method signature of read and read_internal (diff)
downloadefl-2d859063677ec2a46b3ae3c49d5fa722ff9f7cf8.tar.gz
ecore_audio: Fix warnings
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
-rw-r--r--src/examples/ecore/ecore_audio_custom.c2
-rw-r--r--src/examples/ecore/ecore_audio_playback.c17
-rw-r--r--src/examples/ecore/ecore_audio_to_ogg.c6
-rw-r--r--src/lib/ecore_audio/ecore_audio.c1
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj.c33
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c20
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c4
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_tone.c5
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c8
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c17
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c4
11 files changed, 42 insertions, 75 deletions
diff --git a/src/examples/ecore/ecore_audio_custom.c b/src/examples/ecore/ecore_audio_custom.c
index 2b6d1335f8..8234b1e153 100644
--- a/src/examples/ecore/ecore_audio_custom.c
+++ b/src/examples/ecore/ecore_audio_custom.c
@@ -52,6 +52,8 @@ main(int argc, const char *argv[])
ecore_init();
ecore_audio_init();
+ ecore_app_args_set(argc, argv);
+
out = eo_add(ECORE_AUDIO_OBJ_OUT_PULSE_CLASS, NULL);
in = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
diff --git a/src/examples/ecore/ecore_audio_playback.c b/src/examples/ecore/ecore_audio_playback.c
index c3314eeba3..788326b2b2 100644
--- a/src/examples/ecore/ecore_audio_playback.c
+++ b/src/examples/ecore/ecore_audio_playback.c
@@ -159,7 +159,7 @@ handle_cmd(char *cmd, size_t bread)
}
Eina_Bool
-handle_input(void *data, Ecore_Fd_Handler *handler)
+handle_input(void *data EINA_UNUSED, Ecore_Fd_Handler *handler)
{
size_t bread;
char buf[20];
@@ -184,17 +184,6 @@ handle_input(void *data, Ecore_Fd_Handler *handler)
return EINA_TRUE;
}
-static Eina_Bool _play_started(void *data, int type, void *event)
-{
- const char *name;
- Eo *in = event;
-
- eo_do(in, ecore_audio_obj_name_get(&name));
- printf("Start: %s\n", name);
-
- return EINA_TRUE;
-}
-
static Eina_Bool _play_finished(void *data EINA_UNUSED, Eo *in, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
const char *name;
@@ -279,7 +268,9 @@ main(int argc, const char *argv[])
printf("error when creating ecore audio source.\n");
goto end;
}
- eo_do(in, ecore_audio_obj_name_set(basename(argv[i])));
+ tmp = strdup(argv[i]);
+ eo_do(in, ecore_audio_obj_name_set(basename(tmp)));
+ free(tmp);
eo_do(in, ecore_audio_obj_source_set(argv[i]));
}
eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_STOPPED, _play_finished, NULL));
diff --git a/src/examples/ecore/ecore_audio_to_ogg.c b/src/examples/ecore/ecore_audio_to_ogg.c
index e5d05ce278..973941d479 100644
--- a/src/examples/ecore/ecore_audio_to_ogg.c
+++ b/src/examples/ecore/ecore_audio_to_ogg.c
@@ -15,7 +15,7 @@
double volume = 1;
Eina_List *inputs = NULL;
-static Eina_Bool _play_finished(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
+static Eina_Bool _play_finished(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
const char *name;
Eo *out;
@@ -33,9 +33,8 @@ static Eina_Bool _play_finished(void *data, Eo *obj, const Eo_Event_Description
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
- int ret;
Eo *out;
Eo *in;
@@ -62,7 +61,6 @@ main(int argc, const char *argv[])
ecore_main_loop_begin();
-end:
ecore_audio_shutdown();
ecore_shutdown();
diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c
index f00fd7323d..4d38c13ada 100644
--- a/src/lib/ecore_audio/ecore_audio.c
+++ b/src/lib/ecore_audio/ecore_audio.c
@@ -24,7 +24,6 @@ Eina_List *ecore_audio_modules;
EAPI int
ecore_audio_init(void)
{
- Ecore_Audio_Module *mod;
if (++_ecore_audio_init_count != 1)
return _ecore_audio_init_count;
diff --git a/src/lib/ecore_audio/ecore_audio_obj.c b/src/lib/ecore_audio/ecore_audio_obj.c
index 62a784e0f6..83ddbe95e1 100644
--- a/src/lib/ecore_audio/ecore_audio_obj.c
+++ b/src/lib/ecore_audio/ecore_audio_obj.c
@@ -20,16 +20,16 @@ EAPI Eo_Op ECORE_AUDIO_OBJ_BASE_ID = EO_NOOP;
#define MY_CLASS ECORE_AUDIO_OBJ_CLASS
#define MY_CLASS_NAME "ecore_audio_obj"
-static void _name_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _name_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
- const Ecore_Audio_Object *obj = _pd;
+ Ecore_Audio_Object *obj = _pd;
const char *name = va_arg(*list, const char *);
eina_stringshare_replace(&obj->name, name);
}
-static void _name_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _name_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Object *obj = _pd;
@@ -39,7 +39,7 @@ static void _name_get(Eo *eo_obj, void *_pd, va_list *list)
*name = obj->name;
}
-static void _paused_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _paused_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Object *obj = _pd;
@@ -48,7 +48,7 @@ static void _paused_set(Eo *eo_obj, void *_pd, va_list *list)
obj->paused = paused;
}
-static void _paused_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _paused_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Object *obj = _pd;
@@ -58,26 +58,7 @@ static void _paused_get(Eo *eo_obj, void *_pd, va_list *list)
*ret = obj->paused;
}
-static void _volume_set(Eo *eo_obj, void *_pd, va_list *list)
-{
- Ecore_Audio_Object *obj = _pd;
-
- double volume = va_arg(*list, double);
-
- obj->volume = volume;
-}
-
-static void _volume_get(Eo *eo_obj, void *_pd, va_list *list)
-{
- const Ecore_Audio_Object *obj = _pd;
-
- double *ret = va_arg(*list, double *);
-
- if (ret)
- *ret = obj->volume;
-}
-
-static void _format_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _volume_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Object *obj = _pd;
@@ -86,7 +67,7 @@ static void _format_set(Eo *eo_obj, void *_pd, va_list *list)
obj->volume = volume;
}
-static void _format_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _volume_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Object *obj = _pd;
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index 292d06c8e6..72a0a23e8e 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -26,7 +26,7 @@ EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED =
#define MY_CLASS ECORE_AUDIO_OBJ_IN_CLASS
#define MY_CLASS_NAME "ecore_audio_obj_in"
-static void _speed_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _speed_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Input *obj = _pd;
@@ -42,7 +42,7 @@ static void _speed_set(Eo *eo_obj, void *_pd, va_list *list)
eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL));
}
-static void _speed_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _speed_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Input *obj = _pd;
@@ -52,7 +52,7 @@ static void _speed_get(Eo *eo_obj, void *_pd, va_list *list)
*speed = obj->speed;
}
-static void _samplerate_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _samplerate_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Input *obj = _pd;
@@ -63,7 +63,7 @@ static void _samplerate_set(Eo *eo_obj, void *_pd, va_list *list)
eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL));
}
-static void _samplerate_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _samplerate_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Input *obj = _pd;
@@ -73,7 +73,7 @@ static void _samplerate_get(Eo *eo_obj, void *_pd, va_list *list)
*samplerate = obj->samplerate;
}
-static void _channels_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _channels_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Input *obj = _pd;
@@ -85,7 +85,7 @@ static void _channels_set(Eo *eo_obj, void *_pd, va_list *list)
}
-static void _channels_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _channels_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Input *obj = _pd;
@@ -95,7 +95,7 @@ static void _channels_get(Eo *eo_obj, void *_pd, va_list *list)
*channels = obj->channels;
}
-static void _looped_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _looped_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Input *obj = _pd;
@@ -104,7 +104,7 @@ static void _looped_set(Eo *eo_obj, void *_pd, va_list *list)
obj->looped = looped;
}
-static void _looped_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _looped_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Input *obj = _pd;
@@ -114,7 +114,7 @@ static void _looped_get(Eo *eo_obj, void *_pd, va_list *list)
*ret = obj->looped;
}
-static void _length_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _length_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Input *obj = _pd;
@@ -188,7 +188,7 @@ static void _read_internal(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
*ret = len_read;
}
-static void _output_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _output_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Input *obj = _pd;
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
index 42df376abd..08ff50955d 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -113,7 +113,7 @@ static void _read(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
*ret = read;
}
-static void _seek(Eo *eo_obj, void *_pd, va_list *list)
+static void _seek(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Sndfile *obj = _pd;
sf_count_t count, pos;
@@ -289,7 +289,7 @@ static void _vio_set(Eo *eo_obj, void *_pd, va_list *list)
ea_obj->format = ECORE_AUDIO_FORMAT_AUTO;
}
-static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
+static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
eo_do_super(eo_obj, MY_CLASS, eo_constructor());
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
index e8969c70bf..f00d5d4830 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
@@ -90,12 +90,9 @@ err:
*ret = -1.0;
}
-static void _source_set(Eo *eo_obj, void *_pd, va_list *list)
+static void _source_set(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
{
- Ecore_Audio_Tone *obj = _pd;
-
Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
- Ecore_Audio_Input *in_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_IN_CLASS);
const char *source = va_arg(*list, const char *);
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c
index 141d26bc17..1e7b2d2473 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out.c
@@ -42,7 +42,7 @@ static void _input_attach(Eo *eo_obj, void *_pd, va_list *list)
*ret = EINA_TRUE;
}
-static void _input_detach(Eo *eo_obj, void *_pd, va_list *list)
+static void _input_detach(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
Ecore_Audio_Output *obj = _pd;
Ecore_Audio_Input *in;
@@ -61,7 +61,7 @@ static void _input_detach(Eo *eo_obj, void *_pd, va_list *list)
}
-static void _inputs_get(Eo *eo_obj, void *_pd, va_list *list)
+static void _inputs_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
{
const Ecore_Audio_Output *obj = _pd;
@@ -72,10 +72,8 @@ static void _inputs_get(Eo *eo_obj, void *_pd, va_list *list)
}
-static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
+static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- const Ecore_Audio_Output *obj = _pd;
-
eo_do_super(eo_obj, MY_CLASS, eo_constructor());
}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index 3e3a1ba490..4402694303 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -83,7 +83,7 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
eo_do(in, ecore_audio_obj_in_read(buf, len, &bread));
pa_stream_write(stream, buf, bread, free, 0, PA_SEEK_RELATIVE);
- if (bread < len)
+ if (bread < (int)len)
{
pa_operation_unref(pa_stream_trigger(stream, NULL, NULL));
//in->ended = EINA_TRUE;
@@ -91,9 +91,8 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
}
}
-static Eina_Bool _update_samplerate_cb(void *data, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
+static Eina_Bool _update_samplerate_cb(void *data EINA_UNUSED, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *out = data;
pa_stream *stream;
int samplerate;
double speed;
@@ -101,9 +100,11 @@ static Eina_Bool _update_samplerate_cb(void *data, Eo *eo_obj, const Eo_Event_De
eo_do(eo_obj, ecore_audio_obj_in_samplerate_get(&samplerate));
eo_do(eo_obj, ecore_audio_obj_in_speed_get(&speed));
- eo_do(eo_obj, eo_base_data_get("pulse_data", &stream));
+ eo_do(eo_obj, eo_base_data_get("pulse_data", (void **)&stream));
pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL));
+
+ return EINA_TRUE;
}
static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
@@ -116,9 +117,9 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
ss.format = PA_SAMPLE_FLOAT32LE;
- eo_do(in, ecore_audio_obj_in_samplerate_get(&ss.rate));
+ eo_do(in, ecore_audio_obj_in_samplerate_get((int *)&ss.rate));
eo_do(in, ecore_audio_obj_in_speed_get(&speed));
- eo_do(in, ecore_audio_obj_in_channels_get(&ss.channels));
+ eo_do(in, ecore_audio_obj_in_channels_get((int *)&ss.channels));
eo_do(in, ecore_audio_obj_name_get(&name));
ss.rate = ss.rate * speed;
@@ -135,11 +136,13 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
eo_do(in, eo_base_data_set("pulse_data", stream, NULL));
- //FIXME: Handle paused state
pa_stream_set_write_callback(stream, _write_cb, in);
pa_stream_connect_playback(stream, NULL, NULL, PA_STREAM_VARIABLE_RATE, NULL, NULL);
+ if (ea_obj->paused)
+ pa_operation_unref(pa_stream_cork(stream, 1, NULL, NULL));
+
return ret;
}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
index 4a04f2aa5a..99e89d1838 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
@@ -160,10 +160,8 @@ static void _format_get(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
*ret = obj->format;
}
-static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
+static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- Ecore_Audio_Sndfile *obj = _pd;
-
eo_do_super(eo_obj, MY_CLASS, eo_constructor());
eo_do(eo_obj, ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG));