📄 rmavsurf.pas
字号:
unit RmaVSurf;
interface
uses
PnTypes, PnWinTyp;
//***************************************************************************
//
// $Id: rmavsurf.h,v 1.21 1998/11/06 21:16:07 jordanb Exp $
//
// Copyright (C) 1995,1996,1997 Progressive Networks.
// All rights reserved.
//
// http://www.real.com/devzone
//
// This program contains proprietary
// information of Progressive Networks, Inc, and is licensed
// subject to restrictions on use and distribution.
//
//
// RealMedia Architecture Video Surface Interfaces.
//
//
//***************************************************************************
//
// Video Surface Data Structures and Constants
//
type
_RMABitmapInfoHeader = record
biSize: UINT32;
biWidth: INT32;
biHeight: INT32;
biPlanes: UINT16;
biBitCount: UINT16;
biCompression: UINT32;
biSizeImage: UINT32;
biXPelsPerMeter: INT32;
biYPelsPerMeter: INT32;
biClrUsed: UINT32;
biClrImportant: UINT32;
rcolor: UINT32;
gcolor: UINT32;
bcolor: UINT32;
end;
{$EXTERNALSYM _RMABitmapInfoHeader}
RMABitmapInfoHeader = _RMABitmapInfoHeader;
{$EXTERNALSYM RMABitmapInfoHeader}
//
// RMABitmapInfo structure.
//
_RMABitmapInfo = record
//struct
//{
biSize: UINT32; // use OFFSETOF(dwBitMask) here
biWidth: INT32; // image width (in pixels)
biHeight: INT32; // image height
biPlanes: UINT16; // # of bitplanes; always use 1
biBitCount: UINT16; // average # bits/pixel
biCompression: UINT32; // one of the RMA_... FOURCC codes
biSizeImage: UINT32; // = width * height * bitCount / 8
biXPelsPerMeter: INT32; // always 0
biYPelsPerMeter: INT32; // always 0
biClrUsed: UINT32; // !0, if 8-bit RGB; 0, otherwise
biClrImportant: UINT32; // !0, if 8-bit RGB; 0, otherwise
//} bmiHeader;
un: record
case Integer of
0: (dwBitMask: array [0..2] of UINT32); // color masks (for BI_BITFIELDS)
1: (dwPalette: array [0..255] of UINT32); // palette (for 8-bit RGB image)
end; //un
end;
{$EXTERNALSYM _RMABitmapInfo}
RMABitmapInfo = _RMABitmapInfo;
{$EXTERNALSYM RMABitmapInfo}
RMA_COMPRESSION_TYPE = UINT32;
{$EXTERNALSYM RMA_COMPRESSION_TYPE}
//
// Windows DIB formats & MKFOURCC() macro:
//
{$IFNDEF BI_RGB}
const
BI_RGB = 0; // RGB-8, 16, 24, or 32
{$EXTERNALSYM BI_RGB}
BI_RLE8 = 1; // 8-bit RLE compressed image
{$EXTERNALSYM BI_RLE8}
BI_RLE4 = 2; // 4-bit RLE compressed image
{$EXTERNALSYM BI_RLE4}
BI_BITFIELDS = 3; // RGB 555, 565, etc.
{$EXTERNALSYM BI_BITFIELDS}
{$ENDIF}
{$IFNDEF MKFOURCC}
function MKFOURCC(c0, c1, c2, c3: Byte): UINT32;
{$EXTERNALSYM MKFOURCC}
{$ENDIF}
//
// RMA image formats:
//
const
RMA_RGB = BI_RGB; //* Windows-compatible RGB formats:
{$EXTERNALSYM RMA_RGB}
RMA_RLE8 = BI_RLE8;
{$EXTERNALSYM RMA_RLE8}
RMA_RLE4 = BI_RLE4;
{$EXTERNALSYM RMA_RLE4}
RMA_BITFIELDS = BI_BITFIELDS;
{$EXTERNALSYM RMA_BITFIELDS}
RMA_I420 = $30323449; // MKFOURCC('I','4','2','0') planar YCrCb
{$EXTERNALSYM RMA_I420}
RMA_YV12 = $32315659; // MKFOURCC('Y','V','1','2') planar YVU420
{$EXTERNALSYM RMA_YV12}
RMA_YUY2 = $32595559; // MKFOURCC('Y','U','Y','2') packed YUV422
{$EXTERNALSYM RMA_YUY2}
RMA_UYVY = $59565955; // MKFOURCC('U','Y','V','Y') packed YUV422
{$EXTERNALSYM RMA_UYVY}
RMA_YVU9 = $39555659; // MKFOURCC('Y','V','U','9') Intel YVU9
{$EXTERNALSYM RMA_YVU9}
//
// Non-standard FOURCC formats (these are just few aliases to what can be
// represented by the standard formats, and they are left for backward
// compatibility only).
//
const
RMA_RGB3_ID = $52474233; // MKFOURCC('3','B','G','R') RGB-32 ??
{$EXTERNALSYM RMA_RGB3_ID}
RMA_RGB24_ID = $20524742; // MKFOURCC('B','G','R',' ') top-down RGB-24
{$EXTERNALSYM RMA_RGB24_ID}
RMA_RGB565_ID = $52474236; // MKFOURCC('6','B','G','R') RGB-16 565
{$EXTERNALSYM RMA_RGB565_ID}
RMA_RGB555_ID = $52474235; // MKFOURCC('5','B','G','R') RGB-16 555
{$EXTERNALSYM RMA_RGB555_ID}
RMA_8BIT_ID = $38424954; // MKFOURCC('T','I','B','8') RGB-8 w. pal-e
{$EXTERNALSYM RMA_8BIT_ID}
RMA_YUV420_ID = $59555632; // MKFOURCC('2','V','U','Y') planar YCrCb
{$EXTERNALSYM RMA_YUV420_ID}
RMA_YUV411_ID = $59555631; // MKFOURCC('1','V','U','Y') ???
{$EXTERNALSYM RMA_YUV411_ID}
RMA_YUVRAW_ID = $59555652; // MKFOURCC('R','V','U','Y') ???
{$EXTERNALSYM RMA_YUVRAW_ID}
//***************************************************************************
//
// Interface:
//
// IRMAVideoSurface
//
// Purpose:
//
// Interface for IRMAVideoSurface objects.
//
// IID_IRMAVideoSurface:
//
// {00002200-0901-11d1-8B06-00A024406D59}
//
//
const
IID_IRMAVideoSurface: TGUID = '{00002200-0901-11d1-8B06-00A024406D59}';
{$EXTERNALSYM IID_IRMAVideoSurface}
type
IRMAVideoSurface = interface (IUnknown)
['{00002200-0901-11d1-8B06-00A024406D59}']
//
// IRMAVideoSurface methods usually called by renderers to
// Draw on the surface
//
function Blt(pImageBits: PUCHAR; const pBitmapInfo: RMABitmapInfoHeader;
const rDestRect, rSrcRect: PNxRect): HRESULT; stdcall;
//***********************************************************************
// Method:
// IRMAVideoSurface::BeginOptimizedBlt
// Purpose:
// Called by renderer to commit to a bitmap format for all future
// OptimizedBlt calls.
//
function BeginOptimizedBlt(const pBitmapInfo: RMABitmapInfoHeader): HRESULT; stdcall;
//***********************************************************************
// Method:
// IRMAVideoSurface::OptimizedBlt
// Purpose:
// Called by renderer to draw to the video surface, in the format
// previously specified by calling BeginOptimizedBlt.
//
function OptimizedBlt(pImageBits: PUCHAR; const rDestRect, rSrcRect: PNxRect): HRESULT; stdcall;
//***********************************************************************
// Method:
// IRMAVideoSurface::EndOptimizedBlt
// Purpose:
// Called by renderer allow the video surface to cleanup after all
// OptimizedBlt calls have been made.
//
function EndOptimizedBlt: HRESULT; stdcall;
//***********************************************************************
// Method:
// IRMAVideoSurface::GetOptimizedFormat
// Purpose:
// Called by the client to find out what compression type the
// renderer committed to when it called BeginOptimizedBlt.
//
function GetOptimizedFormat(var ulType: RMA_COMPRESSION_TYPE): HRESULT; stdcall;
//***********************************************************************
// Method:
// IRMAVideoSurface::GetPreferredFormat
// Purpose:
// Called by renderer to find out what compression type the video
// surface would prefer to be given in BeginOptimizedBlt.
//
function GetPreferredFormat(var ulType: RMA_COMPRESSION_TYPE): HRESULT; stdcall;
end;
{$EXTERNALSYM IRMAVideoSurface}
implementation
{$IFNDEF MKFOURCC}
function MKFOURCC(c0, c1, c2, c3: Byte): UINT32;
begin
Result := c0 or (c1 shl 8) or (c2 shl 16) or (c3 shl 24);
end;
{$ENDIF}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -