efl/src/lib/emotion/efl_canvas_video_eo.legacy.h

61 lines
1.7 KiB
C
Raw Normal View History

#ifndef _EFL_CANVAS_VIDEO_EO_LEGACY_H_
#define _EFL_CANVAS_VIDEO_EO_LEGACY_H_
#ifndef _EFL_CANVAS_VIDEO_EO_CLASS_TYPE
#define _EFL_CANVAS_VIDEO_EO_CLASS_TYPE
typedef Eo Efl_Canvas_Video;
#endif
#ifndef _EFL_CANVAS_VIDEO_EO_TYPES
#define _EFL_CANVAS_VIDEO_EO_TYPES
#endif
/**
* @brief Set the specified option for the current module.
*
* This function allows one to mute the video or audio of the emotion object.
*
* Please don't use this function, consider using @ref Efl.Player.mute instead.
*
* @param[in] obj The object.
* @param[in] opt The option that is being set. Currently supported options:
* "video" and "audio".
* @param[in] val The value of the option. Currently only supports "off"
* (?!?!?!)
*
* @ingroup (null)_Group
*/
emotion: emotion EAPI macro to EMOTION_API in Emotion library Patch from a series of patches to rename EAPI symbols to specific library DSOs. EAPI was designed to be able to pass ```__attribute__ ((visibility ("default")))``` for symbols with GCC, which would mean that even if -fvisibility=hidden was used when compiling the library, the needed symbols would get exported. MSVC __almost__ works like GCC (or mingw) in which you can declare everything as export and it will just work (slower, but it will work). But there's a caveat: global variables will not work the same way for MSVC, but works for mingw and GCC. For global variables (as opposed to functions), MSVC requires correct DSO visibility for MSVC: instead of declaring a symbol as export for everything, you need to declare it as import when importing from another DSO and export when defining it locally. With current EAPI definitions, we get the following example working in mingw and MSVC (observe it doesn't define any global variables as exported symbols). Example 1: dll1: ``` EAPI void foo(void); EAPI void bar() { foo(); } ``` dll2: ``` EAPI void foo() { printf ("foo\n"); } ``` This works fine with API defined as __declspec(dllexport) in both cases and for gcc defining as ```__atttribute__((visibility("default")))```. However, the following: Example 2: dll1: ``` EAPI extern int foo; EAPI void foobar(void); EAPI void bar() { foo = 5; foobar(); } ``` dll2: ``` EAPI int foo = 0; EAPI void foobar() { printf ("foo %d\n", foo); } ``` This will work on mingw but will not work for MSVC. And that's why EAPI is the only solution that worked for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com> Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev> Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
2020-09-20 06:19:07 -07:00
EMOTION_API void emotion_object_module_option_set(Efl_Canvas_Video *obj, const char *opt, const char *val);
/**
* @brief Initializes an emotion object with the specified module.
*
* This function is required after creating the emotion object, in order to
* specify which module will be used with this object. Different objects can
* use different modules to play a media file. The current supported modules
* are gstreamer and xine.
*
* To use any of them, you need to make sure that support for them was compiled
* correctly.
*
* It's possible to disable the build of a module with --disable-module_name.
*
* See also @ref Efl.File.file.
*
* @param[in] obj The object.
* @param[in] module_filename The name of the module to be used (gstreamer or
* xine).
*
* @return @c true if the specified module was successfully initialized for
* this object, @c false otherwise.
*
* @ingroup (null)_Group
*/
emotion: emotion EAPI macro to EMOTION_API in Emotion library Patch from a series of patches to rename EAPI symbols to specific library DSOs. EAPI was designed to be able to pass ```__attribute__ ((visibility ("default")))``` for symbols with GCC, which would mean that even if -fvisibility=hidden was used when compiling the library, the needed symbols would get exported. MSVC __almost__ works like GCC (or mingw) in which you can declare everything as export and it will just work (slower, but it will work). But there's a caveat: global variables will not work the same way for MSVC, but works for mingw and GCC. For global variables (as opposed to functions), MSVC requires correct DSO visibility for MSVC: instead of declaring a symbol as export for everything, you need to declare it as import when importing from another DSO and export when defining it locally. With current EAPI definitions, we get the following example working in mingw and MSVC (observe it doesn't define any global variables as exported symbols). Example 1: dll1: ``` EAPI void foo(void); EAPI void bar() { foo(); } ``` dll2: ``` EAPI void foo() { printf ("foo\n"); } ``` This works fine with API defined as __declspec(dllexport) in both cases and for gcc defining as ```__atttribute__((visibility("default")))```. However, the following: Example 2: dll1: ``` EAPI extern int foo; EAPI void foobar(void); EAPI void bar() { foo = 5; foobar(); } ``` dll2: ``` EAPI int foo = 0; EAPI void foobar() { printf ("foo %d\n", foo); } ``` This will work on mingw but will not work for MSVC. And that's why EAPI is the only solution that worked for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com> Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev> Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
2020-09-20 06:19:07 -07:00
EMOTION_API Eina_Bool emotion_object_init(Efl_Canvas_Video *obj, const char *module_filename);
#endif