示例#1
0
vout_window_t *vout_window_New(vlc_object_t *obj,
                               const char *module,
                               const vout_window_cfg_t *cfg)
{
    window_t *w = vlc_custom_create(obj, sizeof(*w), "window");
    vout_window_t *window = &w->wnd;

    memset(&window->handle, 0, sizeof(window->handle));
    window->control = NULL;
    window->sys = NULL;
    window->type = cfg->type;

    const char *type;
    switch (cfg->type) {
#if defined(_WIN32) || defined(__OS2__)
    case VOUT_WINDOW_TYPE_HWND:
        type = "vout window hwnd";
        window->handle.hwnd = NULL;
        break;
#endif
#ifdef __APPLE__
    case VOUT_WINDOW_TYPE_NSOBJECT:
        type = "vout window nsobject";
        window->handle.nsobject = NULL;
        break;
#endif
    case VOUT_WINDOW_TYPE_XID:
        type = "vout window xid";
        window->handle.xid = 0;
        window->display.x11 = NULL;
        break;
    case VOUT_WINDOW_TYPE_ANDROID_NATIVE:
        type = "vout window anative";
        window->handle.anativewindow = NULL;
        break;
    default:
        assert(0);
    }

    w->module = vlc_module_load(window, type, module, module && *module,
                                vout_window_start, window, cfg);
    if (!w->module) {
        vlc_object_release(window);
        return NULL;
    }

    /* Hook for screensaver inhibition */
    if (var_InheritBool(obj, "disable-screensaver") &&
        cfg->type == VOUT_WINDOW_TYPE_XID) {
        w->inhibit = vlc_inhibit_Create(VLC_OBJECT (window));
        if (w->inhibit != NULL)
            vlc_inhibit_Set(w->inhibit, VLC_INHIBIT_VIDEO);
            /* FIXME: ^ wait for vout activation, pause */
    }
    else
        w->inhibit = NULL;
    return window;
}
示例#2
0
文件: window.c 项目: rlugojr/vlc
void vout_window_Delete(vout_window_t *window)
{
    if (!window)
        return;

    window_t *w = (window_t *)window;
    if (w->inhibit)
    {
        vlc_inhibit_Set (w->inhibit, VLC_INHIBIT_NONE);
        vlc_inhibit_Destroy (w->inhibit);
    }

    vlc_module_unload(w->module, vout_window_stop, window);
    vlc_object_release(window);
}
示例#3
0
vout_window_t *vout_window_New(vlc_object_t *obj,
                               const char *module,
                               const vout_window_cfg_t *cfg)
{
    static char const name[] = "window";
    window_t *w = vlc_custom_create(obj, sizeof(*w), VLC_OBJECT_GENERIC, name);
    vout_window_t *window = &w->wnd;

    window->cfg = cfg;
    memset(&window->handle, 0, sizeof(window->handle));
    window->control = NULL;
    window->sys = NULL;

    vlc_object_attach(window, obj);

    const char *type;
    switch (cfg->type) {
    case VOUT_WINDOW_TYPE_HWND:
        type = "vout window hwnd";
        break;
    case VOUT_WINDOW_TYPE_XID:
        type = "vout window xid";
        break;
    default:
        assert(0);
    }

    w->module = module_need(window, type, module, module && *module != '\0');
    if (!w->module) {
        vlc_object_detach(window);
        vlc_object_release(window);
        return NULL;
    }

    /* Hook for screensaver inhibition */
    if (cfg->type == VOUT_WINDOW_TYPE_XID) {
        w->inhibit = vlc_inhibit_Create (VLC_OBJECT (window),
                                         window->handle.xid);
        if (w->inhibit != NULL)
            vlc_inhibit_Set (w->inhibit, true);
            /* FIXME: ^ wait for vout activation, pause */
    }
    else
        w->inhibit = NULL;
    return window;
}
示例#4
0
文件: window.c 项目: rlugojr/vlc
vout_window_t *vout_window_New(vlc_object_t *obj, const char *module,
                               const vout_window_cfg_t *cfg,
                               const vout_window_owner_t *owner)
{
    window_t *w = vlc_custom_create(obj, sizeof(*w), "window");
    vout_window_t *window = &w->wnd;

    memset(&window->handle, 0, sizeof(window->handle));
    window->control = NULL;
    window->sys = NULL;

    if (owner != NULL)
        window->owner = *owner;
    else
        window->owner.resized = NULL;

    w->module = vlc_module_load(window, "vout window", module,
                                module && *module,
                                vout_window_start, window, cfg);
    if (!w->module) {
        vlc_object_release(window);
        return NULL;
    }

    /* Hook for screensaver inhibition */
    if (var_InheritBool(obj, "disable-screensaver") &&
            window->type == VOUT_WINDOW_TYPE_XID) {
        w->inhibit = vlc_inhibit_Create(VLC_OBJECT (window));
        if (w->inhibit != NULL)
            vlc_inhibit_Set(w->inhibit, VLC_INHIBIT_VIDEO);
        /* FIXME: ^ wait for vout activation, pause */
    }
    else
        w->inhibit = NULL;
    return window;
}