forked from enlightenment/efl
efl/emotion: move module stuff.
* do not abuse emotion_private.h by using that in modules * split emotion_module.c to allow more changes later. SVN revision: 82592
This commit is contained in:
parent
d1341cc826
commit
8a4248732a
|
@ -47,9 +47,11 @@ dist_installed_emotionmainheaders_DATA = lib/emotion/Emotion.h
|
|||
|
||||
# libemotion.la
|
||||
lib_emotion_libemotion_la_SOURCES = \
|
||||
lib/emotion/Emotion_Module.h \
|
||||
lib/emotion/emotion_private.h \
|
||||
lib/emotion/emotion_smart.c \
|
||||
lib/emotion/emotion_webcam.c \
|
||||
lib/emotion/emotion_modules.c \
|
||||
lib/emotion/emotion_main.c
|
||||
|
||||
EMOTION_COMMON_LIBADD = $(EMOTION_COMMON_LDADD) @EMOTION_LIBS@
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
#ifndef _EMOTION_MODULE_H_
|
||||
#define _EMOTION_MODULE_H_ 1
|
||||
|
||||
#include "Emotion.h"
|
||||
|
||||
#define META_TRACK_TITLE 1
|
||||
#define META_TRACK_ARTIST 2
|
||||
#define META_TRACK_GENRE 3
|
||||
#define META_TRACK_COMMENT 4
|
||||
#define META_TRACK_ALBUM 5
|
||||
#define META_TRACK_YEAR 6
|
||||
#define META_TRACK_DISCID 7
|
||||
#define META_TRACK_COUNT 8
|
||||
|
||||
typedef enum _Emotion_Format Emotion_Format;
|
||||
typedef struct _Emotion_Video_Module Emotion_Video_Module;
|
||||
typedef struct _Emotion_Module_Options Emotion_Module_Options;
|
||||
typedef struct _Eina_Emotion_Plugins Eina_Emotion_Plugins;
|
||||
|
||||
typedef Eina_Bool (*Emotion_Module_Open)(Evas_Object *, const Emotion_Video_Module **, void **, Emotion_Module_Options *);
|
||||
typedef void (*Emotion_Module_Close)(Emotion_Video_Module *module, void *);
|
||||
|
||||
enum _Emotion_Format
|
||||
{
|
||||
EMOTION_FORMAT_NONE,
|
||||
EMOTION_FORMAT_I420,
|
||||
EMOTION_FORMAT_YV12,
|
||||
EMOTION_FORMAT_YUY2, /* unused for now since evas does not support yuy2 format */
|
||||
EMOTION_FORMAT_BGRA
|
||||
};
|
||||
|
||||
struct _Emotion_Module_Options
|
||||
{
|
||||
const char *player;
|
||||
Eina_Bool no_video : 1;
|
||||
Eina_Bool no_audio : 1;
|
||||
};
|
||||
|
||||
struct _Eina_Emotion_Plugins
|
||||
{
|
||||
Emotion_Module_Open open;
|
||||
Emotion_Module_Close close;
|
||||
};
|
||||
|
||||
struct _Emotion_Video_Module
|
||||
{
|
||||
unsigned char (*init) (Evas_Object *obj, void **video, Emotion_Module_Options *opt);
|
||||
int (*shutdown) (void *video);
|
||||
unsigned char (*file_open) (const char *file, Evas_Object *obj, void *video);
|
||||
void (*file_close) (void *ef);
|
||||
void (*play) (void *ef, double pos);
|
||||
void (*stop) (void *ef);
|
||||
void (*size_get) (void *ef, int *w, int *h);
|
||||
void (*pos_set) (void *ef, double pos);
|
||||
double (*len_get) (void *ef);
|
||||
double (*buffer_size_get) (void *ef);
|
||||
int (*fps_num_get) (void *ef);
|
||||
int (*fps_den_get) (void *ef);
|
||||
double (*fps_get) (void *ef);
|
||||
double (*pos_get) (void *ef);
|
||||
void (*vis_set) (void *ef, Emotion_Vis vis);
|
||||
Emotion_Vis (*vis_get) (void *ef);
|
||||
Eina_Bool (*vis_supported) (void *ef, Emotion_Vis vis);
|
||||
double (*ratio_get) (void *ef);
|
||||
int (*video_handled) (void *ef);
|
||||
int (*audio_handled) (void *ef);
|
||||
int (*seekable) (void *ef);
|
||||
void (*frame_done) (void *ef);
|
||||
Emotion_Format (*format_get) (void *ef);
|
||||
void (*video_data_size_get) (void *ef, int *w, int *h);
|
||||
int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
|
||||
int (*bgra_data_get) (void *ef, unsigned char **bgra_data);
|
||||
void (*event_feed) (void *ef, int event);
|
||||
void (*event_mouse_button_feed) (void *ef, int button, int x, int y);
|
||||
void (*event_mouse_move_feed) (void *ef, int x, int y);
|
||||
int (*video_channel_count) (void *ef);
|
||||
void (*video_channel_set) (void *ef, int channel);
|
||||
int (*video_channel_get) (void *ef);
|
||||
void (*video_subtitle_file_set) (void *ef, const char *filepath);
|
||||
const char * (*video_subtitle_file_get) (void *ef);
|
||||
const char * (*video_channel_name_get) (void *ef, int channel);
|
||||
void (*video_channel_mute_set) (void *ef, int mute);
|
||||
int (*video_channel_mute_get) (void *ef);
|
||||
int (*audio_channel_count) (void *ef);
|
||||
void (*audio_channel_set) (void *ef, int channel);
|
||||
int (*audio_channel_get) (void *ef);
|
||||
const char * (*audio_channel_name_get) (void *ef, int channel);
|
||||
void (*audio_channel_mute_set) (void *ef, int mute);
|
||||
int (*audio_channel_mute_get) (void *ef);
|
||||
void (*audio_channel_volume_set) (void *ef, double vol);
|
||||
double (*audio_channel_volume_get) (void *ef);
|
||||
int (*spu_channel_count) (void *ef);
|
||||
void (*spu_channel_set) (void *ef, int channel);
|
||||
int (*spu_channel_get) (void *ef);
|
||||
const char * (*spu_channel_name_get) (void *ef, int channel);
|
||||
void (*spu_channel_mute_set) (void *ef, int mute);
|
||||
int (*spu_channel_mute_get) (void *ef);
|
||||
int (*chapter_count) (void *ef);
|
||||
void (*chapter_set) (void *ef, int chapter);
|
||||
int (*chapter_get) (void *ef);
|
||||
const char * (*chapter_name_get) (void *ef, int chapter);
|
||||
void (*speed_set) (void *ef, double speed);
|
||||
double (*speed_get) (void *ef);
|
||||
int (*eject) (void *ef);
|
||||
const char * (*meta_get) (void *ef, int meta);
|
||||
void (*priority_set) (void *ef, Eina_Bool priority);
|
||||
Eina_Bool (*priority_get) (void *ef);
|
||||
|
||||
Eina_Emotion_Plugins *plugin;
|
||||
};
|
||||
|
||||
EAPI void *_emotion_video_get(const Evas_Object *obj);
|
||||
EAPI void _emotion_frame_new(Evas_Object *obj);
|
||||
EAPI void _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
|
||||
EAPI void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
|
||||
EAPI void _emotion_frame_refill(Evas_Object *obj, double w, double h);
|
||||
EAPI void _emotion_decode_stop(Evas_Object *obj);
|
||||
EAPI void _emotion_open_done(Evas_Object *obj);
|
||||
EAPI void _emotion_playback_started(Evas_Object *obj);
|
||||
EAPI void _emotion_playback_finished(Evas_Object *obj);
|
||||
EAPI void _emotion_audio_level_change(Evas_Object *obj);
|
||||
EAPI void _emotion_channels_change(Evas_Object *obj);
|
||||
EAPI void _emotion_title_set(Evas_Object *obj, char *title);
|
||||
EAPI void _emotion_progress_set(Evas_Object *obj, char *info, double stat);
|
||||
EAPI void _emotion_file_ref_set(Evas_Object *obj, const char *file, int num);
|
||||
EAPI void _emotion_spu_button_num_set(Evas_Object *obj, int num);
|
||||
EAPI void _emotion_spu_button_set(Evas_Object *obj, int button);
|
||||
EAPI void _emotion_seek_done(Evas_Object *obj);
|
||||
EAPI void _emotion_image_reset(Evas_Object *obj);
|
||||
|
||||
EAPI void _emotion_pending_object_ref(void);
|
||||
EAPI void _emotion_pending_object_unref(void);
|
||||
|
||||
EAPI const char *emotion_webcam_custom_get(const char *device);
|
||||
|
||||
EAPI Eina_Bool _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close);
|
||||
EAPI Eina_Bool _emotion_module_unregister(const char *name);
|
||||
|
||||
#endif
|
|
@ -17,26 +17,11 @@
|
|||
|
||||
#include "emotion_private.h"
|
||||
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
Eina_Bool xine_module_init(void);
|
||||
void xine_module_shutdown(void);
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
Eina_Bool gstreamer_module_init(void);
|
||||
void gstreamer_module_shutdown(void);
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
Eina_Bool generic_module_init(void);
|
||||
void generic_module_shutdown(void);
|
||||
#endif
|
||||
|
||||
static Emotion_Version _version = { VMAJ, VMIN, VMIC, VREV };
|
||||
static int emotion_pending_objects = 0;
|
||||
EAPI Emotion_Version *emotion_version = &_version;
|
||||
|
||||
static Eina_Prefix *pfx = NULL;
|
||||
Eina_Hash *_emotion_backends = NULL;
|
||||
Eina_Array *_emotion_modules = NULL;
|
||||
Eina_Prefix *_emotion_pfx = NULL;
|
||||
int _emotion_log_domain = -1;
|
||||
|
||||
static Eet_File *_emotion_config_file = NULL;
|
||||
|
@ -146,66 +131,10 @@ emotion_object_extension_may_play_get(const char *file)
|
|||
static int _emotion_init_count = 0;
|
||||
|
||||
|
||||
static void
|
||||
_emotion_modules_init(void)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
char *path;
|
||||
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
struct stat st;
|
||||
snprintf(buf, sizeof(buf), "%s/src/modules/emotion",
|
||||
PACKAGE_BUILD_DIR);
|
||||
if (stat(buf, &st) == 0)
|
||||
{
|
||||
const char *built_modules[] = {
|
||||
#ifdef EMOTION_BUILD_GSTREAMER
|
||||
"gstreamer",
|
||||
#endif
|
||||
#ifdef EMOTION_BUILD_XINE
|
||||
"xine",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
const char **itr;
|
||||
for (itr = built_modules; *itr != NULL; itr++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%s/src/modules/emotion/%s/.libs",
|
||||
PACKAGE_BUILD_DIR, *itr);
|
||||
_emotion_modules = eina_module_list_get(_emotion_modules, buf,
|
||||
EINA_FALSE, NULL, NULL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
path = eina_module_environment_path_get("EMOTION_MODULES_DIR",
|
||||
"/emotion/modules");
|
||||
if (path)
|
||||
{
|
||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
|
||||
free(path);
|
||||
}
|
||||
|
||||
path = eina_module_environment_path_get("HOME", "/.emotion");
|
||||
if (path)
|
||||
{
|
||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
|
||||
free(path);
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/emotion/modules", eina_prefix_lib_get(pfx));
|
||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, buf, MODULE_ARCH);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
emotion_init(void)
|
||||
{
|
||||
char buffer[PATH_MAX];
|
||||
int static_modules = 0;
|
||||
|
||||
if (_emotion_init_count > 0)
|
||||
{
|
||||
|
@ -223,68 +152,33 @@ emotion_init(void)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
pfx = eina_prefix_new(NULL, emotion_init,
|
||||
"EMOTION", "emotion", "checkme",
|
||||
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
|
||||
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
|
||||
EINA_SAFETY_ON_NULL_GOTO(pfx, error);
|
||||
_emotion_pfx = eina_prefix_new(NULL, emotion_init,
|
||||
"EMOTION", "emotion", "checkme",
|
||||
PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
|
||||
PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
|
||||
EINA_SAFETY_ON_NULL_GOTO(_emotion_pfx, error);
|
||||
|
||||
_emotion_backends = eina_hash_string_small_new(free);
|
||||
EINA_SAFETY_ON_NULL_GOTO(_emotion_backends, error_hash);
|
||||
|
||||
_emotion_modules_init();
|
||||
|
||||
/* Init static module */
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
static_modules += xine_module_init();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
static_modules += gstreamer_module_init();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
static_modules += generic_module_init();
|
||||
#endif
|
||||
|
||||
if ((!_emotion_modules) && (!static_modules))
|
||||
WRN("No emotion modules found!");
|
||||
else if (_emotion_modules)
|
||||
eina_module_list_load(_emotion_modules);
|
||||
|
||||
ecore_init();
|
||||
eet_init();
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s/emotion.cfg", eina_prefix_data_get(pfx));
|
||||
snprintf(buffer, sizeof(buffer), "%s/emotion.cfg",
|
||||
eina_prefix_data_get(_emotion_pfx));
|
||||
_emotion_config_file = eet_open(buffer, EET_FILE_MODE_READ);
|
||||
|
||||
emotion_webcam_init();
|
||||
emotion_webcam_config_load(_emotion_config_file);
|
||||
|
||||
emotion_modules_init();
|
||||
|
||||
_emotion_init_count = 1;
|
||||
return EINA_TRUE;
|
||||
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
xine_module_shutdown();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
gstreamer_module_shutdown();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
generic_module_shutdown();
|
||||
#endif
|
||||
|
||||
if (_emotion_modules)
|
||||
{
|
||||
eina_module_list_free(_emotion_modules);
|
||||
eina_array_free(_emotion_modules);
|
||||
_emotion_modules = NULL;
|
||||
}
|
||||
|
||||
eina_hash_free(_emotion_backends);
|
||||
_emotion_backends = NULL;
|
||||
|
||||
error_hash:
|
||||
eina_prefix_free(pfx);
|
||||
pfx = NULL;
|
||||
eina_prefix_free(_emotion_pfx);
|
||||
_emotion_pfx = NULL;
|
||||
|
||||
error:
|
||||
eina_log_domain_unregister(_emotion_log_domain);
|
||||
|
@ -306,8 +200,9 @@ emotion_shutdown(void)
|
|||
}
|
||||
if (--_emotion_init_count) return EINA_TRUE;
|
||||
|
||||
emotion_webcam_shutdown();
|
||||
emotion_modules_shutdown();
|
||||
|
||||
emotion_webcam_shutdown();
|
||||
|
||||
if (_emotion_config_file)
|
||||
{
|
||||
|
@ -328,28 +223,8 @@ emotion_shutdown(void)
|
|||
eet_shutdown();
|
||||
ecore_shutdown();
|
||||
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
xine_module_shutdown();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
gstreamer_module_shutdown();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
generic_module_shutdown();
|
||||
#endif
|
||||
|
||||
if (_emotion_modules)
|
||||
{
|
||||
eina_module_list_free(_emotion_modules);
|
||||
eina_array_free(_emotion_modules);
|
||||
_emotion_modules = NULL;
|
||||
}
|
||||
|
||||
eina_hash_free(_emotion_backends);
|
||||
_emotion_backends = NULL;
|
||||
|
||||
eina_prefix_free(pfx);
|
||||
pfx = NULL;
|
||||
eina_prefix_free(_emotion_pfx);
|
||||
_emotion_pfx = NULL;
|
||||
|
||||
eina_log_domain_unregister(_emotion_log_domain);
|
||||
_emotion_log_domain = -1;
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "emotion_private.h"
|
||||
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
Eina_Bool xine_module_init(void);
|
||||
void xine_module_shutdown(void);
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
Eina_Bool gstreamer_module_init(void);
|
||||
void gstreamer_module_shutdown(void);
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
Eina_Bool generic_module_init(void);
|
||||
void generic_module_shutdown(void);
|
||||
#endif
|
||||
|
||||
Eina_Hash *_emotion_backends = NULL;
|
||||
Eina_Array *_emotion_modules = NULL;
|
||||
|
||||
static void
|
||||
_emotion_modules_load(void)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
char *path;
|
||||
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
struct stat st;
|
||||
snprintf(buf, sizeof(buf), "%s/src/modules/emotion",
|
||||
PACKAGE_BUILD_DIR);
|
||||
if (stat(buf, &st) == 0)
|
||||
{
|
||||
const char *built_modules[] = {
|
||||
#ifdef EMOTION_BUILD_GSTREAMER
|
||||
"gstreamer",
|
||||
#endif
|
||||
#ifdef EMOTION_BUILD_XINE
|
||||
"xine",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
const char **itr;
|
||||
for (itr = built_modules; *itr != NULL; itr++)
|
||||
{
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%s/src/modules/emotion/%s/.libs",
|
||||
PACKAGE_BUILD_DIR, *itr);
|
||||
_emotion_modules = eina_module_list_get(_emotion_modules, buf,
|
||||
EINA_FALSE, NULL, NULL);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
path = eina_module_environment_path_get("EMOTION_MODULES_DIR",
|
||||
"/emotion/modules");
|
||||
if (path)
|
||||
{
|
||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
|
||||
free(path);
|
||||
}
|
||||
|
||||
path = eina_module_environment_path_get("HOME", "/.emotion");
|
||||
if (path)
|
||||
{
|
||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, path, MODULE_ARCH);
|
||||
free(path);
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/emotion/modules", eina_prefix_lib_get(_emotion_pfx));
|
||||
_emotion_modules = eina_module_arch_list_get(_emotion_modules, buf, MODULE_ARCH);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
emotion_modules_init(void)
|
||||
{
|
||||
int static_modules = 0;
|
||||
|
||||
_emotion_modules_load();
|
||||
|
||||
/* Init static module */
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
static_modules += xine_module_init();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
static_modules += gstreamer_module_init();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
static_modules += generic_module_init();
|
||||
#endif
|
||||
|
||||
if ((!_emotion_modules) && (!static_modules))
|
||||
WRN("No emotion modules found!");
|
||||
else if (_emotion_modules)
|
||||
eina_module_list_load(_emotion_modules);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
emotion_modules_shutdown(void)
|
||||
{
|
||||
#ifdef EMOTION_STATIC_BUILD_XINE
|
||||
xine_module_shutdown();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GSTREAMER
|
||||
gstreamer_module_shutdown();
|
||||
#endif
|
||||
#ifdef EMOTION_STATIC_BUILD_GENERIC
|
||||
generic_module_shutdown();
|
||||
#endif
|
||||
|
||||
if (_emotion_modules)
|
||||
{
|
||||
eina_module_list_free(_emotion_modules);
|
||||
eina_array_free(_emotion_modules);
|
||||
_emotion_modules = NULL;
|
||||
}
|
||||
|
||||
eina_hash_free(_emotion_backends);
|
||||
_emotion_backends = NULL;
|
||||
}
|
|
@ -1,15 +1,6 @@
|
|||
#ifndef EMOTION_PRIVATE_H
|
||||
#define EMOTION_PRIVATE_H
|
||||
|
||||
#define META_TRACK_TITLE 1
|
||||
#define META_TRACK_ARTIST 2
|
||||
#define META_TRACK_GENRE 3
|
||||
#define META_TRACK_COMMENT 4
|
||||
#define META_TRACK_ALBUM 5
|
||||
#define META_TRACK_YEAR 6
|
||||
#define META_TRACK_DISCID 7
|
||||
#define META_TRACK_COUNT 8
|
||||
|
||||
#include <Evas.h>
|
||||
#include <Eet.h>
|
||||
#include "Emotion.h"
|
||||
|
@ -18,133 +9,13 @@ Eina_Bool emotion_webcam_init(void);
|
|||
void emotion_webcam_shutdown(void);
|
||||
Eina_Bool emotion_webcam_config_load(Eet_File *ef);
|
||||
|
||||
typedef enum _Emotion_Format Emotion_Format;
|
||||
typedef struct _Emotion_Video_Module Emotion_Video_Module;
|
||||
typedef struct _Emotion_Module_Options Emotion_Module_Options;
|
||||
typedef struct _Eina_Emotion_Plugins Eina_Emotion_Plugins;
|
||||
|
||||
typedef Eina_Bool (*Emotion_Module_Open)(Evas_Object *, const Emotion_Video_Module **, void **, Emotion_Module_Options *);
|
||||
typedef void (*Emotion_Module_Close)(Emotion_Video_Module *module, void *);
|
||||
|
||||
enum _Emotion_Format
|
||||
{
|
||||
EMOTION_FORMAT_NONE,
|
||||
EMOTION_FORMAT_I420,
|
||||
EMOTION_FORMAT_YV12,
|
||||
EMOTION_FORMAT_YUY2, /* unused for now since evas does not support yuy2 format */
|
||||
EMOTION_FORMAT_BGRA
|
||||
};
|
||||
|
||||
struct _Emotion_Module_Options
|
||||
{
|
||||
const char *player;
|
||||
Eina_Bool no_video : 1;
|
||||
Eina_Bool no_audio : 1;
|
||||
};
|
||||
|
||||
struct _Eina_Emotion_Plugins
|
||||
{
|
||||
Emotion_Module_Open open;
|
||||
Emotion_Module_Close close;
|
||||
};
|
||||
|
||||
struct _Emotion_Video_Module
|
||||
{
|
||||
unsigned char (*init) (Evas_Object *obj, void **video, Emotion_Module_Options *opt);
|
||||
int (*shutdown) (void *video);
|
||||
unsigned char (*file_open) (const char *file, Evas_Object *obj, void *video);
|
||||
void (*file_close) (void *ef);
|
||||
void (*play) (void *ef, double pos);
|
||||
void (*stop) (void *ef);
|
||||
void (*size_get) (void *ef, int *w, int *h);
|
||||
void (*pos_set) (void *ef, double pos);
|
||||
double (*len_get) (void *ef);
|
||||
double (*buffer_size_get) (void *ef);
|
||||
int (*fps_num_get) (void *ef);
|
||||
int (*fps_den_get) (void *ef);
|
||||
double (*fps_get) (void *ef);
|
||||
double (*pos_get) (void *ef);
|
||||
void (*vis_set) (void *ef, Emotion_Vis vis);
|
||||
Emotion_Vis (*vis_get) (void *ef);
|
||||
Eina_Bool (*vis_supported) (void *ef, Emotion_Vis vis);
|
||||
double (*ratio_get) (void *ef);
|
||||
int (*video_handled) (void *ef);
|
||||
int (*audio_handled) (void *ef);
|
||||
int (*seekable) (void *ef);
|
||||
void (*frame_done) (void *ef);
|
||||
Emotion_Format (*format_get) (void *ef);
|
||||
void (*video_data_size_get) (void *ef, int *w, int *h);
|
||||
int (*yuv_rows_get) (void *ef, int w, int h, unsigned char **yrows, unsigned char **urows, unsigned char **vrows);
|
||||
int (*bgra_data_get) (void *ef, unsigned char **bgra_data);
|
||||
void (*event_feed) (void *ef, int event);
|
||||
void (*event_mouse_button_feed) (void *ef, int button, int x, int y);
|
||||
void (*event_mouse_move_feed) (void *ef, int x, int y);
|
||||
int (*video_channel_count) (void *ef);
|
||||
void (*video_channel_set) (void *ef, int channel);
|
||||
int (*video_channel_get) (void *ef);
|
||||
void (*video_subtitle_file_set) (void *ef, const char *filepath);
|
||||
const char * (*video_subtitle_file_get) (void *ef);
|
||||
const char * (*video_channel_name_get) (void *ef, int channel);
|
||||
void (*video_channel_mute_set) (void *ef, int mute);
|
||||
int (*video_channel_mute_get) (void *ef);
|
||||
int (*audio_channel_count) (void *ef);
|
||||
void (*audio_channel_set) (void *ef, int channel);
|
||||
int (*audio_channel_get) (void *ef);
|
||||
const char * (*audio_channel_name_get) (void *ef, int channel);
|
||||
void (*audio_channel_mute_set) (void *ef, int mute);
|
||||
int (*audio_channel_mute_get) (void *ef);
|
||||
void (*audio_channel_volume_set) (void *ef, double vol);
|
||||
double (*audio_channel_volume_get) (void *ef);
|
||||
int (*spu_channel_count) (void *ef);
|
||||
void (*spu_channel_set) (void *ef, int channel);
|
||||
int (*spu_channel_get) (void *ef);
|
||||
const char * (*spu_channel_name_get) (void *ef, int channel);
|
||||
void (*spu_channel_mute_set) (void *ef, int mute);
|
||||
int (*spu_channel_mute_get) (void *ef);
|
||||
int (*chapter_count) (void *ef);
|
||||
void (*chapter_set) (void *ef, int chapter);
|
||||
int (*chapter_get) (void *ef);
|
||||
const char * (*chapter_name_get) (void *ef, int chapter);
|
||||
void (*speed_set) (void *ef, double speed);
|
||||
double (*speed_get) (void *ef);
|
||||
int (*eject) (void *ef);
|
||||
const char * (*meta_get) (void *ef, int meta);
|
||||
void (*priority_set) (void *ef, Eina_Bool priority);
|
||||
Eina_Bool (*priority_get) (void *ef);
|
||||
|
||||
Eina_Emotion_Plugins *plugin;
|
||||
};
|
||||
|
||||
EAPI void *_emotion_video_get(const Evas_Object *obj);
|
||||
EAPI void _emotion_frame_new(Evas_Object *obj);
|
||||
EAPI void _emotion_video_pos_update(Evas_Object *obj, double pos, double len);
|
||||
EAPI void _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio);
|
||||
EAPI void _emotion_frame_refill(Evas_Object *obj, double w, double h);
|
||||
EAPI void _emotion_decode_stop(Evas_Object *obj);
|
||||
EAPI void _emotion_open_done(Evas_Object *obj);
|
||||
EAPI void _emotion_playback_started(Evas_Object *obj);
|
||||
EAPI void _emotion_playback_finished(Evas_Object *obj);
|
||||
EAPI void _emotion_audio_level_change(Evas_Object *obj);
|
||||
EAPI void _emotion_channels_change(Evas_Object *obj);
|
||||
EAPI void _emotion_title_set(Evas_Object *obj, char *title);
|
||||
EAPI void _emotion_progress_set(Evas_Object *obj, char *info, double stat);
|
||||
EAPI void _emotion_file_ref_set(Evas_Object *obj, const char *file, int num);
|
||||
EAPI void _emotion_spu_button_num_set(Evas_Object *obj, int num);
|
||||
EAPI void _emotion_spu_button_set(Evas_Object *obj, int button);
|
||||
EAPI void _emotion_seek_done(Evas_Object *obj);
|
||||
EAPI void _emotion_image_reset(Evas_Object *obj);
|
||||
|
||||
EAPI Eina_Bool _emotion_module_register(const char *name, Emotion_Module_Open open, Emotion_Module_Close close);
|
||||
EAPI Eina_Bool _emotion_module_unregister(const char *name);
|
||||
|
||||
EAPI const char *emotion_webcam_custom_get(const char *device);
|
||||
|
||||
EAPI void _emotion_pending_object_ref(void);
|
||||
EAPI void _emotion_pending_object_unref(void);
|
||||
Eina_Bool emotion_modules_init(void);
|
||||
void emotion_modules_shutdown(void);
|
||||
|
||||
extern Eina_Hash *_emotion_backends;
|
||||
extern Eina_Array *_emotion_modules;
|
||||
extern int _emotion_log_domain;
|
||||
extern Eina_Prefix *_emotion_pfx;
|
||||
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_emotion_log_domain, __VA_ARGS__)
|
||||
#define INF(...) EINA_LOG_DOM_INFO(_emotion_log_domain, __VA_ARGS__)
|
||||
|
@ -152,4 +23,6 @@ extern int _emotion_log_domain;
|
|||
#define ERR(...) EINA_LOG_DOM_ERR(_emotion_log_domain, __VA_ARGS__)
|
||||
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_emotion_log_domain, __VA_ARGS__)
|
||||
|
||||
#include "Emotion_Module.h"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
#include <Evas.h>
|
||||
#include <Ecore.h>
|
||||
|
||||
#include "Emotion.h"
|
||||
#include "emotion_private.h"
|
||||
#include "Emotion_Module.h"
|
||||
#include "emotion_generic.h"
|
||||
|
||||
static Eina_Prefix *pfx = NULL;
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#include "Emotion.h"
|
||||
#include "emotion_private.h"
|
||||
#include "Emotion_Module.h"
|
||||
#include "emotion_gstreamer.h"
|
||||
|
||||
Eina_Bool window_manager_video = EINA_FALSE;
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#include "Emotion.h"
|
||||
#include "emotion_private.h"
|
||||
#include "Emotion_Module.h"
|
||||
#include "emotion_gstreamer.h"
|
||||
|
||||
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE("sink",
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
#include <Evas.h>
|
||||
#include <Ecore.h>
|
||||
|
||||
#include "Emotion.h"
|
||||
#include "emotion_private.h"
|
||||
#include "Emotion_Module.h"
|
||||
#include "emotion_xine.h"
|
||||
|
||||
int _emotion_xine_log_domain = -1;
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
#include <Evas.h>
|
||||
#include <Ecore.h>
|
||||
|
||||
#include "Emotion.h"
|
||||
#include "emotion_private.h"
|
||||
#include "Emotion_Module.h"
|
||||
#include "emotion_xine.h"
|
||||
|
||||
#include <xine.h>
|
||||
|
|
Loading…
Reference in New Issue