📄 dvb_pvr.h
字号:
//**************************************************************************
// Copyright (c) , Inc . All rights reserved.
// STB/SA, all right reserved.
//
// Product : STB Firmware
//
// Date :
// Author :
// Purpose : Provide API function
// Sources :
//***************************************************************************
//
// Modification use :
//**************************************************************************
// Update
//
// Date :
// Name :
// Description :
//
// Item Source
// ---------------------------------------- -------------------
#ifndef __DVB_PVR_H__
#define __DVB_PVR_H__
#include "dvb_sys.h"
#include "ct_demux.h"
typedef enum
{
EN_JUMP_OK,
EN_JUMP_ERROR,
EN_JUMP_LIVE
}EN_PVR_JUMP_STATUS;
typedef enum
{
EN_PVR_STATUS_SUCCESS,
EN_PVR_STATUS_FAIL
} EN_PVR_STATUS;
typedef enum
{
EN_PVR_TASK_IDLE,
EN_PVR_TASK_FILE_RECORD_START, //File Record : File record start
EN_PVR_TASK_FILE_RECORD_STOP, //File Record : File record stop
EN_PVR_TASK_FILE_PLAY_START, //File Play : File Start Play
EN_PVR_TASK_FILE_PLAY_STOP, //File Play : Stop File replay mode
EN_PVR_TASK_PLAY_PAUSE, //File/Cache Play : Pause
EN_PVR_TASK_PLAY_UNPAUSE, //File/Cache Play : UnPause
EN_PVR_TASK_PLAY_NORMAL, //File/Cache Play : Speed Normal
EN_PVR_TASK_PLAY_SKIP,
EN_PVR_TASK_PLAYBACK_JUMP,
EN_PVR_TASK_FAST_FORWARD,
EN_PVR_TASK_FAST_BACKWARD,
EN_PVR_TASK_SLOW_FORWARD,
EN_PVR_TASK_CALLBACK,
EN_PVR_TASK_FILE_DELETE, //Delete File Command
EN_PVR_TASK_FILE_CHECK,
EN_PVR_TASK_FILE_RECORD_STOP_ALL, //File Record : File record stop for all file.
EN_PVR_TASK_PLAY_RECORDING_START,
EN_PVR_TASK_PLAY_RECORDING_STOP,
EN_PVR_TASK_PLAY_LIVEBACK,
EN_PVR_TASK_TIME_SHIFT_READ_TO_WRITE,
EN_PVR_TASK_SCAN_PREVIEW,
EN_PVR_TASK_SCAN_PREVIEW_STOP
} EN_PVR_TASK_STATE;
#define MAX_PLAYBACK_AV_PID_NUMBER 3
#define MAX_PLAYBACK_NOT_AV_PID_NUMBER 17
#define MAX_RECORD_PID_NUMBER (MAX_PLAYBACK_AV_PID_NUMBER + MAX_PLAYBACK_NOT_AV_PID_NUMBER)
#define PVR_ENLARGE_BUFFER
#define PVR_RECORD_UNIT_SIZE (64*1024)
#ifdef PVR_ENLARGE_BUFFER
#define PVR_REC_BUFF_SIZE (12*PVR_RECORD_UNIT_SIZE*2)
#define PVR_PLAY_BUFF_SIZE (64 * 2 * 1024 * 2)
#else
#define PVR_REC_BUFF_SIZE (12*PVR_RECORD_UNIT_SIZE)
#define PVR_PLAY_BUFF_SIZE (64 * 2 * 1024)
#endif
#define MAX_PLAYBACK_HANDLE_NUM 100
#define PVR_MIN_CAPACITY 3072
#define PVR_FILE_SEPARATE_LENGTH 2097187
#define PVR_INVALID_FILE_HANDLE 0xFFFFFFFF
#define PVR_MAX_CACHE_BLOCK 16
// -----------------------
// @summary Record parameter for PVR
// @description
// This struct include record parameter for PVR
// @note ?
// -----------------------
typedef struct
{
u16 au16Pid[MAX_RECORD_PID_NUMBER]; //array for record pid
u8 u8PidNum; //the number of record pids
u32 u32FileHandle;
u32 u32NextFileHandle;
u32 u32RecordMBSize; //Set record size for record,if use duration time,Set record size as zero
u32 u32DurationTime; //Set record duration time for record,if use record size , set duration time as zero
u32 u32MaxMBSize; //Set Max Sector size for file
u8 u8CircleNum; //Set Circle Num for time shift file handle
} ST_PVR_RECORD_PARAMETER;
typedef enum
{
EN_PVR_EVENT_NONE,
EN_PVR_EVENT_WRITE_FAIL,
EN_PVR_EVENT_READ_FAIL,
EN_PVR_EVENT_RECORD_START, //003
EN_PVR_EVENT_RECORD_STOP,
EN_PVR_EVENT_RECORD_FINISH,
EN_PVR_EVENT_RECORD_NEW_HANDLE, //006
EN_PVR_EVENT_PLAYBACK_START,
EN_PVR_EVENT_PLAYBACK_END_OF_BEGIN,
EN_PVR_EVENT_PLAYBACK_END_OF_RECORDING, //009
EN_PVR_EVENT_PLAYBACK_FINISH,
EN_PVR_EVENT_PLAYBACK_PAUSE,
EN_PVR_EVENT_PLAYBACK_UNPAUSE, //012
EN_PVR_EVENT_PLAYBACK_STOP,
EN_PVR_EVENT_PLAYBACK_SKIP,
EN_PVR_EVENT_PLAYBACK_JUMP, //015
EN_PVR_EVENT_DISK_FULL,
EN_PVR_EVENT_PLAYBACK_TO_NORMAL,
EN_PVR_EVENT_TIME_SHIFT_HEAD, //018
EN_PVR_EVENT_TIME_SHIFT_START,
EN_PVR_EVENT_TIME_SHIFT_STOP,
EN_PVR_EVENT_SCAN_PREVIEW, //021
EN_PVR_EVENT_SCAN_PREVIEW_STOP,
EN_PVR_EVENT_GET_BITRATE,
EN_PVR_EVENT_GET_TIMESHIFT_REMOVE_HANDLE, //024
EN_PVR_EVENT_DEVICE_WRITE_TOO_SLOW,
EN_PVR_EVENT_DEVICE_READ_TOO_SLOW,
EN_PVR_EVENT_DEVICE_READ_WRITE_TOO_SLOW //027
}EN_PVR_EVENT;
typedef struct
{
u8 u8ReadHandleIndex;
u8 u8WriteHandleIndex;
u32 u32ReadPosition;
u32 u32WritePosition;
}ST_TIME_SHIFT_POS;
// -----------------------
// @summary Play parameter for PVR
// @description
// This struct include play parameter for PVR
// @note ?
// -----------------------
typedef struct
{
u32 au32FileHandle[MAX_PLAYBACK_HANDLE_NUM];
u32 u32FileHandleNum;
u32 u32TotalFileSeconds;
u32 u32HeaderSize;
u32 u32OffsetFileIndex; //File index for Offset
u32 u32Offset; //Offset with Offset File Index
u32 u32TotalFileSectors;
} ST_PVR_PLAY_PARAMETER;
typedef struct
{
u32 u32OffsetFileIndex; //File index for Offset
u32 u32Offset; //Offset with Offset File Index
} ST_PVR_JUMP_PARAMETER;
typedef enum
{
EN_PVR_RECORD_NONE,
EN_PVR_RECORD_FILE
}EN_PVR_RECORD_STATUS;
typedef enum
{
EN_PVR_PLAY_NONE,
EN_PVR_PLAY_FILE,
EN_PVR_TIME_SHIFT,
EN_PVR_ERROR_PLAY
}EN_PVR_PLAY_STATUS;
typedef enum
{
EN_PVR_PLAY_NORMAL,
EN_PVR_PLAY_FORWARD,
EN_PVR_PLAY_SLOWFORWARD,
EN_PVR_PLAY_BACKWARD
}EN_PVR_PLAYMODE;
// -----------------------
// @summary Provide AV PIDs for PVR
// @description
// This struct include AV PIDs for PVR
// @note ?
// -----------------------
typedef struct
{
u16 au16Pid[MAX_PLAYBACK_AV_PID_NUMBER];
u16 u16PidNumber;
}ST_PVR_AV_PID;
// -----------------------
// @summary Provide None-AV PIDs for PVR
// @description
// This struct include None-AV PIDs for PVR
// @note ?
// -----------------------
typedef struct
{
u16 au16Pid[MAX_PLAYBACK_NOT_AV_PID_NUMBER];
u16 u16PidNumber;
}ST_PVR_NOT_AV_PID;
typedef enum
{
EN_PVR_SPEED_X2,
EN_PVR_SPEED_X4,
EN_PVR_SPEED_X8,
EN_PVR_SPEED_X16,
EN_PVR_SPEED_X32,
EN_PVR_SPEED_NORMAL,
EN_PVR_SPEED_PAUSE
}EN_PVR_PLAYBACK_SPEED;
typedef void (*DVB_PVR_NOTIFY_FN)(EN_PVR_EVENT enPvrEvent);
typedef bool8 (*DVB_GET_KEY_FN)(void);
typedef struct
{
DVB_GET_KEY_FN pfnDvbDetectKey; //Dvb_DetectKey()
}ST_PVR_EXTERN_DVB_FN;
//========================================================================================
//*********************************************************************************
// @summary Initial PVR task
//
// @param void
//
// @return PVR status
// @retval EN_PVR_STATUS_SUCCESS PVR task initial success
// @retval EN_PVR_STATUS_FAIL PVR task initial failed
//
// @description
// Initial the PVR task
//*********************************************************************************
//EN_PVR_STATUS DVB_PVR_Initial(void);
EN_PVR_STATUS DVB_PVR_Initial(ST_PVR_EXTERN_DVB_FN *pstFn_Extern_Dvb);
//*********************************************************************************
// @summary Initial PVR callback task
//
// @param void
//
// @return PVR status
// @retval EN_PVR_STATUS_SUCCESS PVR callback task initial success
// @retval EN_PVR_STATUS_FAIL PVR callback task initial failed
//
// @description
// Initial the PVR callback task
//*********************************************************************************
EN_PVR_STATUS DVB_PVR_CallBack_Initial(void);
//*********************************************************************************
// @summary Initial PVR task status
//
// @param void
//
// @return PVR task status
// @retval EN_PVR_STATUS_SUCCESS PVR task OK
// @retval EN_PVR_STATUS_FAIL PVR task failed
//
// @description
// This function need to call after send command to PVR task.
//*********************************************************************************
EN_PVR_STATUS DVB_PVR_CmdStatus(void);
//*********************************************************************************
// @summary Set play status to fast backward
//
// @param enSpeed (Input) PVR playback speed
//
// @return TRUE or FALSE
// @retval TRUE Fast backward play success
// @retval FALSE Fast backward play failed
//
// @description
// This function is called to set current play status to fast backward play
//*********************************************************************************
bool8 DVB_PVR_FastBackwardPlay(EN_PVR_PLAYBACK_SPEED enSpeed);
//*********************************************************************************
// @summary Set play status to fast forward
//
// @param enSpeed (Input) PVR playback speed
//
// @return TRUE or FALSE
// @retval TRUE Fast forward play success
// @retval FALSE Fast forward play failed
//
// @description
// This function is called to set current play status to fast forward play
//*********************************************************************************
bool8 DVB_PVR_FastForwardPlay(EN_PVR_PLAYBACK_SPEED enSpeed);
//*********************************************************************************
// @summary Get current playing file handle
//
// @param void
//
// @return File handle
// @retval u32 File handle of current playing
//
// @description
// This function is called to get current playing file handle
//*********************************************************************************
u32 DVB_PVR_GetCurPlayHandle(void);
//*********************************************************************************
// @summary Get current recording file handle
//
// @param void
//
// @return File handle
// @retval u32 File handle of current recording
//
// @description
// This function is called to get current recording file handle
//*********************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -