Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

PVR3 porting guide

2.0

2010-10-29

THIS DOCUMENT CONTAINS PROPRIETARY TECHNICAL INFORMATION WHICH IS THE PROPERTY


OF ALI CORPORATION AND SHALL NOT BE DISCLOSED TO OTHERS IN WHOLE OR IN PART,
REPRODUCED, COPIED, OR USED AS THE BASIS FOR DESIGN, MANUFACTURING, OR SALE OF
APPARATUS WITHOUT WRITTEN PERMISSION OF ALI CORPORATION

OSD Resource Introduction


Acer Labs Inc. Marketing Requirements Spec.

Change History

Revision Issue Date Comments


1.0 2009-09-18 First release
2.0 2010-10-29 Second release

Page 2 of 6
Acer Laboratories (Shanghai) Inc.: 6F Building 39, No.333 Qinjiang Road, Shanghai 200233, China.
Tel: +21-64855058. Fax: +21-64951498
Acer Labs Inc. Marketing Requirements Spec.

M3602 2_Tuner
1. This guide is used for STB projects with DVR function porting old PVR (PVR DDK for
M3329E or PVR_HD for M3602) to PVR3.
According to this guide, following projects type can be implemented:
1. M3329E 1-Tuner DVR;
2. M3329E 2-Tuner DVR;
3. M3602 1-Tuner DVR;
4. M3602 2-Tuner DVR;

2. Ali PVR history


a) PVR1
Support Ali private file system.
Support IDE.
Basic PVR functions: record/playback.
Support 1 partition.
b) PVR2 (PVR_DDK/PVR_HD)
Support formal file system (FAT32/NTFS).
Support SDIO, USB, IDE.
Enhanced PVR functions: multi-number/type record/playback.
Support multi-device/partition.
c) PVR3
Support formal file system (FAT32/NTFS).
Support SDIO, USB, IDE.
Enhanced PVR functions: multi-number/type record/playback.
Support multi-device/partition.
*Unify the interface for Ali PVR product line (PVR_DDK for M3329E & PVR_HD for
M3602).
*Optimized PVR architecture with multi-layer design, open some upper layers PVR
manage code to customer for customization.

3. PVR3 change points


Module init:
a) add API pvr_attach() to do module init. Please fulfill the param with reasonable values,
or refer to Ali SDK.
Record flow:
a) update record open param pvr_r_open() to pass more control info by APP. Please check
the value of all param when start to record.
Playback flow:
a) add playback open API pvr_p_open_ext() to accept param structure for various control by
APP. Please check the value of all param when start to playback.

Page 3 of 6
Acer Laboratories (Shanghai) Inc.: 6F Building 39, No.333 Qinjiang Road, Shanghai 200233, China.
Tel: +21-64855058. Fax: +21-64951498
Acer Labs Inc. Marketing Requirements Spec.

4. Added APIs
a) RET_CODE pvr_attach(PPVR_MGR_CFG cfg, PPVR_CFG ini_param); // init PVR
sub-modules, such as folder format.
b) BOOL pvr_r_close_ext(PVR_HANDLE *handle, struct record_stop_param
*stop_param); // for enhanced record close.
c) RET_CODE pvr_r_pause(PVR_HANDLE handle); RET_CODE
pvr_r_resume(PVR_HANDLE handle); // record pause/resume function while
recording.
d) BOOL pvr_p_close_ext(PVR_HANDLE *handle, struct playback_stop_param
*stop_param); // enhanced playback close control.
e) BOOL pvr_p_restart(PVR_HANDLE handle, UINT32 param1); // for append record
playback control.
f) BOOL pvr_init_size(char *mount_name); // for record/timeshift size divide by PVR
default rule.
g) RET_CODE pvr_set_repeatmark(UINT16 record_idx, UINT32 mark_time); UINT8
pvr_get_repeatmark(UINT16 record_idx, UINT32 *mark_ptm_array); RET_CODE
pvr_clear_repeatmark(UINT16 record_idx); // for repeat-AB function.
h) RET_CODE pvr_set_disk_use(UINT8 use, const char *mount_name); // APP can set
partition for PVR usage.
i) INT8 pvr_get_disk_mode(char *mount_name); // APP can check partition in PVR
usage.
j) enum PVR_DISKMODE pvr_get_cur_mode(char *rec_partition, char
*tms_partition); // APP can check PVR module partition usage.

