typedef struct vlc_inhibit vlc_inhibit_t;
typedef struct vlc_inhibit_sys vlc_inhibit_sys_t;
+enum vlc_inhibit_flags
+{
+ VLC_INHIBIT_NONE=0 /*< No inhibition */,
+ VLC_INHIBIT_SUSPEND=0x1 /*< Processor is in use - do not suspend */,
+ VLC_INHIBIT_DISPLAY=0x2 /*< Display is in use - do not blank/lock */,
+#define VLC_INHIBIT_AUDIO (VLC_INHIBIT_SUSPEND)
+#define VLC_INHIBIT_VIDEO (VLC_INHIBIT_SUSPEND|VLC_INHIBIT_DISPLAY)
+};
+
struct vlc_inhibit
{
VLC_COMMON_MEMBERS
vlc_inhibit_sys_t *p_sys;
- void (*inhibit) (vlc_inhibit_t *, bool);
+ void (*inhibit) (vlc_inhibit_t *, unsigned flags);
};
+static inline void vlc_inhibit_Set (vlc_inhibit_t *ih, unsigned flags)
+{
+ ih->inhibit (ih, flags);
+}
+
#endif
set_callbacks (Open, Close)
vlc_module_end ()
-static void Inhibit (vlc_inhibit_t *, bool);
+static void Inhibit (vlc_inhibit_t *, unsigned);
static void Timer (void *data);
struct vlc_inhibit_sys
free (sys);
}
-static void Inhibit (vlc_inhibit_t *ih, bool unblank)
+static void Inhibit (vlc_inhibit_t *ih, unsigned flags)
{
vlc_inhibit_sys_t *sys = ih->p_sys;
+ bool unblank = (flags & VLC_INHIBIT_DISPLAY) != 0;
/* The shortest blanking interval is 10s on N900, 15s on N9 */
const mtime_t interval = 9 * CLOCK_FREQ;
}
}
-static void Inhibit (vlc_inhibit_t *ih, bool suspend)
+static void Inhibit (vlc_inhibit_t *ih, unsigned mask)
{
vlc_inhibit_sys_t *sys = ih->p_sys;
+ bool suspend = (mask & VLC_INHIBIT_DISPLAY) != 0;
mtime_t delay = suspend ? 30 * CLOCK_FREQ : INT64_C(0);
vlc_timer_schedule (sys->timer, false, delay, delay);
static void Deactivate ( vlc_object_t * );
static void Timer( void * );
-static void Inhibit( vlc_inhibit_t *, bool );
+static void Inhibit( vlc_inhibit_t *, unsigned );
struct vlc_inhibit_sys
{
free( p_sys );
}
-static void Inhibit( vlc_inhibit_t *p_ih, bool suspend )
+static void Inhibit( vlc_inhibit_t *p_ih, unsigned mask )
{
+ bool suspend = (mask & VLC_INHIBIT_DISPLAY) != 0;
mtime_t d = suspend ? 30*CLOCK_FREQ : 0;
vlc_timer_schedule( p_ih->p_sys->timer, false, d, d );
}
vlc_inhibit_t *vlc_inhibit_Create (vlc_object_t *);
void vlc_inhibit_Destroy (vlc_inhibit_t *);
-
-static inline void vlc_inhibit_Set (vlc_inhibit_t *ih, bool suspend)
-{
- ih->inhibit (ih, suspend);
-}
#endif
cfg->type == VOUT_WINDOW_TYPE_XID) {
w->inhibit = vlc_inhibit_Create(VLC_OBJECT (window));
if (w->inhibit != NULL)
- vlc_inhibit_Set(w->inhibit, true);
+ vlc_inhibit_Set(w->inhibit, VLC_INHIBIT_VIDEO);
/* FIXME: ^ wait for vout activation, pause */
}
else
window_t *w = (window_t *)window;
if (w->inhibit)
{
- vlc_inhibit_Set (w->inhibit, false);
+ vlc_inhibit_Set (w->inhibit, VLC_INHIBIT_NONE);
vlc_inhibit_Destroy (w->inhibit);
}