📄 mv_inp.h
字号:
/*==========================================================================*/
/* (Copyright (C) 2003 Koninklijke Philips Electronics N.V. */
/* All rights reserved. */
/* This source code and any compilation or derivative thereof is the */
/* proprietary information of Koninklijke Philips Electronics N.V. */
/* and is confidential in nature. */
/* Under no circumstances is this software to be exposed to or placed */
/* under an Open Source License of any type without the expressed */
/* written permission of Koninklijke Philips Electronics N.V. */
/*==========================================================================*/
/*==========================================================================*/
/*
INCLUDE_FILE: MV_INP.H
PACKAGE: INP
COMPONENT: MV
(C) 1998: Philips Semiconductors
/*==========================================================================*/
/*MPP:::INP======================================================*/
/* PACKAGE NAME: INP
SCOPE: PLATEFORM
ORIGINAL AUTHOR: B.LEMESLE
DATA TYPES:
MV_INP_ID
MV_INP_VERSION
MV_INP_INFO
MV_INP_BUF_SIZE
MV_INP_BUFFERS
MV_INP_BUFCFG
MV_INP_FROM_START
MV_INP_FORMAT
MV_INP_DATA
MV_INP_SIZE
MV_INP_EVENT
FUNCTIONS:
MV_INP_bufuse
MV_INP_init
MV_INP_set_defaults
MV_INP_term
MV_INP_reset_buffer
MV_INP_set_warning_levels
MV_INP_get_status
MV_INP_set_format
MV_INP_fill_buffer
MV_INP_fill_still_buffer
MV_INP_install_notify
MV_INP_enable_notification
MV_INP_disable_notification
*/
/*EMP=======================================================================*/
#ifndef _MV_INP_INCLUDED_
#define _MV_INP_INCLUDED_
#ifdef __cplusplus
extern "C" {
#endif
/*==========================================================================*/
/* I N C L U D E S */
/*==========================================================================*/
/*==========================================================================*/
/* G L O B A L S Y M B O L D E F I N I T I O N S */
/*==========================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_ID
PACKAGE: INP
DESCRIPTION:
Unique identifier for IP-block or IP-block driver.
DEFINITION:
*/
typedef char *MV_INP_ID;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_VERSION
PACKAGE: INP
DESCRIPTION:
Unique version of IP-block or IP-block driver.
DEFINITION:
*/
typedef char *MV_INP_VERSION;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_INFO
PACKAGE: INP
DESCRIPTION:
Structure containing IP-block and IP-block driver identifications and
versions.
DEFINITION:
*/
typedef struct MV_INP_INFO_STRUCT
{
MV_INP_ID hardware_id;
MV_INP_VERSION hardware_version;
MV_INP_ID software_id;
MV_INP_VERSION software_version;
} MV_INP_INFO;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_BUF_SIZE
PACKAGE: INP
DESCRIPTION: Video buffer size in bytes units.
DEFINITION:
*/
typedef unsigned long MV_INP_BUF_SIZE;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_BUFFERS
PACKAGE: INP
DESCRIPTION:
It represents the memory buffers that are required by the package, but
created by the application.
This structure is passed to the package during initialization
(to MV_INP_init()).
It contains :
- SDRAM base address
- video fifo address (offset % beginning of SDRAM) and its size
- still fifo address (offset % beginning of SDRAM) and its size
This structure is also returned by MV_INP_bufuse(), in which case the
size fields contain the required buffer sizes (to be created by the
application) and the pointer fields contain their alignment constraints
by means of a mask: (trailing) zero bits in the mask must also be zero in
the pointer value that is later passed to MV_INP_init().
For instance, 0xFFFFFC00 denotes 32-bit alignment.
DEFINITION:
*/
typedef struct MV_INP_BUFFERS_STRUCT
{
void * SDRAM_base_addr; /* absolute address of SDRAM zone */
void * video_fifo_addr; /* alignement, important : the 10 last bit of video_fifo_addr must be = 0 */
MV_INP_BUF_SIZE video_fifo_size; /* in unit of bytes */
void * still_fifo_addr; /* alignement, important : the 10 last bit of video_fifo_addr must be = 0 */
MV_INP_BUF_SIZE still_fifo_size; /* in unit of bytes */
} MV_INP_BUFFERS;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_BUFCFG
PACKAGE: INP
DESCRIPTION:
Structure used by application to define size of video still fifo.
DEFINITION:
*/
typedef struct
{
MV_INP_BUF_SIZE video_fifo_size; /* in unit of bytes */
MV_INP_BUF_SIZE still_fifo_size; /* in unit of bytes */
} MV_INP_BUFCFG;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_FROM_START
PACKAGE: INP
DESCRIPTION:
Enum for indicate to drivers if we want to fill still fifo from begining
or from its current write pointer
- MV_INP_FROM_START_ENABLED means data will be written from start address of
the still fifo.
- MV_INP_FROM_START_DISABLED means data will be written from a write_pointer
which is maintain by SW in the still fifo.
DEFINITION:
*/
typedef enum
{
MV_INP_FROM_START_DISABLED = 0,
MV_INP_FROM_START_ENABLED
} MV_INP_FROM_START;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_FORMAT
PACKAGE: INP
DESCRIPTION:
Video input data format.
The data send to video input buffer can have following format:
- PES
- ES
- MPEG1
DEFINITION:
*/
typedef enum
{
MV_INP_FORMAT_PES = 0, /* Packetized Elementary Stream */
MV_INP_FORMAT_MPEG1 = 1, /* MPEG1 packets stream */
MV_INP_FORMAT_ES = 2 /* Elementary Stream */
} MV_INP_FORMAT;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_DATA
PACKAGE: INP
DESCRIPTION:
It represents a byte
DEFINITION:
*/
typedef unsigned char MV_INP_DATA;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_SIZE
PACKAGE: INP
DESCRIPTION:
size in units of MV_INP_DATA
DEFINITION:
*/
typedef unsigned long MV_INP_SIZE;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_INP_EVENT
PACKAGE: INP
DESCRIPTION:
Type for video input events that can be notify to application.
DEFINITION:
*/
typedef unsigned short MV_INP_EVENT;
#define MV_INP_NO_EVENT 0x0000
/* No Event */
#define MV_INP_BUFFER_FULL_EVENT 0x0001
/* Video buffer completely filled. */
#define MV_INP_BUFFER_OVER_EVENT 0x0002
/* Amount of data reachs over_level.*/
#define MV_INP_BUFFER_UNDER_EVENT 0x0004
/* Amount of data below the under_level.*/
#define MV_INP_BUFFER_EMPTY_EVENT 0x0008
/* Video buffer became empty. */
#define MV_INP_BUFFER_PTR_UPDATED_EVENT 0x0010
/* Video buffer has been updated */
#define MV_INP_BUFFER_CMD_START_EVENT 0x0020
/* video data are sent as soon as possible from video fifo in the decoding core */
#define MV_INP_BUFFER_CMD_STOP_EVENT 0x0040
/* no more video data are sent from video fifo in the decoding core */
#define MV_INP_STILL_FIFO_FULL_EVENT 0x0080
/* still fifo completely filled. */
/*EMP=======================================================================*/
/*==========================================================================*/
/* G L O B A L D A T A R E F E R E N C E S */
/*==========================================================================*/
/*==========================================================================*/
/* G L O B A L F U N C T I O N P R O T O T Y P E S */
/*==========================================================================*/
/*EMPF======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_INP_bufuse
PACKAGE: INP
SCOPE: PLATEFORM
DESCRIPTION:
Depending on some (run-time) configuration parameters, the sizes (and
alignments) of the buffers required by the package are computed.
With this information the application can allocate these buffers and pass
them to the package upon initialization.
Actually, application decides of the size of the still fifo for Picture
in Picture trickmode. Concerning the size of the video MPEG fifo, it
can be configured in the external header file ipvd_cfg.h
PRECONDITIONS:
This function may be called before MV_INP_init().
POSTCONDITIONS:
CALLING SEQUENCE:
*/
void
MV_INP_bufuse(
MV_INP_BUFCFG * in_bufcfg_ptr, /* In: run-time config. parameters */
MV_INP_BUFFERS * ou_bufuse_ptr /* Out: required sizes and alignment */
);
/*EMP=======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_INP_init
PACKAGE: INP
SCOPE: PLATEFORM
DESCRIPTION:
This function initializes the video input package.
It claims all resources needed by the package and subsequently sets it
to its default state as specified for the MV_INP_set_defaults() function.
The required buffers are passed as parameters.
This function must be called before any other function of the MV_INP
package (except MV_INP_bufuse())
!!! MV_DEC_init must be called before MV_INP_init
PRECONDITIONS:
This function may be called after MV_INP_bufuse().
POSTCONDITIONS:
The drivers are set in the same mode than after call to
MV_INP_set_defaults().
CALLING SEQUENCE:
*/
void
MV_INP_init(
MV_INP_BUFFERS * in_buffers_ptr /* In: application allocated buffers */
);
/*EMP=======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_INP_set_defaults
PACKAGE: INP
SCOPE: PLATEFORM
DESCRIPTION:
Sets the video input buffer package to its default settings.
Following values will be configured after this call :
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -