diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2011-07-17 21:38:54 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2011-07-17 21:38:54 +0000 |
commit | dad10a507f2f1da8dee4ad358f29adca42e6c010 (patch) | |
tree | 98279ee3aa5d296d5e1452cd997fb733ad9a618d /legacy/emotion/src/lib/emotion_smart.c | |
parent | 1fdf2c67b5ee1c7f54bfb443b955b02adfb356eb (diff) |
emotion: add webcam detection, cleanup code and add timing detection.
SVN revision: 61452
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 128 |
1 files changed, 1 insertions, 127 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index fb32dfb85e..3c1f3afcdf 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -1156,52 +1156,6 @@ emotion_object_last_position_save(Evas_Object *obj) | |||
1156 | #endif | 1156 | #endif |
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | EAPI Eina_Bool | ||
1160 | emotion_object_extension_can_play_fast_get(const Evas_Object *obj, const char *file) | ||
1161 | { | ||
1162 | const Smart_Data *sd; | ||
1163 | |||
1164 | E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); | ||
1165 | if (!sd->module) return EINA_FALSE; | ||
1166 | if (!sd->video) return EINA_FALSE; | ||
1167 | if (!sd->module->can_play_get) return EINA_FALSE; | ||
1168 | return sd->module->can_play_get(sd->video, file); | ||
1169 | } | ||
1170 | |||
1171 | EAPI Eina_Bool | ||
1172 | emotion_object_extension_can_play_get(const Evas_Object *obj, const char *file) | ||
1173 | { | ||
1174 | const char *tmp; | ||
1175 | Eina_Bool result; | ||
1176 | |||
1177 | tmp = eina_stringshare_add(file); | ||
1178 | result = emotion_object_extension_can_play_fast_get(obj, tmp); | ||
1179 | eina_stringshare_del(tmp); | ||
1180 | |||
1181 | return result; | ||
1182 | } | ||
1183 | |||
1184 | EAPI Eina_Bool | ||
1185 | emotion_object_extension_may_play_fast_get(const char *file) | ||
1186 | { | ||
1187 | if (!file) return EINA_FALSE; | ||
1188 | return _emotion_object_extension_can_play_generic_get(NULL, file); | ||
1189 | } | ||
1190 | |||
1191 | EAPI Eina_Bool | ||
1192 | emotion_object_extension_may_play_get(const char *file) | ||
1193 | { | ||
1194 | const char *tmp; | ||
1195 | Eina_Bool result; | ||
1196 | |||
1197 | if (!file) return EINA_FALSE; | ||
1198 | tmp = eina_stringshare_add(file); | ||
1199 | result = emotion_object_extension_may_play_fast_get(tmp); | ||
1200 | eina_stringshare_del(tmp); | ||
1201 | |||
1202 | return result; | ||
1203 | } | ||
1204 | |||
1205 | EAPI void | 1159 | EAPI void |
1206 | emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state) | 1160 | emotion_object_suspend_set(Evas_Object *obj, Emotion_Suspend state) |
1207 | { | 1161 | { |
@@ -1238,87 +1192,6 @@ motion_object_suspend_get(Evas_Object *obj) | |||
1238 | /* Utility calls for modules */ | 1192 | /* Utility calls for modules */ |
1239 | /*****************************/ | 1193 | /*****************************/ |
1240 | 1194 | ||
1241 | struct ext_match_s | ||
1242 | { | ||
1243 | unsigned int length; | ||
1244 | const char *extension; | ||
1245 | }; | ||
1246 | |||
1247 | #define MATCHING(Ext) \ | ||
1248 | { sizeof (Ext), Ext } | ||
1249 | |||
1250 | static const struct ext_match_s matchs[] = | ||
1251 | { /* map extensions to know if it's a emotion playable content for good first-guess tries */ | ||
1252 | MATCHING(".264"), | ||
1253 | MATCHING(".3g2"), | ||
1254 | MATCHING(".3gp"), | ||
1255 | MATCHING(".3gp2"), | ||
1256 | MATCHING(".3gpp"), | ||
1257 | MATCHING(".3gpp2"), | ||
1258 | MATCHING(".3p2"), | ||
1259 | MATCHING(".asf"), | ||
1260 | MATCHING(".avi"), | ||
1261 | MATCHING(".bdm"), | ||
1262 | MATCHING(".bdmv"), | ||
1263 | MATCHING(".clpi"), | ||
1264 | MATCHING(".clp"), | ||
1265 | MATCHING(".fla"), | ||
1266 | MATCHING(".flv"), | ||
1267 | MATCHING(".m1v"), | ||
1268 | MATCHING(".m2v"), | ||
1269 | MATCHING(".m2t"), | ||
1270 | MATCHING(".m4v"), | ||
1271 | MATCHING(".mkv"), | ||
1272 | MATCHING(".mov"), | ||
1273 | MATCHING(".mp2"), | ||
1274 | MATCHING(".mp2ts"), | ||
1275 | MATCHING(".mp4"), | ||
1276 | MATCHING(".mpe"), | ||
1277 | MATCHING(".mpeg"), | ||
1278 | MATCHING(".mpg"), | ||
1279 | MATCHING(".mpl"), | ||
1280 | MATCHING(".mpls"), | ||
1281 | MATCHING(".mts"), | ||
1282 | MATCHING(".mxf"), | ||
1283 | MATCHING(".nut"), | ||
1284 | MATCHING(".nuv"), | ||
1285 | MATCHING(".ogg"), | ||
1286 | MATCHING(".ogm"), | ||
1287 | MATCHING(".ogv"), | ||
1288 | MATCHING(".rm"), | ||
1289 | MATCHING(".rmj"), | ||
1290 | MATCHING(".rmm"), | ||
1291 | MATCHING(".rms"), | ||
1292 | MATCHING(".rmx"), | ||
1293 | MATCHING(".rmvb"), | ||
1294 | MATCHING(".swf"), | ||
1295 | MATCHING(".ts"), | ||
1296 | MATCHING(".weba"), | ||
1297 | MATCHING(".webm"), | ||
1298 | MATCHING(".wmv") | ||
1299 | }; | ||
1300 | |||
1301 | EAPI Eina_Bool | ||
1302 | _emotion_object_extension_can_play_generic_get(const void *data __UNUSED__, const char *file) | ||
1303 | { | ||
1304 | unsigned int length; | ||
1305 | unsigned int i; | ||
1306 | |||
1307 | length = eina_stringshare_strlen(file) + 1; | ||
1308 | if (length < 5) return EINA_FALSE; | ||
1309 | |||
1310 | for (i = 0; i < sizeof (matchs) / sizeof (struct ext_match_s); ++i) | ||
1311 | { | ||
1312 | if (matchs[i].length > length) continue; | ||
1313 | |||
1314 | if (!strcasecmp(matchs[i].extension, | ||
1315 | file + length - matchs[i].length)) | ||
1316 | return EINA_TRUE; | ||
1317 | } | ||
1318 | |||
1319 | return EINA_FALSE; | ||
1320 | } | ||
1321 | |||
1322 | EAPI void * | 1195 | EAPI void * |
1323 | _emotion_video_get(const Evas_Object *obj) | 1196 | _emotion_video_get(const Evas_Object *obj) |
1324 | { | 1197 | { |
@@ -1880,3 +1753,4 @@ _emotion_image_get(const Evas_Object *obj) | |||
1880 | if (!sd) return NULL; | 1753 | if (!sd) return NULL; |
1881 | return sd->obj; | 1754 | return sd->obj; |
1882 | } | 1755 | } |
1756 | |||