<commit_before>/*
 * Copyright 2016 GoPro Inc.
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#ifndef NODES_H
#define NODES_H

#include <stdlib.h>
#include <sxplayer.h>
#include <pthread.h>

#if defined(HAVE_VAAPI_X11)
#include <X11/Xlib.h>
#endif

#if defined(HAVE_VAAPI_WAYLAND)
#include <wayland-client.h>
#endif

#if defined(HAVE_VAAPI)
#include <va/va.h>
#endif

#if defined(TARGET_ANDROID)
#include "android_handlerthread.h"
#include "android_surface.h"
#endif

#if defined(TARGET_IPHONE)
#include <CoreVideo/CoreVideo.h>
#endif

#include "animation.h"
#include "block.h"
#include "drawutils.h"
#include "graphicstate.h"
#include "hmap.h"
#include "hwconv.h"
#include "hwupload.h"
#include "image.h"
#include "nodegl.h"
#include "params.h"
#include "pgcache.h"
#include "program.h"
#include "darray.h"
#include "buffer.h"
#include "format.h"
#include "rendertarget.h"
#include "rnode.h"
#include "texture.h"

struct node_class;

typedef int (*cmd_func_type)(struct ngl_ctx *s, void *arg);

struct ngl_ctx {
    /* Controller-only fields */
    int configured;
    pthread_t worker_tid;

    /* Worker-only fields */
    struct gctx *gctx;
    struct rnode rnode;
    struct rnode *rnode_pos;
    struct graphicstate graphicstate;
    struct rendertarget_desc default_rendertarget_desc;
    struct rendertarget_desc *rendertarget_desc;
    struct ngl_node *scene;
    struct ngl_config config;
    struct darray modelview_matrix_stack;
    struct darray projection_matrix_stack;
    struct darray activitycheck_nodes;
#if defined(HAVE_VAAPI_X11)
    Display *x11_display;
#endif
#if defined(HAVE_VAAPI_WAYLAND)
    struct wl_display *wl_display;
#endif
#if defined(HAVE_VAAPI)
    VADisplay va_display;
    int va_version;
#endif

    /* Shared fields */
    pthread_mutex_t lock;
    pthread_cond_t cond_ctl;
    pthread_cond_t cond_wkr;
    cmd_func_type cmd_func;
    void *cmd_arg;
    int cmd_ret;
};

struct ngl_node {
    const struct node_class *class;<commit_msg>nodes: remove unused default_rendertargetdesc field from ngl_ctx structure<commit_after>/*
 * Copyright 2016 GoPro Inc.
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#ifndef NODES_H
#define NODES_H

#include <stdlib.h>
#include <sxplayer.h>
#include <pthread.h>

#if defined(HAVE_VAAPI_X11)
#include <X11/Xlib.h>
#endif

#if defined(HAVE_VAAPI_WAYLAND)
#include <wayland-client.h>
#endif

#if defined(HAVE_VAAPI)
#include <va/va.h>
#endif

#if defined(TARGET_ANDROID)
#include "android_handlerthread.h"
#include "android_surface.h"
#endif

#if defined(TARGET_IPHONE)
#include <CoreVideo/CoreVideo.h>
#endif

#include "animation.h"
#include "block.h"
#include "drawutils.h"
#include "graphicstate.h"
#include "hmap.h"
#include "hwconv.h"
#include "hwupload.h"
#include "image.h"
#include "nodegl.h"
#include "params.h"
#include "pgcache.h"
#include "program.h"
#include "darray.h"
#include "buffer.h"
#include "format.h"
#include "rendertarget.h"
#include "rnode.h"
#include "texture.h"

struct node_class;

typedef int (*cmd_func_type)(struct ngl_ctx *s, void *arg);

struct ngl_ctx {
    /* Controller-only fields */
    int configured;
    pthread_t worker_tid;

    /* Worker-only fields */
    struct gctx *gctx;
    struct rnode rnode;
    struct rnode *rnode_pos;
    struct graphicstate graphicstate;
    struct rendertarget_desc *rendertarget_desc;
    struct ngl_node *scene;
    struct ngl_config config;
    struct darray modelview_matrix_stack;
    struct darray projection_matrix_stack;
    struct darray activitycheck_nodes;
#if defined(HAVE_VAAPI_X11)
    Display *x11_display;
#endif
#if defined(HAVE_VAAPI_WAYLAND)
    struct wl_display *wl_display;
#endif
#if defined(HAVE_VAAPI)
    VADisplay va_display;
    int va_version;
#endif

    /* Shared fields */
    pthread_mutex_t lock;
    pthread_cond_t cond_ctl;
    pthread_cond_t cond_wkr;
    cmd_func_type cmd_func;
    void *cmd_arg;
    int cmd_ret;
};

struct ngl_node {
    const struct node_class *class;
{'fraction_non_alphanumeric': 0.09483859201167244, 'fraction_numerical': 0.00583622104687215, 'mean_word_length': 4.371204701273261, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2177352', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1806, 'n_words': 563}