tabs --> spaces

SVN revision: 60375
This commit is contained in:
Vincent Torri 2011-06-16 06:24:25 +00:00
parent dfd0299f5d
commit 439a53bdbd
2 changed files with 297 additions and 297 deletions

View File

@ -20,7 +20,7 @@ static void _free_metadata (Emotion_Gstreamer_Metadata *m);
static unsigned char em_init (Evas_Object *obj, static unsigned char em_init (Evas_Object *obj,
void **emotion_video, void **emotion_video,
Emotion_Module_Options *opt); Emotion_Module_Options *opt);
static int em_shutdown (void *video); static int em_shutdown (void *video);
@ -234,8 +234,8 @@ static Emotion_Video_Module em_module =
static unsigned char static unsigned char
em_init(Evas_Object *obj, em_init(Evas_Object *obj,
void **emotion_video, void **emotion_video,
Emotion_Module_Options *opt __UNUSED__) Emotion_Module_Options *opt __UNUSED__)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
GError *error; GError *error;
@ -304,8 +304,8 @@ em_shutdown(void *video)
static unsigned char static unsigned char
em_file_open(const char *file, em_file_open(const char *file,
Evas_Object *obj, Evas_Object *obj,
void *video) void *video)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -375,33 +375,33 @@ em_file_close(void *video)
/* shutdown eos */ /* shutdown eos */
if (ev->eos_timer) if (ev->eos_timer)
{ {
ecore_timer_del(ev->eos_timer); ecore_timer_del(ev->eos_timer);
ev->eos_timer = NULL; ev->eos_timer = NULL;
} }
if (ev->eos_bus) if (ev->eos_bus)
{ {
gst_object_unref(GST_OBJECT(ev->eos_bus)); gst_object_unref(GST_OBJECT(ev->eos_bus));
ev->eos_bus = NULL; ev->eos_bus = NULL;
} }
if (ev->metadata) if (ev->metadata)
{ {
_free_metadata(ev->metadata); _free_metadata(ev->metadata);
ev->metadata = NULL; ev->metadata = NULL;
} }
if (ev->pipeline) if (ev->pipeline)
{ {
gst_element_set_state(ev->pipeline, GST_STATE_NULL); gst_element_set_state(ev->pipeline, GST_STATE_NULL);
gst_object_unref(ev->pipeline); gst_object_unref(ev->pipeline);
ev->pipeline = NULL; ev->pipeline = NULL;
} }
} }
static void static void
em_play(void *video, em_play(void *video,
double pos __UNUSED__) double pos __UNUSED__)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -424,8 +424,8 @@ em_stop(void *video)
/* shutdown eos */ /* shutdown eos */
if (ev->eos_timer) if (ev->eos_timer)
{ {
ecore_timer_del(ev->eos_timer); ecore_timer_del(ev->eos_timer);
ev->eos_timer = NULL; ev->eos_timer = NULL;
} }
gst_element_set_state(ev->pipeline, GST_STATE_PAUSED); gst_element_set_state(ev->pipeline, GST_STATE_PAUSED);
@ -434,8 +434,8 @@ em_stop(void *video)
static void static void
em_size_get(void *video, em_size_get(void *video,
int *width, int *width,
int *height) int *height)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
Emotion_Video_Stream *vstream; Emotion_Video_Stream *vstream;
@ -445,19 +445,19 @@ em_size_get(void *video,
vstream = (Emotion_Video_Stream *)eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); vstream = (Emotion_Video_Stream *)eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
if (vstream) if (vstream)
{ {
if (width) *width = vstream->width; if (width) *width = vstream->width;
if (height) *height = vstream->height; if (height) *height = vstream->height;
} }
else else
{ {
if (width) *width = 0; if (width) *width = 0;
if (height) *height = 0; if (height) *height = 0;
} }
} }
static void static void
em_pos_set(void *video, em_pos_set(void *video,
double pos) double pos)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
GstElement *vsink; GstElement *vsink;
@ -472,21 +472,21 @@ em_pos_set(void *video,
if (vsink) if (vsink)
{ {
gst_element_seek(vsink, 1.0, gst_element_seek(vsink, 1.0,
GST_FORMAT_TIME, GST_FORMAT_TIME,
GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH, GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, GST_SEEK_TYPE_SET,
(gint64)(pos * (double)GST_SECOND), (gint64)(pos * (double)GST_SECOND),
GST_SEEK_TYPE_NONE, -1); GST_SEEK_TYPE_NONE, -1);
} }
if (asink) if (asink)
{ {
gst_element_seek(asink, 1.0, gst_element_seek(asink, 1.0,
GST_FORMAT_TIME, GST_FORMAT_TIME,
GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH, GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH,
GST_SEEK_TYPE_SET, GST_SEEK_TYPE_SET,
(gint64)(pos * (double)GST_SECOND), (gint64)(pos * (double)GST_SECOND),
GST_SEEK_TYPE_NONE, -1); GST_SEEK_TYPE_NONE, -1);
} }
} }
@ -509,9 +509,9 @@ em_len_get(void *video)
if (fmt != GST_FORMAT_TIME) if (fmt != GST_FORMAT_TIME)
{ {
DBG("requrested duration in time, but got %s instead.", DBG("requrested duration in time, but got %s instead.",
gst_format_get_name(fmt)); gst_format_get_name(fmt));
goto fallback; goto fallback;
} }
if (val <= 0.0) if (val <= 0.0)
@ -594,7 +594,7 @@ em_pos_get(void *video)
{ {
ERR("requrested position in time, but got %s instead.", ERR("requrested position in time, but got %s instead.",
gst_format_get_name(fmt)); gst_format_get_name(fmt));
return ev->position; return ev->position;
} }
ev->position = val / 1000000000.0; ev->position = val / 1000000000.0;
@ -603,7 +603,7 @@ em_pos_get(void *video)
static void static void
em_vis_set(void *video, em_vis_set(void *video,
Emotion_Vis vis) Emotion_Vis vis)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -702,19 +702,19 @@ em_format_get(void *video)
vstream = (Emotion_Video_Stream *)eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); vstream = (Emotion_Video_Stream *)eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
if (vstream) if (vstream)
{ {
switch (vstream->fourcc) switch (vstream->fourcc)
{ {
case GST_MAKE_FOURCC('I', '4', '2', '0'): case GST_MAKE_FOURCC('I', '4', '2', '0'):
return EMOTION_FORMAT_I420; return EMOTION_FORMAT_I420;
case GST_MAKE_FOURCC('Y', 'V', '1', '2'): case GST_MAKE_FOURCC('Y', 'V', '1', '2'):
return EMOTION_FORMAT_YV12; return EMOTION_FORMAT_YV12;
case GST_MAKE_FOURCC('Y', 'U', 'Y', '2'): case GST_MAKE_FOURCC('Y', 'U', 'Y', '2'):
return EMOTION_FORMAT_YUY2; return EMOTION_FORMAT_YUY2;
case GST_MAKE_FOURCC('A', 'R', 'G', 'B'): case GST_MAKE_FOURCC('A', 'R', 'G', 'B'):
return EMOTION_FORMAT_BGRA; return EMOTION_FORMAT_BGRA;
default: default:
return EMOTION_FORMAT_NONE; return EMOTION_FORMAT_NONE;
} }
} }
return EMOTION_FORMAT_NONE; return EMOTION_FORMAT_NONE;
} }
@ -730,23 +730,23 @@ em_video_data_size_get(void *video, int *w, int *h)
vstream = (Emotion_Video_Stream *)eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1); vstream = (Emotion_Video_Stream *)eina_list_nth(ev->video_streams, ev->video_stream_nbr - 1);
if (vstream) if (vstream)
{ {
*w = vstream->width; *w = vstream->width;
*h = vstream->height; *h = vstream->height;
} }
else else
{ {
*w = 0; *w = 0;
*h = 0; *h = 0;
} }
} }
static int static int
em_yuv_rows_get(void *video, em_yuv_rows_get(void *video,
int w, int w,
int h, int h,
unsigned char **yrows, unsigned char **yrows,
unsigned char **urows, unsigned char **urows,
unsigned char **vrows) unsigned char **vrows)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
int i; int i;
@ -755,32 +755,32 @@ em_yuv_rows_get(void *video,
if (ev->obj_data) if (ev->obj_data)
{ {
if (em_format_get(video) == EMOTION_FORMAT_I420) if (em_format_get(video) == EMOTION_FORMAT_I420)
{ {
for (i = 0; i < h; i++) for (i = 0; i < h; i++)
yrows[i] = &ev->obj_data[i * w]; yrows[i] = &ev->obj_data[i * w];
for (i = 0; i < (h / 2); i++) for (i = 0; i < (h / 2); i++)
urows[i] = &ev->obj_data[h * w + i * (w / 2)]; urows[i] = &ev->obj_data[h * w + i * (w / 2)];
for (i = 0; i < (h / 2); i++) for (i = 0; i < (h / 2); i++)
vrows[i] = &ev->obj_data[h * w + h * (w /4) + i * (w / 2)]; vrows[i] = &ev->obj_data[h * w + h * (w /4) + i * (w / 2)];
} }
else if (em_format_get(video) == EMOTION_FORMAT_YV12) else if (em_format_get(video) == EMOTION_FORMAT_YV12)
{ {
for (i = 0; i < h; i++) for (i = 0; i < h; i++)
yrows[i] = &ev->obj_data[i * w]; yrows[i] = &ev->obj_data[i * w];
for (i = 0; i < (h / 2); i++) for (i = 0; i < (h / 2); i++)
vrows[i] = &ev->obj_data[h * w + i * (w / 2)]; vrows[i] = &ev->obj_data[h * w + i * (w / 2)];
for (i = 0; i < (h / 2); i++) for (i = 0; i < (h / 2); i++)
urows[i] = &ev->obj_data[h * w + h * (w /4) + i * (w / 2)]; urows[i] = &ev->obj_data[h * w + h * (w /4) + i * (w / 2)];
} }
else else
return 0; return 0;
return 1; return 1;
} }
return 0; return 0;
@ -795,8 +795,8 @@ em_bgra_data_get(void *video, unsigned char **bgra_data)
if (ev->obj_data && em_format_get(video) == EMOTION_FORMAT_BGRA) if (ev->obj_data && em_format_get(video) == EMOTION_FORMAT_BGRA)
{ {
*bgra_data = ev->obj_data; *bgra_data = ev->obj_data;
return 1; return 1;
} }
return 0; return 0;
} }
@ -829,7 +829,7 @@ em_video_channel_count(void *video)
static void static void
em_video_channel_set(void *video __UNUSED__, em_video_channel_set(void *video __UNUSED__,
int channel __UNUSED__) int channel __UNUSED__)
{ {
#if 0 #if 0
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -853,14 +853,14 @@ em_video_channel_get(void *video)
static const char * static const char *
em_video_channel_name_get(void *video __UNUSED__, em_video_channel_name_get(void *video __UNUSED__,
int channel __UNUSED__) int channel __UNUSED__)
{ {
return NULL; return NULL;
} }
static void static void
em_video_channel_mute_set(void *video, em_video_channel_mute_set(void *video,
int mute) int mute)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -893,7 +893,7 @@ em_audio_channel_count(void *video)
static void static void
em_audio_channel_set(void *video __UNUSED__, em_audio_channel_set(void *video __UNUSED__,
int channel __UNUSED__) int channel __UNUSED__)
{ {
#if 0 #if 0
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -917,14 +917,14 @@ em_audio_channel_get(void *video)
static const char * static const char *
em_audio_channel_name_get(void *video __UNUSED__, em_audio_channel_name_get(void *video __UNUSED__,
int channel __UNUSED__) int channel __UNUSED__)
{ {
return NULL; return NULL;
} }
static void static void
em_audio_channel_mute_set(void *video, em_audio_channel_mute_set(void *video,
int mute) int mute)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -953,7 +953,7 @@ em_audio_channel_mute_get(void *video)
static void static void
em_audio_channel_volume_set(void *video, em_audio_channel_volume_set(void *video,
double vol) double vol)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
@ -1065,28 +1065,28 @@ em_meta_get(void *video, int meta)
switch (meta) switch (meta)
{ {
case META_TRACK_TITLE: case META_TRACK_TITLE:
str = ev->metadata->title; str = ev->metadata->title;
break; break;
case META_TRACK_ARTIST: case META_TRACK_ARTIST:
str = ev->metadata->artist; str = ev->metadata->artist;
break; break;
case META_TRACK_ALBUM: case META_TRACK_ALBUM:
str = ev->metadata->album; str = ev->metadata->album;
break; break;
case META_TRACK_YEAR: case META_TRACK_YEAR:
str = ev->metadata->year; str = ev->metadata->year;
break; break;
case META_TRACK_GENRE: case META_TRACK_GENRE:
str = ev->metadata->genre; str = ev->metadata->genre;
break; break;
case META_TRACK_COMMENT: case META_TRACK_COMMENT:
str = ev->metadata->comment; str = ev->metadata->comment;
break; break;
case META_TRACK_DISCID: case META_TRACK_DISCID:
str = ev->metadata->disc_id; str = ev->metadata->disc_id;
break; break;
default: default:
break; break;
} }
return str; return str;
@ -1094,9 +1094,9 @@ em_meta_get(void *video, int meta)
static Eina_Bool static Eina_Bool
module_open(Evas_Object *obj, module_open(Evas_Object *obj,
const Emotion_Video_Module **module, const Emotion_Video_Module **module,
void **video, void **video,
Emotion_Module_Options *opt) Emotion_Module_Options *opt)
{ {
if (!module) if (!module)
return EINA_FALSE; return EINA_FALSE;
@ -1123,7 +1123,7 @@ module_open(Evas_Object *obj,
static void static void
module_close(Emotion_Video_Module *module __UNUSED__, module_close(Emotion_Video_Module *module __UNUSED__,
void *video) void *video)
{ {
em_module.shutdown(video); em_module.shutdown(video);
} }
@ -1149,8 +1149,8 @@ EINA_MODULE_SHUTDOWN(gstreamer_module_shutdown);
static void static void
_for_each_tag(GstTagList const* list, _for_each_tag(GstTagList const* list,
gchar const* tag, gchar const* tag,
void *data) void *data)
{ {
Emotion_Gstreamer_Video *ev; Emotion_Gstreamer_Video *ev;
int i; int i;
@ -1165,98 +1165,98 @@ _for_each_tag(GstTagList const* list,
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
if (!strcmp(tag, GST_TAG_TITLE)) if (!strcmp(tag, GST_TAG_TITLE))
{ {
char *str; char *str;
if (ev->metadata->title) g_free(ev->metadata->title); if (ev->metadata->title) g_free(ev->metadata->title);
if (gst_tag_list_get_string(list, GST_TAG_TITLE, &str)) if (gst_tag_list_get_string(list, GST_TAG_TITLE, &str))
ev->metadata->title = str; ev->metadata->title = str;
else else
ev->metadata->title = NULL; ev->metadata->title = NULL;
break; break;
} }
if (!strcmp(tag, GST_TAG_ALBUM)) if (!strcmp(tag, GST_TAG_ALBUM))
{ {
gchar *str; gchar *str;
if (ev->metadata->album) g_free(ev->metadata->album); if (ev->metadata->album) g_free(ev->metadata->album);
if (gst_tag_list_get_string(list, GST_TAG_ALBUM, &str)) if (gst_tag_list_get_string(list, GST_TAG_ALBUM, &str))
ev->metadata->album = str; ev->metadata->album = str;
else else
ev->metadata->album = NULL; ev->metadata->album = NULL;
break; break;
} }
if (!strcmp(tag, GST_TAG_ARTIST)) if (!strcmp(tag, GST_TAG_ARTIST))
{ {
gchar *str; gchar *str;
if (ev->metadata->artist) g_free( ev->metadata->artist); if (ev->metadata->artist) g_free( ev->metadata->artist);
if (gst_tag_list_get_string(list, GST_TAG_ARTIST, &str)) if (gst_tag_list_get_string(list, GST_TAG_ARTIST, &str))
ev->metadata->artist = str; ev->metadata->artist = str;
else else
ev->metadata->artist = NULL; ev->metadata->artist = NULL;
break; break;
} }
if (!strcmp(tag, GST_TAG_GENRE)) if (!strcmp(tag, GST_TAG_GENRE))
{ {
gchar *str; gchar *str;
if (ev->metadata->genre) g_free( ev->metadata->genre); if (ev->metadata->genre) g_free( ev->metadata->genre);
if (gst_tag_list_get_string(list, GST_TAG_GENRE, &str)) if (gst_tag_list_get_string(list, GST_TAG_GENRE, &str))
ev->metadata->genre = str; ev->metadata->genre = str;
else else
ev->metadata->genre = NULL; ev->metadata->genre = NULL;
break; break;
} }
if (!strcmp(tag, GST_TAG_COMMENT)) if (!strcmp(tag, GST_TAG_COMMENT))
{ {
gchar *str; gchar *str;
if (ev->metadata->comment) g_free(ev->metadata->comment); if (ev->metadata->comment) g_free(ev->metadata->comment);
if (gst_tag_list_get_string(list, GST_TAG_COMMENT, &str)) if (gst_tag_list_get_string(list, GST_TAG_COMMENT, &str))
ev->metadata->comment = str; ev->metadata->comment = str;
else else
ev->metadata->comment = NULL; ev->metadata->comment = NULL;
break; break;
} }
if (!strcmp(tag, GST_TAG_DATE)) if (!strcmp(tag, GST_TAG_DATE))
{ {
gchar *str; gchar *str;
const GValue *date; const GValue *date;
if (ev->metadata->year) g_free(ev->metadata->year); if (ev->metadata->year) g_free(ev->metadata->year);
date = gst_tag_list_get_value_index(list, GST_TAG_DATE, 0); date = gst_tag_list_get_value_index(list, GST_TAG_DATE, 0);
if (date) if (date)
str = g_strdup_value_contents(date); str = g_strdup_value_contents(date);
else else
str = NULL; str = NULL;
ev->metadata->year = str; ev->metadata->year = str;
break; break;
} }
if (!strcmp(tag, GST_TAG_TRACK_NUMBER)) if (!strcmp(tag, GST_TAG_TRACK_NUMBER))
{ {
gchar *str; gchar *str;
const GValue *track; const GValue *track;
if (ev->metadata->count) g_free( ev->metadata->count); if (ev->metadata->count) g_free( ev->metadata->count);
track = gst_tag_list_get_value_index(list, GST_TAG_TRACK_NUMBER, 0); track = gst_tag_list_get_value_index(list, GST_TAG_TRACK_NUMBER, 0);
if (track) if (track)
str = g_strdup_value_contents(track); str = g_strdup_value_contents(track);
else else
str = NULL; str = NULL;
ev->metadata->count = str; ev->metadata->count = str;
break; break;
} }
#ifdef GST_TAG_CDDA_CDDB_DISCID #ifdef GST_TAG_CDDA_CDDB_DISCID
if (!strcmp(tag, GST_TAG_CDDA_CDDB_DISCID)) if (!strcmp(tag, GST_TAG_CDDA_CDDB_DISCID))
{ {
gchar *str; gchar *str;
const GValue *discid; const GValue *discid;
if (ev->metadata->disc_id) g_free(ev->metadata->disc_id); if (ev->metadata->disc_id) g_free(ev->metadata->disc_id);
discid = gst_tag_list_get_value_index(list, GST_TAG_CDDA_CDDB_DISCID, 0); discid = gst_tag_list_get_value_index(list, GST_TAG_CDDA_CDDB_DISCID, 0);
if (discid) if (discid)
str = g_strdup_value_contents(discid); str = g_strdup_value_contents(discid);
else else
str = NULL; str = NULL;
ev->metadata->disc_id = str; ev->metadata->disc_id = str;
break; break;
} }
#endif #endif
} }
@ -1309,46 +1309,46 @@ _eos_timer_fct(void *data)
} }
while ((msg = gst_bus_poll(ev->eos_bus, GST_MESSAGE_ERROR | GST_MESSAGE_EOS | GST_MESSAGE_TAG, 0))) while ((msg = gst_bus_poll(ev->eos_bus, GST_MESSAGE_ERROR | GST_MESSAGE_EOS | GST_MESSAGE_TAG, 0)))
{ {
switch (GST_MESSAGE_TYPE(msg)) switch (GST_MESSAGE_TYPE(msg))
{ {
case GST_MESSAGE_ERROR: case GST_MESSAGE_ERROR:
{ {
gchar *debug; gchar *debug;
GError *err; GError *err;
gst_message_parse_error(msg, &err, &debug); gst_message_parse_error(msg, &err, &debug);
g_free(debug); g_free(debug);
ERR("Error: %s", err->message); ERR("Error: %s", err->message);
g_error_free(err); g_error_free(err);
break; break;
} }
case GST_MESSAGE_EOS: case GST_MESSAGE_EOS:
if (ev->eos_timer) if (ev->eos_timer)
{ {
ecore_timer_del(ev->eos_timer); ecore_timer_del(ev->eos_timer);
ev->eos_timer = NULL; ev->eos_timer = NULL;
} }
ev->play = 0; ev->play = 0;
_emotion_decode_stop(ev->obj); _emotion_decode_stop(ev->obj);
_emotion_playback_finished(ev->obj); _emotion_playback_finished(ev->obj);
break; break;
case GST_MESSAGE_TAG: case GST_MESSAGE_TAG:
{ {
GstTagList *new_tags; GstTagList *new_tags;
gst_message_parse_tag(msg, &new_tags); gst_message_parse_tag(msg, &new_tags);
if (new_tags) if (new_tags)
{ {
gst_tag_list_foreach(new_tags, (GstTagForeachFunc)_for_each_tag, ev); gst_tag_list_foreach(new_tags, (GstTagForeachFunc)_for_each_tag, ev);
gst_tag_list_free(new_tags); gst_tag_list_free(new_tags);
} }
break; break;
} }
default: default:
break; break;
} }
gst_message_unref(msg); gst_message_unref(msg);
} }
return EINA_TRUE; return EINA_TRUE;
} }

View File

@ -17,7 +17,7 @@ emotion_pipeline_pause(GstElement *pipeline)
GstBus *bus; GstBus *bus;
gboolean done; gboolean done;
ERR("could not pause"); ERR("could not pause");
done = FALSE; done = FALSE;
bus = gst_element_get_bus(pipeline); bus = gst_element_get_bus(pipeline);
@ -61,8 +61,8 @@ emotion_pipeline_pause(GstElement *pipeline)
res = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE); res = gst_element_get_state((pipeline), NULL, NULL, GST_CLOCK_TIME_NONE);
if (res != GST_STATE_CHANGE_SUCCESS) if (res != GST_STATE_CHANGE_SUCCESS)
{ {
ERR("could not complete pause"); ERR("could not complete pause");
return 0; return 0;
} }
return 1; return 1;
@ -380,28 +380,28 @@ cb_handoff(GstElement *fakesrc __UNUSED__,
if (!ev->video_mute) if (!ev->video_mute)
{ {
if (!ev->obj_data) if (!ev->obj_data)
ev->obj_data = malloc(GST_BUFFER_SIZE(buffer) * sizeof(void)); ev->obj_data = malloc(GST_BUFFER_SIZE(buffer) * sizeof(void));
memcpy(ev->obj_data, GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer)); memcpy(ev->obj_data, GST_BUFFER_DATA(buffer), GST_BUFFER_SIZE(buffer));
buf[0] = GST_BUFFER_DATA(buffer); buf[0] = GST_BUFFER_DATA(buffer);
buf[1] = buffer; buf[1] = buffer;
ecore_pipe_write(ev->pipe, buf, sizeof(buf)); ecore_pipe_write(ev->pipe, buf, sizeof(buf));
} }
else else
{ {
Emotion_Audio_Stream *astream; Emotion_Audio_Stream *astream;
astream = (Emotion_Audio_Stream *)eina_list_nth(ev->audio_streams, ev->audio_stream_nbr - 1); astream = (Emotion_Audio_Stream *)eina_list_nth(ev->audio_streams, ev->audio_stream_nbr - 1);
_emotion_video_pos_update(ev->obj, ev->position, astream->length_time); _emotion_video_pos_update(ev->obj, ev->position, astream->length_time);
} }
query = gst_query_new_position(GST_FORMAT_TIME); query = gst_query_new_position(GST_FORMAT_TIME);
if (gst_pad_query(gst_pad_get_peer(pad), query)) if (gst_pad_query(gst_pad_get_peer(pad), query))
{ {
gint64 position; gint64 position;
gst_query_parse_position(query, NULL, &position); gst_query_parse_position(query, NULL, &position);
ev->position = (double)position / (double)GST_SECOND; ev->position = (double)position / (double)GST_SECOND;
} }
gst_query_unref(query); gst_query_unref(query);
} }
@ -419,8 +419,8 @@ emotion_video_stream_new(Emotion_Gstreamer_Video *ev)
ev->video_streams = eina_list_append(ev->video_streams, vstream); ev->video_streams = eina_list_append(ev->video_streams, vstream);
if (eina_error_get()) if (eina_error_get())
{ {
free(vstream); free(vstream);
return NULL; return NULL;
} }
return vstream; return vstream;
} }
@ -431,7 +431,7 @@ emotion_video_stream_free(Emotion_Gstreamer_Video *ev, Emotion_Video_Stream *vst
if (!ev || !vstream) return; if (!ev || !vstream) return;
ev->video_streams = eina_list_remove(ev->video_streams, vstream); ev->video_streams = eina_list_remove(ev->video_streams, vstream);
free(vstream); free(vstream);
} }
int int
@ -451,30 +451,30 @@ emotion_pipeline_cdda_track_count_get(void *video)
while (!done) while (!done)
{ {
GstMessage *message; GstMessage *message;
message = gst_bus_pop(bus); message = gst_bus_pop(bus);
if (!message) if (!message)
/* All messages read, we're done */ /* All messages read, we're done */
break; break;
switch (GST_MESSAGE_TYPE(message)) switch (GST_MESSAGE_TYPE(message))
{ {
case GST_MESSAGE_TAG: case GST_MESSAGE_TAG:
{ {
GstTagList *tags; GstTagList *tags;
gst_message_parse_tag(message, &tags); gst_message_parse_tag(message, &tags);
gst_tag_list_get_uint(tags, GST_TAG_TRACK_COUNT, &tracks_count); gst_tag_list_get_uint(tags, GST_TAG_TRACK_COUNT, &tracks_count);
if (tracks_count) done = TRUE; if (tracks_count) done = TRUE;
break; break;
} }
case GST_MESSAGE_ERROR: case GST_MESSAGE_ERROR:
default: default:
break; break;
} }
gst_message_unref(message); gst_message_unref(message);
} }
gst_object_unref(GST_OBJECT(bus)); gst_object_unref(GST_OBJECT(bus));
@ -488,44 +488,44 @@ emotion_visualization_element_name_get(Emotion_Vis visualisation)
switch (visualisation) switch (visualisation)
{ {
case EMOTION_VIS_NONE: case EMOTION_VIS_NONE:
return NULL; return NULL;
case EMOTION_VIS_GOOM: case EMOTION_VIS_GOOM:
return "goom"; return "goom";
case EMOTION_VIS_LIBVISUAL_BUMPSCOPE: case EMOTION_VIS_LIBVISUAL_BUMPSCOPE:
return "libvisual_bumpscope"; return "libvisual_bumpscope";
case EMOTION_VIS_LIBVISUAL_CORONA: case EMOTION_VIS_LIBVISUAL_CORONA:
return "libvisual_corona"; return "libvisual_corona";
case EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES: case EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES:
return "libvisual_dancingparticles"; return "libvisual_dancingparticles";
case EMOTION_VIS_LIBVISUAL_GDKPIXBUF: case EMOTION_VIS_LIBVISUAL_GDKPIXBUF:
return "libvisual_gdkpixbuf"; return "libvisual_gdkpixbuf";
case EMOTION_VIS_LIBVISUAL_G_FORCE: case EMOTION_VIS_LIBVISUAL_G_FORCE:
return "libvisual_G-Force"; return "libvisual_G-Force";
case EMOTION_VIS_LIBVISUAL_GOOM: case EMOTION_VIS_LIBVISUAL_GOOM:
return "libvisual_goom"; return "libvisual_goom";
case EMOTION_VIS_LIBVISUAL_INFINITE: case EMOTION_VIS_LIBVISUAL_INFINITE:
return "libvisual_infinite"; return "libvisual_infinite";
case EMOTION_VIS_LIBVISUAL_JAKDAW: case EMOTION_VIS_LIBVISUAL_JAKDAW:
return "libvisual_jakdaw"; return "libvisual_jakdaw";
case EMOTION_VIS_LIBVISUAL_JESS: case EMOTION_VIS_LIBVISUAL_JESS:
return "libvisual_jess"; return "libvisual_jess";
case EMOTION_VIS_LIBVISUAL_LV_ANALYSER: case EMOTION_VIS_LIBVISUAL_LV_ANALYSER:
return "libvisual_lv_analyzer"; return "libvisual_lv_analyzer";
case EMOTION_VIS_LIBVISUAL_LV_FLOWER: case EMOTION_VIS_LIBVISUAL_LV_FLOWER:
return "libvisual_lv_flower"; return "libvisual_lv_flower";
case EMOTION_VIS_LIBVISUAL_LV_GLTEST: case EMOTION_VIS_LIBVISUAL_LV_GLTEST:
return "libvisual_lv_gltest"; return "libvisual_lv_gltest";
case EMOTION_VIS_LIBVISUAL_LV_SCOPE: case EMOTION_VIS_LIBVISUAL_LV_SCOPE:
return "libvisual_lv_scope"; return "libvisual_lv_scope";
case EMOTION_VIS_LIBVISUAL_MADSPIN: case EMOTION_VIS_LIBVISUAL_MADSPIN:
return "libvisual_madspin"; return "libvisual_madspin";
case EMOTION_VIS_LIBVISUAL_NEBULUS: case EMOTION_VIS_LIBVISUAL_NEBULUS:
return "libvisual_nebulus"; return "libvisual_nebulus";
case EMOTION_VIS_LIBVISUAL_OINKSIE: case EMOTION_VIS_LIBVISUAL_OINKSIE:
return "libvisual_oinksie"; return "libvisual_oinksie";
case EMOTION_VIS_LIBVISUAL_PLASMA: case EMOTION_VIS_LIBVISUAL_PLASMA:
return "libvisual_plazma"; return "libvisual_plazma";
default: default:
return "goom"; return "goom";
} }
} }