From 2fbe558cca2fc1e6d3983a51508aee83b1c243e8 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Tue, 21 Feb 2012 05:52:55 +0000 Subject: [PATCH] Deprecate elm_video_uri_set(). Signed-off-by: Sanjeev BA git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68200 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/edje_externals/elm_video.c | 4 ++-- src/lib/elm_deprecated.h | 17 +++++++++++++++++ src/lib/elm_video.c | 7 +++++-- src/lib/elm_video.h | 36 ++++++++++-------------------------- 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/edje_externals/elm_video.c b/src/edje_externals/elm_video.c index 41c9192..e869afe 100644 --- a/src/edje_externals/elm_video.c +++ b/src/edje_externals/elm_video.c @@ -31,7 +31,7 @@ external_video_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fr else return; if (p->file) elm_video_file_set(obj, p->file); - if (p->uri) elm_video_uri_set(obj, p->uri); + if (p->uri) elm_video_file_set(obj, p->uri); if (p->play_exists && p->play) elm_video_play(obj); if (p->pause_exists && p->pause) elm_video_pause(obj); if (p->stop_exists && p->stop) elm_video_stop(obj); @@ -55,7 +55,7 @@ external_video_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ext else if ((param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) && (!strcmp(param->name, "uri"))) { - elm_video_uri_set(obj, param->s); + elm_video_file_set(obj, param->s); return EINA_TRUE; } else if ((param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h index 54a6e79..ef6ab77 100644 --- a/src/lib/elm_deprecated.h +++ b/src/lib/elm_deprecated.h @@ -4490,6 +4490,23 @@ EINA_DEPRECATED EAPI void elm_label_background_color_set( */ EINA_DEPRECATED EAPI void elm_all_flush(void); + +/** + * @brief Define the uri that will be the video source. + * + * @param video The video object to define the file for. + * @param uri The uri to target. + * + * This function will define an uri as a source for the video of the + * Elm_Video object. URI could be remote source of video, like http:// or local + * like for example WebCam who are most of the time v4l2:// (but that depend an + * you should use Emotion API to request and list the available Webcam on your + * + * @deprecated Use elm_video_file_set() instead. + * + */ +EINA_DEPRECATED EAPI void elm_video_uri_set(Evas_Object *video, const char *uri); + /** * @} */ diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c index cb90a85..de85ced 100644 --- a/src/lib/elm_video.c +++ b/src/lib/elm_video.c @@ -320,7 +320,10 @@ elm_video_file_set(Evas_Object *video, const char *filename) if (wd->remember) emotion_object_last_position_save(wd->emotion); wd->stop = EINA_FALSE; emotion_object_file_set(wd->emotion, filename); - emotion_object_last_position_load(wd->emotion); + + if ((!strncmp(filename, "file://", 7)) || (!strstr(filename, "://"))) + emotion_object_last_position_load(wd->emotion); + edje_object_signal_emit(wd->layout, "elm,video,load", "elm"); #else (void) video; @@ -328,7 +331,7 @@ elm_video_file_set(Evas_Object *video, const char *filename) #endif } -EAPI void +EINA_DEPRECATED EAPI void elm_video_uri_set(Evas_Object *video, const char *uri) { #ifdef HAVE_EMOTION diff --git a/src/lib/elm_video.h b/src/lib/elm_video.h index 44c7684..acc2f77 100644 --- a/src/lib/elm_video.h +++ b/src/lib/elm_video.h @@ -58,22 +58,26 @@ EAPI Evas_Object *elm_player_add(Evas_Object *parent); * This function inserts a new video widget on the canvas. * * @see elm_video_file_set() - * @see elm_video_uri_set() * * @ingroup Video */ EAPI Evas_Object *elm_video_add(Evas_Object *parent); /** - * @brief Define the file that will be the video source. + * @brief Define the file or URI that will be the video source. * - * @param video The video object to define the file for. - * @param filename The file to target. + * @param video The video object to define the file or URI for the video + * of the Elm_Video object. * - * This function will explicitly define a filename as a source + * @param filename The file or URI to target. + * Local files can be specified using file:// or by using full file paths. + * URI could be remote source of video, like http:// or local source like + * WebCam (v4l2://). (You can use Emotion API to request and list + * the available Webcam on your system). + * + * This function will explicitly define a file or URI as a source * for the video of the Elm_Video object. * - * @see elm_video_uri_set() * @see elm_video_add() * @see elm_player_add() * @@ -82,26 +86,6 @@ EAPI Evas_Object *elm_video_add(Evas_Object *parent); EAPI void elm_video_file_set(Evas_Object *video, const char *filename); /** - * @brief Define the uri that will be the video source. - * - * @param video The video object to define the file for. - * @param uri The uri to target. - * - * This function will define an uri as a source for the video of the - * Elm_Video object. URI could be remote source of video, like http:// or local source - * like for example WebCam who are most of the time v4l2:// (but that depend and - * you should use Emotion API to request and list the available Webcam on your system). - * - * @see elm_video_file_set() - * @see elm_video_add() - * @see elm_player_add() - * - * @ingroup Video - */ -/* XXX: remove this - just keep elm_video_file_set() */ -EAPI void elm_video_uri_set(Evas_Object *video, const char *uri); - -/** * @brief Get the underlying Emotion object. * * @param video The video object to proceed the request on. -- 2.7.4