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

📄 spu_types.h

📁 这是DVD中伺服部分的核心代码
💻 H
字号:
/*****************************************************************************
******************************************************************************
**                                                                          **
**  Copyright (c) 2005 Videon Central, Inc.                                 **
**  All rights reserved.                                                    **
**                                                                          **
**  The computer program contained herein contains proprietary information  **
**  which is the property of Videon Central, Inc.  The program may be used  **
**  and/or copied only with the written permission of Videon Central, Inc.  **
**  or in accordance with the terms and conditions stipulated in the        **
**  agreement/contract under which the programs have been supplied.         **
**                                                                          **
******************************************************************************
*****************************************************************************/
/**
 * @file spu_types.h
 *
 * Private data types for the DVD Software Subpicture Decoder
 *
 * $Id: spu_types.h,v 1.12 2006/09/29 22:13:44 brant Exp $
 */
#ifndef __SPU_TYPES_H__
#define __SPU_TYPES_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "spu_render/spu_render_types.h"

/* subpicture commands */
#define FSTA_DSP    0x00    /* force display                                    */
#define STA_DSP     0x01    /* start display                                    */
#define STP_DSP     0x02    /* stop display                                     */
#define SET_COLOR   0x03    /* sets the color of the pixel data                 */
#define SET_CONTR   0x04    /* sets the alpha of selected colors in the palette */
#define SET_DAREA   0x05    /* sets the display area                            */
#define SET_DSPXA   0x06    /* sets the offsets to the pixel data fields        */
#define CHG_COLCON  0x07    /* sets color and alpha for a section of pixel data */
#define SET_COLOR2  0x83    /* sets color code of pixel data 2 (HD)             */
#define SET_CONTR2  0x84    /* sets alpha of colors in the palette 2 (HD)       */
#define SET_DAREA2  0x85    /* sets display area of pixel data 2 (HD)           */
#define SET_DSPXA2  0x86    /* sets display start address of pixel data 2 (HD)  */
#define CHG_COLCON2 0x87    /* sets change and color and contrast 2 (HD)        */
#define CMD_END     0xFF    /* signals end of command sequence                  */

#define PXCD_TERMINATION_CODE   0x0FFFFFFF
#define PXCD_ARRAY_LENGTH       1079
#define PXCD_ARRAY_LENGTH_DVD   575
#define MAX_SCREEN_WIDTH        1920
#define MAX_SCREEN_WIDTH_DVD    720
#define MAX_SCREEN_HEIGHT       1080
#define MAX_SCREEN_PIXELS       (MAX_SCREEN_WIDTH * MAX_SCREEN_HEIGHT)

typedef enum _tagSPInsertedState
{
    SP_INSERTED_AND_SHOWING = 0,
    SP_INSERTED_NOT_SHOWING,
    SP_NOT_INSERTED
} SPInsertedState;

typedef struct tagPX_CTLI
{
    USHORT usChangeStartPixelNumber;
    SPU_PXCD_COLOR_TABLE ColorTable[MAX_SPU_PALETTE_COLORS];
} PX_CTLI;

typedef struct tagPXCD
{
    ULONG   ln_ctli;
    PX_CTLI px_ctli[8];
} PXCD;

typedef struct tagHLI_INFO
{
    SPU_HLI_COLOR HLIColors[MAX_SPU_PALETTE_COLORS];
    SPU_HLI_COLOR HLIBackup[MAX_SPU_PALETTE_COLORS];
    USHORT StartX;
    USHORT EndX;
    USHORT StartY;
    USHORT EndY;
} HLI_INFO;

/* This struct will contain all information required for the spu, spu_decoder, and spu_renderer */
typedef struct _tagSPU_DECODER
{
    ULONG       ulState;            /* Subpic decoder state info */
    BOOLEAN     fKillThread;        /* Destroys decoder thread if TRUE */
    ULONG       ulThreadID;         /* Thread ID */
    ULONG       ulPTS;              /* The latest valid PTS */
    cStream     *pStreamDecode;     /* Stream in to decoder */
    BYTE        *pbSpuBuffer;       /* Buffer for encoded SPUs */
    BYTE        *pbIndeces;
    USHORT      ButtonStartX;
    USHORT      ButtonStartY;
    USHORT      ButtonEndX;
    USHORT      ButtonEndY;
    ULONG       dcsq_timeout;

    BOOLEAN         fDisabled;          /* Is subpic force disabled? */
    BOOLEAN         fShowing;           /* Is the renderer displaying? */
    BOOLEAN         fIsForcedSP;        /* Is it a forced sub pic?     */
    BOOLEAN         fHighlightEnabled;  /* Are highlights enabled */
    SPInsertedState fInserted;          /* Is there a pixmap inserted? */

    /* store colors and alphas in this table (SET_COLOR, SET_CONTR)*/
    SPU_COLOR SPUColorTable[MAX_SPU_PALETTE_COLORS];

    /* since the encoded image is interlaced, we must save the actual field */
    ULONG ulField;

    /* pointer to the two half frames */
    ULONG ulFieldOffset[2];

    HLI_INFO        HLI;

    /* is the rle data 8bit */
    BYTE            RLE8Bit;

    /* parameters for avsync callback into PE */
    PVOID       pSyncCallback;
    PVOID       pSyncContext;

    /* variable used by decoder and renderer */
    ULONG ulCSOffset;
    ULONG ulSPUSize;
    ULONG ulBmpX;       /* x position of the bitmap  */
    ULONG ulBmpY;       /* y position of the bitmap  */
    ULONG ulBmpW;       /* width of the bitmap  */
    ULONG ulBmpH;       /* height of the bitmap  */
    ULONG ulLastBmpX;       /* x position of the bitmap  */
    ULONG ulLastBmpY;       /* y position of the bitmap  */
    ULONG ulLastBmpW;       /* width of the bitmap  */
    ULONG ulLastBmpH;       /* height of the bitmap  */

    /* pixel contrl data (used with CHG_COLCON command)
     * Refer to section 5.4.3.4.1 of DVD Specification for Read Only Disc: PART 3 - DVD Video Spec */
    PXCD pxcd[PXCD_ARRAY_LENGTH];

    OS_SEM_ID critical_section;  /* make things multi thread safe */

} SPU_DECODER, *PSPU_DECODER;

#ifdef __cplusplus
}
#endif

#endif /* __SPU_TYPES_H__ */

⌨️ 快捷键说明

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