5. Modified APIs
a) INT32 pvr_register(UINT32 vbh_addr,UINT32 vbh_len); // now support pass data
structure for partition PVR init. (compatable with old default partition PVR init).
b) PVR_HANDLE pvr_r_open(struct record_prog_param *prog_info); PVR_HANDLE
pvr_p_open_ext(struct playback_param *param); // update param structure to pass more
control info.

6. Deleted APIs
a) void pvr_continue_tms_enable(void); // now be enabled by param when call
pvr_r_open().
b) void pvr_UI_init(PVR2UI_Callback ui_callback); void pvr_init_ui_param(struct
PVR2UIParam *pvr_param); void pvr_set_parameters(PVR_CFG pvr_cfg); // now be
implemented in pvr_attach().
c) void pvr_r_set_ts_file_size(UINT8 level); // now be implemented as follows:

in the structure: struct record_prog_param(lib_pvr_eng.h),


add a field: UINT32 record_file_size;
The usage is like this:

Page 4 of 6
Acer Laboratories (Shanghai) Inc.: 6F Building 39, No.333 Qinjiang Road, Shanghai 200233, China.
Tel: +21-64855058. Fax: +21-64951498
Acer Labs Inc. Marketing Requirements Spec.

SYSTEM_DATA* p_sys_data = sys_data_get();

struct record_prog_param prog_info;


prog_info.record_file_size = (p_sys_data->record_ts_file_size + 1) * 1024 *1024;

7. Other Issues
a) Use PVR3, should pay attention to struct record_prog_param and struct playback_param
in lib_pvr_eng.h

Struct record_prog_param is used to record program. The difference between pvr2 and pvr3
is as follows:

1) UINT8 full_path. //default is 0, no necessary to change.


2) UINT8 append_to_exist_file; //default is 0, no necessary to change. // 0:record as new
item, 1: find the record item, if success, append to the file end
3) UINT8 continuous_tms; //default is 0, no necessary to change. // 1: enable, 0:
disable, only enable when mode is
RECORDING_TIMESHIFT
4) UINT8 record_whole_tp_data;//default is 0, no necessary to change. // 1: whole tp
record, 0: only record the pid_info.
5) UINT32 tms_total_size; //default is 0, no necessary to change. will set in pvr mgr
// in KBytes, only active while mode is RECORDING_TIMESHIFT
6) UINT32 ts_bitrate; // in bps, current record channel bitrate
7) UINT32 record_file_size; // in KBytes, recomment to 900M, if FAT32 fs
almost 4G, NTFS no limit.

struct playback_param is used to playback record, The difference between pvr2 and pvr3 is
as follows:

1)UINT32 start_pos; //default is 0, no necessary to change. // only when start_mode is


P_OPEN_FROM_POS.
2)UINT8 preview_mode; //default is 0, no necessary to change.no use in 3329
platform // 1: preview_mode, 0: full screen playback mode.

b) For record all ts data, the usage is as follows:


1)define macro: PVR_TP_RECORD_ENABLE
2)call void sys_data_set_tp_record(UINT8 flag) to set system_config.tp_record_enable as 1;
In this case, when you call api_start_record, all ts data will record.

c) Change from PVR2 to PVR3, some initial work need to be update.


1) when system initial, pvr_attach(PPVR_MGR_CFG cfg, PPVR_CFG ini_param) should
be called.
2)INT32 pvr_register(UINT32 param1,UINT32 param2) will be called when usb mount.
Please refer to demo code.

Page 5 of 6
Acer Laboratories (Shanghai) Inc.: 6F Building 39, No.333 Qinjiang Road, Shanghai 200233, China.
Tel: +21-64855058. Fax: +21-64951498
Acer Labs Inc. Marketing Requirements Spec.

NOTES:
Other detail changes please refer to Ali SDK with code included by macro PVR3_SUPPORT.

Page 6 of 6
Acer Laboratories (Shanghai) Inc.: 6F Building 39, No.333 Qinjiang Road, Shanghai 200233, China.
Tel: +21-64855058. Fax: +21-64951498

You might also like