obs_core_video_mix
+ -

obs_core_video_mixs概述

2024-07-01 6 0

obs_core_video_mix结构体是用于承载视频图像渲染及格式转换的结构体。
obs_core_video_mix 结构体定义为:

struct obs_view {
    pthread_mutex_t channels_mutex;
    obs_source_t *channels[MAX_CHANNELS];
};

struct obs_core_video_mix {
    struct obs_view *view; 

    gs_stagesurf_t *active_copy_surfaces[NUM_TEXTURES][NUM_CHANNELS];
    gs_stagesurf_t *copy_surfaces[NUM_TEXTURES][NUM_CHANNELS];
    gs_texture_t *convert_textures[NUM_CHANNELS];
    gs_texture_t *convert_textures_encode[NUM_CHANNELS];
#ifdef _WIN32
    gs_stagesurf_t *copy_surfaces_encode[NUM_TEXTURES];
#endif
    gs_texture_t *render_texture; //原本渲染后
    gs_texture_t *output_texture; //格式调整后输出
    enum gs_color_space render_space;
    bool texture_rendered;
    bool textures_copied[NUM_TEXTURES];
    bool texture_converted;
    bool using_nv12_tex;
    bool using_p010_tex;
    struct deque vframe_info_buffer;
    struct deque vframe_info_buffer_gpu;
    gs_stagesurf_t *mapped_surfaces[NUM_CHANNELS];
    int cur_texture;
    volatile long raw_active;
    volatile long gpu_encoder_active;
    bool gpu_was_active;
    bool raw_was_active;
    bool was_active;
    pthread_mutex_t gpu_encoder_mutex;
    struct deque gpu_encoder_queue;
    struct deque gpu_encoder_avail_queue;
    DARRAY(obs_encoder_t *) gpu_encoders;
    os_sem_t *gpu_encode_semaphore;
    os_event_t *gpu_encode_inactive;
    pthread_t gpu_encode_thread;
    bool gpu_encode_thread_initialized;
    volatile bool gpu_encode_stop;

    video_t *video;
    struct obs_video_info ovi;

    bool gpu_conversion;
    const char *conversion_techs[NUM_CHANNELS];
    bool conversion_needed;
    float conversion_width_i;
    float conversion_height_i;

    float color_matrix[16];

    bool encoder_only_mix;
    long encoder_refs;
};

其中第一个成员view类型是obs_view

struct obs_view {
    pthread_mutex_t channels_mutex;
    obs_source_t *channels[MAX_CHANNELS];//64
};

view指针类型由创建obs_core_video_mix后初始化。

0 篇笔记 写笔记

作者信息
我爱内核
Windows驱动开发,网站开发
好好学习,天天向上。
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!