add lowquality option for video

This commit is contained in:
Carsten Haitzler 2014-01-28 14:52:03 +09:00
parent b8be71db0c
commit f3418a540d
4 changed files with 29 additions and 3 deletions

1
TODO
View File

@ -16,5 +16,4 @@
* add subtitle file cmdline
* loop all option
* show busy anim until opened cb or failure
* quality option (smooth)
* add button/control top-left next to audio to do fullscreen/normal toggle

View File

@ -164,6 +164,10 @@ key_handle(Evas_Object *win, Evas_Event_Key_Down *ev)
video_ratio_size_get(inf->vid, &w, &h);
if ((w > 1) && (h > 1)) evas_object_resize(win, w, h);
}
else if (!strcmp(ev->keyname, "y"))
{
video_lowquality_set(inf->vid, !video_lowquality_get(inf->vid));
}
else if (!strcmp(ev->keyname, "z"))
{
if (inf->zoom_mode == 0) inf->zoom_mode = 1;

View File

@ -20,6 +20,7 @@ struct _Video
Eina_Bool down : 1;
} down;
Eina_Bool nosmooth : 1;
Eina_Bool lowqual : 1;
Eina_Bool loop : 1;
Eina_Bool fill : 1;
};
@ -289,7 +290,8 @@ _unsmooth_timeout(void *data)
evas_object_geometry_get(data, &ox, &oy, &ow, &oh);
sd->smooth_timer = NULL;
sd->nosmooth = EINA_FALSE;
emotion_object_smooth_scale_set(sd->o_vid, !sd->nosmooth);
emotion_object_smooth_scale_set(sd->o_vid,
(!sd->nosmooth) & (!sd->lowqual));
return EINA_FALSE;
}
@ -308,7 +310,8 @@ _smooth_handler(Evas_Object *obj)
{
sd->nosmooth = EINA_TRUE;
sd->resizes = 0;
emotion_object_smooth_scale_set(sd->o_vid, !sd->nosmooth);
emotion_object_smooth_scale_set(sd->o_vid,
(!sd->nosmooth) & (!sd->lowqual));
if (sd->smooth_timer)
sd->smooth_timer = ecore_timer_del(sd->smooth_timer);
sd->smooth_timer = ecore_timer_add(interval * 10,
@ -803,6 +806,24 @@ video_event_send(Evas_Object *obj, Emotion_Event ev)
emotion_object_event_simple_send(sd->o_vid, ev);
}
void
video_lowquality_set(Evas_Object *obj, Eina_Bool lowq)
{
Video *sd = evas_object_smart_data_get(obj);
if (!sd) return;
sd->lowqual = lowq;
emotion_object_smooth_scale_set(sd->o_vid,
(!sd->nosmooth) & (!sd->lowqual));
}
Eina_Bool
video_lowquality_get(Evas_Object *obj)
{
Video *sd = evas_object_smart_data_get(obj);
if (!sd) return EINA_FALSE;
return sd->lowqual;
}
// emotion_object_seekable_get
// emotion_object_play_speed_set

View File

@ -43,5 +43,7 @@ const char *video_spu_channel_name_get(Evas_Object *obj, int chan);
int video_spu_button_count(Evas_Object *obj);
int video_spu_button_get(Evas_Object *obj);
void video_event_send(Evas_Object *obj, Emotion_Event ev);
void video_lowquality_set(Evas_Object *obj, Eina_Bool lowq);
Eina_Bool video_lowquality_get(Evas_Object *obj);
#endif