⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 agl_drv.h

📁 audio-video-codecs.rar语音编解码器
💻 H
字号:
/*
 *
 *                 INTEL CORPORATION PROPRIETARY INFORMATION
 *    This software is supplied under the terms of a license agreement or
 *    nondisclosure agreement with Intel Corporation and may not be copied
 *    or disclosed except in accordance with the terms of that agreement.
 *         Copyright(c) 2001-2006 Intel Corporation. All Rights Reserved.
 *
 */

/* Driver name: AGL video render.
 *
 * OS dependencies:
 *  - MacOS.
 *
 * Libraries dependencies:
 *  - OpenGL;
 *  - AGL;
 *  - Carbon.
 *
 * Markable driver features:
 *  1. Renendering formats:
 *      - RGB(24 bits format, 8(R) x 8(G) x 8(B));
 *  2. Parameter <frame> of the function <umc_agl_RenderFrame> should contain
 *  frame of the stream with ininitial frame sizes (resize will be done inside
 *  the render);
 *  3. Function <umc_agl_GetWindow> returns WindowRef to permit user manage the
 *  window.
 *
 * For more information see UMC documentation and MacOS help references.
 */

#ifndef __AGL_DRV_H__
#define __AGL_DRV_H__

#include <umc_defs.h>

#ifdef UMC_ENABLE_AGL_VIDEO_RENDER

#include "drv.h"
#include <AGL/agl.h>
#include <vm_mutex.h>

/* Name: AGLDrv.
 *
 * Purpose:
 *  Store AGL driver description.
 *
 * Structure fields:
 *  win             - Carbon description of the window;
 *  win_rect        - Carbon window rectangle;
 *  win_handler     - Carbon description of window event handler;
 *  agl_ctx             - AGL context;
 *  agl_fmt             - AGL pixel format;
 *  img_width,
 *  img_height      - initial video width and height;
 *  mtx_resize      - mutex to synchronize resizing;
 *  scrren_buffer   - data to render.
 *
 * Remarks:
 *  1. This structure is returned to the user after calling of umc_agl_Init;
 */

typedef struct AGLDrv
{
    WindowRef       win;
    Rect            win_rect;
    EventHandlerRef win_handler;

    AGLContext      agl_ctx;
    AGLPixelFormat  agl_fmt;

    vm_mutex        mtx_resize;
    Ipp8u*          screen_buffer;
} AGLDrv;

/* ------------------------------------------------------------------------- */

/* Name: AGLVideoDrvParams.
 *
 * Purpose:
 *  Store AGL driver parameters.
 *
 * Structure fields:
 *  common      - common parameters for all drivers;
 *  img_width   - frame initial width;
 *  img_height  - frame initial height.
 */

typedef struct AGLVideoDrvParams
{
    VideoDrvParams  common;     /* common parameters */
} AGLVideoDrvParams;

/* -------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

    extern VIDEO_DRV_INIT_FUNC (umc_agl_Init, driver, params);
    extern VIDEO_DRV_CLOSE_FUNC(umc_agl_Close, driver);

    extern VIDEO_DRV_CREATE_SURFACE_FUNC(umc_agl_CreateSurface, driver);
    extern VIDEO_DRV_FREE_SURFACE_FUNC  (umc_agl_FreeSurface, driver, srf);

    extern VIDEO_DRV_LOCK_SURFACE_FUNC(umc_agl_LockSurface, driver, srf, planes);

    extern VIDEO_DRV_RENDER_FRAME_FUNC  (umc_agl_RenderFrame, driver, frame, rect);
    extern VIDEO_DRV_SET_VIDEO_MODE_FUNC(umc_agl_SetVideoMode, driver, rect, mode);

    /* Function returns WindowRef. */
    extern VIDEO_DRV_GET_WINDOW_FUNC    (umc_agl_GetWindow, driver);
    extern VIDEO_DRV_RUN_EVENT_LOOP_FUNC(umc_agl_RunEventLoop, driver);

    extern const VideoDrvSpec AGLVideoDrvSpec;

#ifdef __cplusplus
}
#endif /* __cplusplus */

/* -------------------------------------------------------------------------- */

#define UMC_AGL_GET_WINDOW(void_win) (WindowRef)(void_win)

#endif /* defined(UMC_ENABLE_AGL_VIDEO_RENDER) */

#endif /* __AGL_DRV_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -