Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -b -u -r -N '--exclude=.git' linux-armhf/adapter/cdxalloc/cdxalloc.h linux-armel_new/adapter/cdxalloc/cdxalloc.h
- --- linux-armhf/adapter/cdxalloc/cdxalloc.h 1970-01-01 01:00:00.000000000 +0100
- +++ linux-armel_new/adapter/cdxalloc/cdxalloc.h 2013-06-19 12:18:14.000000000 +0200
- @@ -0,0 +1,21 @@
- +
- +#ifndef CDX_ALLOC_H
- +#define CDX_ALLOC_H
- +
- +#ifdef __cplusplus
- +extern "C" {
- +#endif
- +
- + int cdxalloc_open(void);
- + int cdxalloc_close(void);
- + void* cdxalloc_alloc(int size);
- + void cdxalloc_free(void* address);
- + unsigned int cdxalloc_vir2phy(void* address);
- +
- +
- +#ifdef __cplusplus
- +}
- +#endif
- +
- +#endif
- +
- diff -b -u -r -N '--exclude=.git' linux-armhf/adapter/libve_adapter.c linux-armel_new/adapter/libve_adapter.c
- --- linux-armhf/adapter/libve_adapter.c 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/adapter/libve_adapter.c 2013-06-19 12:18:14.000000000 +0200
- @@ -15,47 +15,16 @@
- #include "os_adapter.h"
- #include "vdecoder_config.h"
- #include <cedardev_api.h> //* you can find this header file in cedarX/CedarX/include/include_platform/CHIP_F20
- -#include "avheap.h"
- -
- -//****************************************************************************//
- -//************************ Instance of FBM Interface *************************//
- -//****************************************************************************//
- -IFBM_t gIFBM =
- -{
- - fbm_release,
- - fbm_decoder_request_frame,
- - fbm_decoder_return_frame,
- - fbm_decoder_share_frame,
- - fbm_init_ex
- -};
- +#include "cdxalloc.h"
- #define WALL_CLOCK_FREQ (50*1000)
- static signed long long wall_clock = 0;
- unsigned int avs_cnt_last = 0;
- -//****************************************************************************//
- -//************************ Instance of VBV Interface *************************//
- -//****************************************************************************//
- -
- -static void flush_stream_frame(vstream_data_t* stream, Handle vbv)
- -{
- - vbv_flush_stream_frame(stream, vbv);
- - libcedarv_free_vbs_buffer_sem(vbv_get_parent(vbv));
- -}
- -
- -IVBV_t gIVBV =
- -{
- - vbv_request_stream_frame,
- - vbv_return_stream_frame,
- - flush_stream_frame,
- - vbv_get_base_addr,
- - vbv_get_buffer_size
- -};
- -
- //****************************************************************************//
- //************************ Instance of OS Interface **************************//
- //****************************************************************************//
- -IOS_t gIOS =
- +IOS_t IOS =
- {
- //* Heap operation.
- mem_alloc,
- @@ -126,7 +95,7 @@
- pthread_mutex_init(&cedarv_osal_mutex, NULL);
- //* open CedarX memory manage library.
- - av_heap_init(cedarv_osal_ctx->fd);
- + cdxalloc_open();
- cedarv_request_ve_core();
- @@ -156,7 +125,7 @@
- cedarv_release_ve_core();
- //* close CedarX memory manage library.
- - av_heap_release();
- + cdxalloc_close();
- munmap((void *)cedarv_osal_ctx->env_info.address_macc, 2048);
- @@ -178,7 +147,7 @@
- static u32 ve_get_reg_base_addr(void);
- static memtype_e ve_get_memtype(void);
- -IVEControl_t gIVE =
- +IVEControl_t IVE =
- {
- ve_reset_hardware,
- ve_enable_clock,
- diff -b -u -r -N '--exclude=.git' linux-armhf/adapter/os_adapter.c linux-armel_new/adapter/os_adapter.c
- --- linux-armhf/adapter/os_adapter.c 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/adapter/os_adapter.c 2013-06-19 12:18:14.000000000 +0200
- @@ -10,7 +10,7 @@
- #include "vdecoder_config.h"
- //#include <cedarv_osal_linux.h>
- -#include <avheap.h>
- +#include <cdxalloc.h>
- #include <cedardev_api.h>
- #include <stdarg.h>
- @@ -34,13 +34,13 @@
- void* mem_palloc(u32 size, u32 align)
- {
- - return av_heap_alloc((u32)size);
- + return cdxalloc_alloc((u32)size);
- }
- void mem_pfree(void* p)
- {
- - av_heap_free(p);
- + cdxalloc_free(p);
- }
- @@ -68,7 +68,7 @@
- u32 mem_get_phy_addr(u32 virtual_addr)
- {
- - return av_heap_physic_addr((void*)virtual_addr);
- + return cdxalloc_vir2phy((void*)virtual_addr);
- }
- //*******************************************************//
- @@ -116,13 +116,14 @@
- //*******************************************************//
- s32 sys_print(u8* func, u32 line, ...)
- {
- - va_list args;
- -
- - va_start(args, line);
- -
- - AwVLog((char*)func, line, args);
- -
- - va_end(args);
- + //use other print function
- +// va_list args;
- +//
- +// va_start(args, line);
- +//
- +// AwVLog((char*)func, line, args);
- +//
- +// va_end(args);
- return 0;
- }
- diff -b -u -r -N '--exclude=.git' linux-armhf/commom_type.h linux-armel_new/commom_type.h
- --- linux-armhf/commom_type.h 1970-01-01 01:00:00.000000000 +0100
- +++ linux-armel_new/commom_type.h 2013-06-19 12:18:14.000000000 +0200
- @@ -0,0 +1,70 @@
- +
- +#ifndef COMMOM_TYPE_H
- +#define COMMOM_TYPE_H
- +
- +#ifdef __cplusplus
- +extern "C" {
- +#endif
- +
- +#include "libve_typedef.h"
- +//* define function prototype for frame buffer manage operation.
- +typedef Handle (*FBM_INIT_EX)(u32 max_frame_num, u32 min_frame_num, u32 size_y[], u32 size_u[], u32 size_v[],
- + u32 size_alpha[], _3d_mode_e out_3d_mode, pixel_format_e format, u8 , void* parent);
- +typedef Handle (*FBM_INIT_EX_YV12)(u32 max_frame_num, u32 min_frame_num, u32 size_y[], u32 size_u[], u32 size_v[],
- + u32 size_alpha[], _3d_mode_e out_3d_mode, pixel_format_e format, u8 , void* parent);
- +typedef Handle (*FBM_INIT_YV32)(u32 max_frame_num, u32 min_frame_num, u32 size_y[], u32 size_u[], u32 size_v[],
- + u32 size_alpha[], _3d_mode_e out_3d_mode, pixel_format_e format, u8 , void* parent);
- +typedef void (*FBM_RELEASE)(Handle h, void* parent);
- +typedef vpicture_t* (*FBM_REQUEST_FRAME)(Handle h);
- +typedef void (*FBM_RETURN_FRAME)(vpicture_t* frame, u8 valid, Handle h);
- +typedef void (*FBM_SHARE_FRAME)(vpicture_t* frame, Handle h);
- +typedef void (*FBM_FLUSH_FRAME)(Handle h, s64 pts);
- +typedef void (*FBM_PRINT_STATUS) (Handle h);
- +
- +
- +//* define function prototype for VBV bitstream manage opearation.
- +typedef vstream_data_t* (*VBV_REQUEST_BITSTREAM_FRAME)(Handle vbv);
- +typedef void (*VBV_RETURN_BITSTREAM_FRAME)(vstream_data_t* stream, Handle vbv);
- +typedef void (*VBV_FLUSH_BITSTREAM_FRAME)(vstream_data_t* vstream, Handle vbv);
- +typedef u8* (*VBV_GET_BASE_ADDR)(Handle vbv);
- +typedef u32 (*VBV_GET_SIZE)(Handle vbv);
- +
- +//*******************************************************//
- +//****** Functions for Frame Buffer Controlling. ********//
- +//*******************************************************//
- +typedef struct FRAME_BUFFER_MANAGE_INTERFACE
- +{
- + FBM_RELEASE fbm_release; //* release frame buffer manage module;
- + FBM_REQUEST_FRAME fbm_request_frame; //* decoder request one empty frame;
- + FBM_RETURN_FRAME fbm_return_frame; //* decoder return one valid or invalid frame;
- + FBM_SHARE_FRAME fbm_share_frame; //* decoder using the frame, but this frame should display now.
- + FBM_INIT_EX fbm_init_ex; //*
- + FBM_INIT_EX_YV12 fbm_init_ex_yv12;
- + FBM_INIT_YV32 fbm_init_yv32;
- + FBM_FLUSH_FRAME fbm_flush_frame;
- + FBM_PRINT_STATUS fbm_print_status;
- +}IFBM_t;
- +
- +
- +//*******************************************************//
- +//********** Functions for VBV Controlling. *************//
- +//*******************************************************//
- +typedef struct BITSTREAM_FRAME_MANAGE_INTERFACE
- +{
- + VBV_REQUEST_BITSTREAM_FRAME vbv_request_bitstream_frame;
- + VBV_RETURN_BITSTREAM_FRAME vbv_return_bitstream_frame;
- + VBV_FLUSH_BITSTREAM_FRAME vbv_flush_bitstream_frame;
- + VBV_GET_BASE_ADDR vbv_get_base_addr;
- + VBV_GET_SIZE vbv_get_size;
- +}IVBV_t;
- +
- +
- +extern IFBM_t IFBM;
- +extern IVBV_t IVBV;
- +
- +#ifdef __cplusplus
- +}
- +#endif
- +
- +#endif
- +
- diff -b -u -r -N '--exclude=.git' linux-armhf/drv_display_sun4i.h linux-armel_new/drv_display_sun4i.h
- --- linux-armhf/drv_display_sun4i.h 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/drv_display_sun4i.h 2013-06-19 12:18:14.000000000 +0200
- @@ -1,16 +1,13 @@
- #ifndef __DRV_DISPLAY_H__
- #define __DRV_DISPLAY_H__
- +#include "libve_types.h"
- #define __bool signed char
- -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- -#ifndef __BSP_DRV_DISPLAY_H__
- -#define __BSP_DRV_DISPLAY_H__
- -
- -typedef struct {unsigned char alpha; unsigned char red; unsigned char green; unsigned char blue; }__disp_color_t;
- -typedef struct {int x; int y; unsigned int width; unsigned int height;}__disp_rect_t;
- -typedef struct {unsigned int width;unsigned int height; }__disp_rectsz_t;
- -typedef struct {int x; int y; }__disp_pos_t;
- +typedef struct {__u8 alpha;__u8 red;__u8 green; __u8 blue; }__disp_color_t;
- +typedef struct {__s32 x; __s32 y; __u32 width; __u32 height;}__disp_rect_t;
- +typedef struct {__u32 width;__u32 height; }__disp_rectsz_t;
- +typedef struct {__s32 x; __s32 y; }__disp_pos_t;
- typedef enum
- @@ -39,17 +36,17 @@
- typedef enum
- {
- - DISP_MOD_INTERLEAVED =0x1, //interleaved,1个地å€
- - DISP_MOD_NON_MB_PLANAR =0x0, //æ— å®å—平颿¨¡å¼,3个地å€,RGB/YUVæ¯ä¸ªchannelåˆ†åˆ«å˜æ”¾
- - DISP_MOD_NON_MB_UV_COMBINED =0x2, //æ— å®å—UV打包模å¼,2个地å€,Yå’ŒUVåˆ†åˆ«å˜æ”¾
- - DISP_MOD_MB_PLANAR =0x4, //å®å—平颿¨¡å¼,3个地å€,RGB/YUVæ¯ä¸ªchannelåˆ†åˆ«å˜æ”¾
- - DISP_MOD_MB_UV_COMBINED =0x6, //å®å—UVæ‰“åŒ…æ¨¡å¼ ,2个地å€,Yå’ŒUVåˆ†åˆ«å˜æ”¾
- + DISP_MOD_INTERLEAVED =0x1, //interleaved,1¸öµØÖ·
- + DISP_MOD_NON_MB_PLANAR =0x0, //ÎÞºê¿éÆ½ÃæÄ£Ê½,3¸öµØÖ·,RGB/YUVÿ¸öchannel·Ö±ð´æ·Å
- + DISP_MOD_NON_MB_UV_COMBINED =0x2, //ÎÞºê¿éUV´ò°üģʽ,2¸öµØÖ·,YºÍUV·Ö±ð´æ·Å
- + DISP_MOD_MB_PLANAR =0x4, //ºê¿éÆ½ÃæÄ£Ê½,3¸öµØÖ·,RGB/YUVÿ¸öchannel·Ö±ð´æ·Å
- + DISP_MOD_MB_UV_COMBINED =0x6, //ºê¿éUV´ò°üģʽ ,2¸öµØÖ·,YºÍUV·Ö±ð´æ·Å
- }__disp_pixel_mod_t;
- typedef enum
- {
- //for interleave argb8888
- - DISP_SEQ_ARGB =0x0,//A在高ä½
- + DISP_SEQ_ARGB =0x0,//AÔÚ¸ßλ
- DISP_SEQ_BGRA =0x2,
- //for nterleaved yuv422
- @@ -67,12 +64,12 @@
- DISP_SEQ_VUVU =0xa,
- //for 16bpp rgb
- - DISP_SEQ_P10 = 0xd,//p1在高ä½
- - DISP_SEQ_P01 = 0xe,//p0在高ä½
- + DISP_SEQ_P10 = 0xd,//p1ÔÚ¸ßλ
- + DISP_SEQ_P01 = 0xe,//p0ÔÚ¸ßλ
- //for planar format or 8bpp rgb
- - DISP_SEQ_P3210 = 0xf,//p3在高ä½
- - DISP_SEQ_P0123 = 0x10,//p0在高ä½
- + DISP_SEQ_P3210 = 0xf,//p3ÔÚ¸ßλ
- + DISP_SEQ_P0123 = 0x10,//p0ÔÚ¸ßλ
- //for 4bpp rgb
- DISP_SEQ_P76543210 = 0x11,
- @@ -96,7 +93,7 @@
- typedef enum
- {
- DISP_3D_SRC_MODE_TB = 0x0,//top bottom
- - DISP_3D_SRC_MODE_FP = 0x1,//frame packing
- + DISP_3D_SRC_MODE_FP = 0x1,//frame packing,left and right picture in separate address
- DISP_3D_SRC_MODE_SSF = 0x2,//side by side full
- DISP_3D_SRC_MODE_SSH = 0x3,//side by side half
- DISP_3D_SRC_MODE_LI = 0x4,//line interleaved
- @@ -104,14 +101,12 @@
- typedef enum
- {
- - //for lcd
- DISP_3D_OUT_MODE_CI_1 = 0x5,//column interlaved 1
- DISP_3D_OUT_MODE_CI_2 = 0x6,//column interlaved 2
- DISP_3D_OUT_MODE_CI_3 = 0x7,//column interlaved 3
- DISP_3D_OUT_MODE_CI_4 = 0x8,//column interlaved 4
- DISP_3D_OUT_MODE_LIRGB = 0x9,//line interleaved rgb
- - //for hdmi
- DISP_3D_OUT_MODE_TB = 0x0,//top bottom
- DISP_3D_OUT_MODE_FP = 0x1,//frame packing
- DISP_3D_OUT_MODE_SSF = 0x2,//side by side full
- @@ -130,6 +125,13 @@
- typedef enum
- {
- + DISP_COLOR_RANGE_16_255 = 0,
- + DISP_COLOR_RANGE_0_255 = 1,
- + DISP_COLOR_RANGE_16_235 = 2,
- +}__disp_color_range_t;
- +
- +typedef enum
- +{
- DISP_OUTPUT_TYPE_NONE = 0,
- DISP_OUTPUT_TYPE_LCD = 1,
- DISP_OUTPUT_TYPE_TV = 2,
- @@ -159,6 +161,10 @@
- DISP_TV_MOD_1080P_50HZ = 9,
- DISP_TV_MOD_1080P_60HZ = 0xa,
- DISP_TV_MOD_1080P_24HZ_3D_FP = 0x17,
- + DISP_TV_MOD_720P_50HZ_3D_FP = 0x18,
- + DISP_TV_MOD_720P_60HZ_3D_FP = 0x19,
- + DISP_TV_MOD_1080P_25HZ = 0x1a,
- + DISP_TV_MOD_1080P_30HZ = 0x1b,
- DISP_TV_MOD_PAL = 0xb,
- DISP_TV_MOD_PAL_SVIDEO = 0xc,
- DISP_TV_MOD_NTSC = 0xe,
- @@ -167,7 +173,7 @@
- DISP_TV_MOD_PAL_M_SVIDEO = 0x12,
- DISP_TV_MOD_PAL_NC = 0x14,
- DISP_TV_MOD_PAL_NC_SVIDEO = 0x15,
- - DISP_TV_MODE_NUM = 0x18,
- + DISP_TV_MODE_NUM = 0x1c,
- }__disp_tv_mode_t;
- typedef enum
- @@ -261,6 +267,14 @@
- DISP_EXIT_MODE_CLEAN_PARTLY = 1,//only clean interrupt temply
- }__disp_exit_mode_t;
- +typedef enum
- +{
- + DISP_OUT_CSC_TYPE_LCD = 0,
- + DISP_OUT_CSC_TYPE_TV = 1,
- + DISP_OUT_CSC_TYPE_HDMI_YUV = 2,
- + DISP_OUT_CSC_TYPE_VGA = 3,
- + DISP_OUT_CSC_TYPE_HDMI_RGB = 4,
- +}__disp_out_csc_type_t;
- typedef enum//only for debug!!!
- {
- @@ -277,10 +291,11 @@
- DISP_REG_PWM = 10,
- }__disp_reg_index_t;
- +
- typedef struct
- {
- - unsigned int addr[3]; // frame buffer的内容地å€ï¼Œå¯¹äºŽrgbç±»åž‹ï¼Œåªæœ‰addr[0]有效
- - __disp_rectsz_t size;//å•使˜¯pixel
- + __u32 addr[3]; // frame bufferµÄÄÚÈݵØÖ·£¬¶ÔÓÚrgbÀàÐÍ£¬Ö»ÓÐaddr[0]ÓÐЧ
- + __disp_rectsz_t size;//µ¥Î»ÊÇpixel
- __disp_pixel_fmt_t format;
- __disp_pixel_seq_t seq;
- __disp_pixel_mod_t mode;
- @@ -288,17 +303,17 @@
- __disp_cs_mode_t cs_mode; //color space
- __bool b_trd_src; //if 3d source, used for scaler mode layer
- __disp_3d_src_mode_t trd_mode; //source 3d mode, used for scaler mode layer
- - unsigned int trd_right_addr[3];//used when in frame packing 3d mode
- + __u32 trd_right_addr[3];//used when in frame packing 3d mode
- }__disp_fb_t;
- typedef struct
- {
- __disp_layer_work_mode_t mode; //layer work mode
- __bool b_from_screen;
- - unsigned char pipe; //layer pipe,0/1,if in scaler mode, scaler0 must be pipe0, scaler1 must be pipe1
- - unsigned char prio; //layer priority,can get layer prio,but never set layer prio,从底至顶,优先级由低至高
- + __u8 pipe; //layer pipe,0/1,if in scaler mode, scaler0 must be pipe0, scaler1 must be pipe1
- + __u8 prio; //layer priority,can get layer prio,but never set layer prio,´Óµ×ÖÁ¶¥,ÓÅÏȼ¶ÓɵÍÖÁ¸ß
- __bool alpha_en; //layer global alpha enable
- - unsigned short alpha_val; //layer global alpha value
- + __u16 alpha_val; //layer global alpha value
- __bool ck_enable; //layer color key enable
- __disp_rect_t src_win; // framebuffer source window,only care x,y if is not scaler mode
- __disp_rect_t scn_win; // screen window
- @@ -311,21 +326,21 @@
- {
- __disp_color_t ck_max;
- __disp_color_t ck_min;
- - unsigned int red_match_rule;//0/1:always match; 2:match if min<=color<=max; 3:match if color>max or color<min
- - unsigned int green_match_rule;//0/1:always match; 2:match if min<=color<=max; 3:match if color>max or color<min
- - unsigned int blue_match_rule;//0/1:always match; 2:match if min<=color<=max; 3:match if color>max or color<min
- + __u32 red_match_rule;//0/1:always match; 2:match if min<=color<=max; 3:match if color>max or color<min
- + __u32 green_match_rule;//0/1:always match; 2:match if min<=color<=max; 3:match if color>max or color<min
- + __u32 blue_match_rule;//0/1:always match; 2:match if min<=color<=max; 3:match if color>max or color<min
- }__disp_colorkey_t;
- typedef struct
- {
- - int id;
- - unsigned int addr[3];
- - unsigned int addr_right[3];//used when in frame packing 3d mode
- + __s32 id;
- + __u32 addr[3];
- + __u32 addr_right[3];//used when in frame packing 3d mode
- __bool interlace;
- __bool top_field_first;
- - unsigned int frame_rate; // *FRAME_RATE_BASE(现在定为1000)
- - unsigned int flag_addr;//dit maf flag address
- - unsigned int flag_stride;//dit maf flag line stride
- + __u32 frame_rate; // *FRAME_RATE_BASE(ÏÖÔÚ¶¨Îª1000)
- + __u32 flag_addr;//dit maf flag address
- + __u32 flag_stride;//dit maf flag line stride
- __bool maf_valid;
- __bool pre_frame_valid;
- }__disp_video_fb_t;
- @@ -339,7 +354,7 @@
- typedef struct
- {
- __disp_hwc_mode_t pat_mode;
- - unsigned int addr;
- + __u32 addr;
- }__disp_hwc_pattern_t;
- typedef struct
- @@ -347,7 +362,7 @@
- __disp_fb_t input_fb;
- __disp_rect_t source_regn;
- __disp_fb_t output_fb;
- - //__disp_rect_t out_regn;
- + __disp_rect_t out_regn;
- }__disp_scaler_para_t;
- typedef struct
- @@ -365,128 +380,146 @@
- typedef struct
- {
- - int (*Hdmi_open)(void);
- - int (*Hdmi_close)(void);
- - int (*hdmi_set_mode)(__disp_tv_mode_t mode);
- - int (*hdmi_mode_support)(__disp_tv_mode_t mode);
- - int (*hdmi_get_HPD_status)(void);
- - int (*hdmi_set_pll)(unsigned int pll, unsigned int clk);
- + __s32 (*Hdmi_open)(void);
- + __s32 (*Hdmi_close)(void);
- + __s32 (*hdmi_set_mode)(__disp_tv_mode_t mode);
- + __s32 (*hdmi_mode_support)(__disp_tv_mode_t mode);
- + __s32 (*hdmi_get_HPD_status)(void);
- + __s32 (*hdmi_set_pll)(__u32 pll, __u32 clk);
- + __s32 (*hdmi_dvi_enable)(__u32 mode);
- + __s32 (*hdmi_dvi_support)(void);
- + __s32 (*hdmi_get_input_csc)(void);
- + __s32 (*hdmi_suspend)(void);
- + __s32 (*hdmi_resume)(void);
- }__disp_hdmi_func;
- typedef struct
- {
- - unsigned int lcd_x;
- - unsigned int lcd_y;
- - unsigned int lcd_dclk_freq;
- - unsigned int lcd_pwm_not_used;
- - unsigned int lcd_pwm_ch;
- - unsigned int lcd_pwm_freq;
- - unsigned int lcd_pwm_pol;
- - unsigned int lcd_srgb;
- - unsigned int lcd_swap;
- -
- - unsigned int lcd_if; //0:hv(sync+de); 1:8080; 2:ttl; 3:lvds
- -
- - unsigned int lcd_uf;
- - unsigned int lcd_vt;
- - unsigned int lcd_ht;
- - unsigned int lcd_vbp;
- - unsigned int lcd_hbp;
- -
- - unsigned int lcd_hv_if;
- - unsigned int lcd_hv_smode;
- - unsigned int lcd_hv_s888_if;
- - unsigned int lcd_hv_syuv_if;
- - unsigned int lcd_hv_vspw;
- - unsigned int lcd_hv_hspw;
- - unsigned int lcd_hv_lde_used;
- - unsigned int lcd_hv_lde_iovalue;
- -
- - unsigned int lcd_ttl_stvh;
- - unsigned int lcd_ttl_stvdl;
- - unsigned int lcd_ttl_stvdp;
- - unsigned int lcd_ttl_ckvt;
- - unsigned int lcd_ttl_ckvh;
- - unsigned int lcd_ttl_ckvd;
- - unsigned int lcd_ttl_oevt;
- - unsigned int lcd_ttl_oevh;
- - unsigned int lcd_ttl_oevd;
- - unsigned int lcd_ttl_sthh;
- - unsigned int lcd_ttl_sthd;
- - unsigned int lcd_ttl_oehh;
- - unsigned int lcd_ttl_oehd;
- - unsigned int lcd_ttl_revd;
- - unsigned int lcd_ttl_datarate;
- - unsigned int lcd_ttl_revsel;
- - unsigned int lcd_ttl_datainv_en;
- - unsigned int lcd_ttl_datainv_sel;
- -
- - unsigned int lcd_lvds_ch; // 0: single channel; 1:dual channel
- - unsigned int lcd_lvds_mode; // 0:NS mode; 1:JEIDA mode
- - unsigned int lcd_lvds_bitwidth; // 0:24bit; 1:18bit
- - unsigned int lcd_lvds_io_cross; // 0:normal; 1:pn cross
- -
- - unsigned int lcd_cpu_if;//0:18bit; 1:16bit mode0; 2:16bit mode1; 3:16bit mode2; 4:16bit mode3; 5:9bit; 6:8bit 256K; 7:8bit 65K
- - unsigned int lcd_cpu_da;
- - unsigned int lcd_frm;
- -
- - unsigned int lcd_io_cfg0;
- - unsigned int lcd_io_cfg1;
- - unsigned int lcd_io_strength;
- -
- - unsigned int lcd_gamma_correction_en;
- - unsigned int lcd_gamma_tbl[256];
- -
- - unsigned int lcd_hv_srgb_seq0;
- - unsigned int lcd_hv_srgb_seq1;
- - unsigned int lcd_hv_syuv_seq;
- - unsigned int lcd_hv_syuv_fdly;
- -
- - unsigned int port_index;
- - unsigned int start_delay;//not need to config for user
- - unsigned int tcon_index; //not need to config for user
- + __u32 lcd_x;
- + __u32 lcd_y;
- + __u32 lcd_dclk_freq;
- + __u32 lcd_pwm_not_used;
- + __u32 lcd_pwm_ch;
- + __u32 lcd_pwm_freq;
- + __u32 lcd_pwm_pol;
- + __u32 lcd_srgb;
- + __u32 lcd_swap;
- +
- + __u32 lcd_if; //0:hv(sync+de); 1:8080; 2:ttl; 3:lvds
- +
- + __u32 lcd_uf;
- + __u32 lcd_vt;
- + __u32 lcd_ht;
- + __u32 lcd_vbp;
- + __u32 lcd_hbp;
- +
- + __u32 lcd_hv_if;
- + __u32 lcd_hv_smode;
- + __u32 lcd_hv_s888_if;
- + __u32 lcd_hv_syuv_if;
- + __u32 lcd_hv_vspw;
- + __u32 lcd_hv_hspw;
- + __u32 lcd_hv_lde_used;
- + __u32 lcd_hv_lde_iovalue;
- +
- + __u32 lcd_ttl_stvh;
- + __u32 lcd_ttl_stvdl;
- + __u32 lcd_ttl_stvdp;
- + __u32 lcd_ttl_ckvt;
- + __u32 lcd_ttl_ckvh;
- + __u32 lcd_ttl_ckvd;
- + __u32 lcd_ttl_oevt;
- + __u32 lcd_ttl_oevh;
- + __u32 lcd_ttl_oevd;
- + __u32 lcd_ttl_sthh;
- + __u32 lcd_ttl_sthd;
- + __u32 lcd_ttl_oehh;
- + __u32 lcd_ttl_oehd;
- + __u32 lcd_ttl_revd;
- + __u32 lcd_ttl_datarate;
- + __u32 lcd_ttl_revsel;
- + __u32 lcd_ttl_datainv_en;
- + __u32 lcd_ttl_datainv_sel;
- +
- + __u32 lcd_lvds_ch; // 0: single channel; 1:dual channel
- + __u32 lcd_lvds_mode; // 0:NS mode; 1:JEIDA mode
- + __u32 lcd_lvds_bitwidth; // 0:24bit; 1:18bit
- + __u32 lcd_lvds_io_cross; // 0:normal; 1:pn cross
- +
- + __u32 lcd_cpu_if;//0:18bit; 1:16bit mode0; 2:16bit mode1; 3:16bit mode2; 4:16bit mode3; 5:9bit; 6:8bit 256K; 7:8bit 65K
- + __u32 lcd_cpu_da;
- + __u32 lcd_frm;
- +
- + __u32 lcd_io_cfg0;
- + __u32 lcd_io_cfg1;
- + __u32 lcd_io_strength;
- +
- + __u32 lcd_gamma_correction_en;
- + __u32 lcd_gamma_tbl[256];
- +
- + __u32 lcd_hv_srgb_seq0;
- + __u32 lcd_hv_srgb_seq1;
- + __u32 lcd_hv_syuv_seq;
- + __u32 lcd_hv_syuv_fdly;
- +
- + __u32 port_index;
- + __u32 start_delay;//not need to config for user
- + __u32 tcon_index; //not need to config for user
- }__panel_para_t;
- typedef struct
- {
- - unsigned int base_lcdc0;
- - unsigned int base_lcdc1;
- - unsigned int base_pioc;
- - unsigned int base_ccmu;
- - unsigned int base_pwm;
- + __u32 pixel_clk;//khz
- + __u32 hor_pixels;
- + __u32 ver_pixels;
- + __u32 hor_total_time;
- + __u32 hor_front_porch;
- + __u32 hor_sync_time;
- + __u32 hor_back_porch;
- + __u32 ver_total_time;
- + __u32 ver_front_porch;
- + __u32 ver_sync_time;
- + __u32 ver_back_porch;
- +}__disp_tcon_timing_t;
- +
- +typedef struct
- +{
- + __u32 base_lcdc0;
- + __u32 base_lcdc1;
- + __u32 base_pioc;
- + __u32 base_ccmu;
- + __u32 base_pwm;
- }__reg_bases_t;
- -typedef void (*LCD_FUNC) (unsigned int sel);
- +typedef void (*LCD_FUNC) (__u32 sel);
- typedef struct lcd_function
- {
- LCD_FUNC func;
- - unsigned int delay;//ms
- + __u32 delay;//ms
- }__lcd_function_t;
- typedef struct lcd_flow
- {
- __lcd_function_t func[5];
- - unsigned int func_num;
- + __u32 func_num;
- + __u32 cur_step;
- }__lcd_flow_t;
- typedef struct
- {
- void (*cfg_panel_info)(__panel_para_t * info);
- - int (*cfg_open_flow)(unsigned int sel);
- - int (*cfg_close_flow)(unsigned int sel);
- - int (*lcd_user_defined_func)(unsigned int sel, unsigned int para1, unsigned int para2, unsigned int para3);
- + __s32 (*cfg_open_flow)(__u32 sel);
- + __s32 (*cfg_close_flow)(__u32 sel);
- + __s32 (*lcd_user_defined_func)(__u32 sel, __u32 para1, __u32 para2, __u32 para3);
- }__lcd_panel_fun_t;
- typedef struct
- {
- __bool enable;
- - unsigned int active_state;
- - unsigned int duty_ns;
- - unsigned int period_ns;
- + __u32 active_state;
- + __u32 duty_ns;
- + __u32 period_ns;
- }__pwm_info_t;
- -
- -#endif
- -
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- typedef enum
- @@ -494,29 +527,29 @@
- FB_MODE_SCREEN0 = 0,
- FB_MODE_SCREEN1 = 1,
- FB_MODE_DUAL_SAME_SCREEN_TB = 2,//two screen, top buffer for screen0, bottom buffer for screen1
- - FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS = 3,//two screen, they have same contents;
- + FB_MODE_SCREEN0_PARTLY = 3,
- }__fb_mode_t;
- typedef struct
- {
- __fb_mode_t fb_mode;
- __disp_layer_work_mode_t mode;
- - unsigned int buffer_num;
- - unsigned int width;
- - unsigned int height;
- -
- - unsigned int output_width;//used when scaler mode
- - unsigned int output_height;//used when scaler mode
- -
- - unsigned int primary_screen_id;//used when FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS
- - unsigned int aux_output_width;//used when FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS
- - unsigned int aux_output_height;//used when FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS
- + __u32 buffer_num;
- + __u32 width;
- + __u32 height;
- +
- + __u32 output_width;//used when scaler mode
- + __u32 output_height;//used when scaler mode
- +
- + __u32 primary_screen_id;//used when FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS
- + __u32 aux_output_width;//used when FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS
- + __u32 aux_output_height;//used when FB_MODE_DUAL_DIFF_SCREEN_SAME_CONTENTS
- //maybe not used anymore
- - unsigned int line_length;//in byte unit
- - unsigned int smem_len;
- - unsigned int ch1_offset;//use when PLANAR or UV_COMBINED mode
- - unsigned int ch2_offset;//use when PLANAR mode
- + __u32 line_length;//in byte unit
- + __u32 smem_len;
- + __u32 ch1_offset;//use when PLANAR or UV_COMBINED mode
- + __u32 ch2_offset;//use when PLANAR mode
- }__disp_fb_create_para_t;
- typedef enum
- @@ -525,14 +558,14 @@
- DISP_INIT_MODE_SCREEN1 = 1,//fb0 for screen1
- DISP_INIT_MODE_TWO_DIFF_SCREEN = 2,//fb0 for screen0 and fb1 for screen1
- DISP_INIT_MODE_TWO_SAME_SCREEN = 3,//fb0(up buffer for screen0, down buffer for screen1)
- - DISP_INIT_MODE_TWO_DIFF_SCREEN_SAME_CONTENTS = 4,//fb0 for two different screen(screen0 layer is normal layer, screen1 layer is scaler layer);
- + DISP_INIT_MODE_SCREEN0_GPU = 4,//fb0(fb size fix to 1920*1080,but the source window is variable according to the output)
- }__disp_init_mode_t;
- typedef struct
- {
- __bool b_init;
- - __disp_init_mode_t disp_mode;//0:single screen0(fb0); 1:single screen1(fb0); 2:dual diff screen(fb0, fb1); 3:dual same screen(fb0 up and down); 4:dual diff screen same contents(fb0)
- + __disp_init_mode_t disp_mode;
- //for screen0 and screen1
- __disp_output_type_t output_type[2];
- @@ -540,7 +573,7 @@
- __disp_vga_mode_t vga_mode[2];
- //for fb0 and fb1
- - unsigned int buffer_num[2];
- + __u32 buffer_num[2];
- __bool scaler_mode[2];
- __disp_pixel_fmt_t format[2];
- __disp_pixel_seq_t seq[2];
- @@ -583,6 +616,15 @@
- DISP_CMD_CAPTURE_SCREEN = 0x20,//caputre screen and scaler to dram
- DISP_CMD_DE_FLICKER_ON = 0x21,
- DISP_CMD_DE_FLICKER_OFF = 0x22,
- + DISP_CMD_GET_DE_FLICKER_EN = 0x23,
- + DISP_CMD_DRC_ON = 0x24,
- + DISP_CMD_DRC_OFF = 0x25,
- + DISP_CMD_GET_DRC_EN = 0x26,
- + DISP_CMD_DE_FLICKER_SET_WINDOW = 0x27,
- + DISP_CMD_DRC_SET_WINDOW = 0x28,
- + DISP_CMD_SET_HUE = 0x29,
- + DISP_CMD_GET_HUE = 0x2a,
- + DISP_CMD_VSYNC_EVENT_EN = 0x2b,
- //----layer----
- DISP_CMD_LAYER_REQUEST = 0x40,
- @@ -612,10 +654,10 @@
- DISP_CMD_LAYER_GET_PRIO = 0x58,
- DISP_CMD_LAYER_SET_SMOOTH = 0x59,
- DISP_CMD_LAYER_GET_SMOOTH = 0x5a,
- - DISP_CMD_LAYER_SET_BRIGHT = 0x5b,//亮度
- - DISP_CMD_LAYER_SET_CONTRAST = 0x5c,//对比度
- - DISP_CMD_LAYER_SET_SATURATION = 0x5d,//饱和度
- - DISP_CMD_LAYER_SET_HUE = 0x5e,//色调,色度
- + DISP_CMD_LAYER_SET_BRIGHT = 0x5b,//ÁÁ¶È
- + DISP_CMD_LAYER_SET_CONTRAST = 0x5c,//¶Ô±È¶È
- + DISP_CMD_LAYER_SET_SATURATION = 0x5d,//±¥ºÍ¶È
- + DISP_CMD_LAYER_SET_HUE = 0x5e,//É«µ÷,É«¶È
- DISP_CMD_LAYER_GET_BRIGHT = 0x5f,
- DISP_CMD_LAYER_GET_CONTRAST = 0x60,
- DISP_CMD_LAYER_GET_SATURATION = 0x61,
- @@ -639,6 +681,7 @@
- DISP_CMD_SCALER_REQUEST = 0x80,
- DISP_CMD_SCALER_RELEASE = 0x81,
- DISP_CMD_SCALER_EXECUTE = 0x82,
- + DISP_CMD_SCALER_EXECUTE_EX = 0x83,
- //----hwc----
- DISP_CMD_HWC_OPEN = 0xc0,
- @@ -678,6 +721,7 @@
- DISP_CMD_TV_GET_DAC_STATUS = 0x188,
- DISP_CMD_TV_SET_DAC_SOURCE = 0x189,
- DISP_CMD_TV_GET_DAC_SOURCE = 0x18a,
- + DISP_CMD_TV_NOTCH_FILTER_ON = 0x18b,
- //----hdmi----
- DISP_CMD_HDMI_ON = 0x1c0,
- diff -b -u -r -N '--exclude=.git' linux-armhf/fbm/fbm.c linux-armel_new/fbm/fbm.c
- --- linux-armhf/fbm/fbm.c 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/fbm/fbm.c 2013-06-19 12:18:14.000000000 +0200
- @@ -1,8 +1,16 @@
- -
- +/*
- + * Nerver use log machanism defined in awprintf.h
- + * when debuging in case of multi process.
- + * Use LOGX defined by Android.
- + */
- +//#define LOG_NDEBUG 0
- +//#define LOG_TAG "fbm"
- +//#include <CDX_Debug.h>
- #include "fbm.h"
- -#include "vdecoder_config.h"
- -#include "vdecoder.h"
- +//#include "vdecoder_config.h"
- +//#include "vdecoder.h"
- +#include "commom_type.h"
- #include "awprintf.h"
- static void fbm_enqueue(frame_info_t** pp_head, frame_info_t* p);
- @@ -13,10 +21,9 @@
- static void unlock(fbm_t* fbm);
- -#if 0
- -void print_fbm_status(Handle h)
- +void fbm_print_status(Handle h)
- {
- - const u8* status_string[5] =
- + const char* status_string[5] =
- {
- "FS_EMPTY",
- "FS_DECODER_USING",
- @@ -26,44 +33,41 @@
- };
- fbm_t* fbm;
- - frame_info_t* p;
- u32 i;
- -
- fbm = (fbm_t*)h;
- #if 0
- - LOGV(" empty queue:\n");
- + frame_info_t* p;
- + Log(" empty queue:\n");
- p = fbm->empty_queue;
- while(p)
- {
- - LOGV(" frame %d, status = %s.\n", p->picture.id, status_string[p->status]);
- + Log(" frame %d, status = %s.\n", p->picture.id, status_string[p->status]);
- p = p->next;
- }
- - LOGV("\n");
- + Log("\n");
- - LOGV(" display queue:\n");
- + Log(" display queue:\n");
- p = fbm->display_queue;
- while(p)
- {
- - LOGV(" frame %d, status = %s.\n", p->picture.id, status_string[p->status]);
- + Log(" frame %d, status = %s.\n", p->picture.id, status_string[p->status]);
- p = p->next;
- }
- - LOGV("\n");
- + Log("\n");
- #endif
- - LOGV(" total queue:\n");
- + printf(" total queue:\n");
- for(i=0; i<fbm->max_frame_num; i++)
- {
- - LOGV("frame=%x,frame %d, status = %s.\n", &(fbm->frames[i].picture), fbm->frames[i].picture.id, status_string[fbm->frames[i].status]);
- + printf("frame=%p, frame %d, status = %s.\n", &(fbm->frames[i].picture), fbm->frames[i].picture.id, status_string[fbm->frames[i].status]);
- }
- - LOGV("\n");
- + printf("\n");
- }
- -#endif
- -
- static s32 fbm_alloc_frame_buffer(vpicture_t* picture)
- {
- @@ -137,6 +141,126 @@
- return -1;
- }
- +s32 fbm_alloc_yv32_frame_buffer(vpicture_t* picture)
- +{
- + picture->y = NULL;
- + picture->u = NULL;
- + picture->v = NULL;
- + picture->alpha = NULL;
- +
- + picture->y2 = NULL;
- + picture->v2 = NULL;
- + picture->u2 = NULL;
- + picture->alpha2 = NULL;
- +
- +
- + if(picture->size_y != 0)
- + {
- + picture->y = (u8*)mem_palloc(picture->size_y, 1024);
- + if(picture->y == NULL)
- + goto _exit;
- +
- + }
- +
- + if(picture->size_u != 0)
- + {
- + picture->u = (u8*)mem_palloc(picture->size_u, 1024);
- + if(picture->u == NULL)
- + {
- + goto _exit;
- + }
- + }
- +
- + if(picture->size_v != 0)
- + {
- + picture->v = (u8*)mem_palloc(picture->size_v, 1024);
- + if(picture->v == NULL)
- + {
- + goto _exit;
- + }
- + }
- +
- + if(picture->size_alpha != 0)
- + {
- + picture->alpha = (u8*)mem_palloc(picture->size_alpha, 1024);
- + if(picture->alpha == NULL)
- + {
- + goto _exit;
- + }
- + }
- +
- + if(picture->size_y2 != 0)
- + {
- + picture->y2 = (u8*)mem_palloc(picture->size_y2 + picture->size_u2, 16);
- + if(picture->y2 == NULL)
- + goto _exit;
- +
- + }
- +
- + return 0;
- +
- +_exit:
- + if(picture->v != NULL)
- + {
- + mem_pfree(picture->v);
- + picture->v = NULL;
- + }
- + if(picture->u != NULL)
- + {
- + mem_pfree(picture->u);
- + picture->u = NULL;
- + }
- + if(picture->y != NULL)
- + {
- + mem_pfree(picture->y);
- + picture->y = NULL;
- + }
- + if(picture->alpha != NULL){
- + mem_pfree(picture->alpha);
- + picture->alpha = NULL;
- + }
- + if(picture->y2 != NULL)
- + {
- + mem_pfree(picture->y2);
- + picture->y2 = NULL;
- + }
- + return -1;
- +}
- +
- +//mickey
- +static s32 fbm_alloc_yv12_frame_buffer(vpicture_t* picture)
- +{
- + picture->y = NULL;
- + picture->u = NULL;
- + picture->v = NULL;
- + picture->alpha = NULL;
- +
- + picture->y2 = NULL;
- + picture->v2 = NULL;
- + picture->u2 = NULL;
- + picture->alpha2 = NULL;
- +
- + if(picture->size_y != 0)
- + {
- + picture->y = (u8*)mem_palloc(picture->size_y + picture->size_u*2, 16);
- + if(picture->y == NULL)
- + goto _exit;
- +
- + }
- +
- + return 0;
- +
- +_exit:
- +
- + if(picture->y != NULL)
- + {
- + mem_pfree(picture->y);
- + picture->y = NULL;
- + }
- +
- + return -1;
- +}
- +
- s32 fbm_free_redBlue_frame_buffer(Handle h)
- {
- u32 i = 0;
- @@ -252,7 +376,74 @@
- return 0;
- }
- +s32 fbm_free_YV12_frame_buffer(Handle h)
- +{
- + u32 i = 0;
- + fbm_t* fbm = NULL;
- + vpicture_t* picture = NULL;
- +
- + fbm = (fbm_t*)h;
- +
- + if (lock(fbm) != 0)
- + {
- + return -1;
- + }
- + for(i=0; i<fbm->max_frame_num; i++)
- + {
- + picture = &fbm->frames[i].picture;
- + if(picture->y2 != NULL)
- + {
- + mem_pfree(picture->y2);
- + picture->y2 = NULL;
- + }
- + }
- + unlock(fbm);
- + return 0;
- +}
- +
- +s32 fbm_alloc_YV12_frame_buffer(Handle h)
- +{
- + s32 i = 0;
- + fbm_t* fbm = NULL;
- + vpicture_t* picture = NULL;
- +
- + fbm = (fbm_t*)h;
- +
- + if(fbm == NULL)
- + return -1;
- +
- + if(lock(fbm) != 0)
- + {
- + return -1;
- + }
- + picture = &fbm->frames[0].picture;
- + if(picture->y2!=NULL)
- + {
- + unlock(fbm);
- + return 0;
- + }
- +
- + for(i=0; i<(s32)fbm->max_frame_num; i++)
- + {
- + picture = &fbm->frames[i].picture;
- + if(picture->size_y2 != 0)
- + {
- + picture->y2 = (u8*)mem_palloc(picture->size_y2 + picture->size_u2, 16);
- + if(picture->y2 == NULL)
- + break;
- + }
- + }
- +
- + if(i <(s32)fbm->max_frame_num)
- + {
- + unlock(fbm);
- + fbm_free_YV12_frame_buffer(h);
- + return -1;
- + }
- + unlock(fbm);
- + return 0;
- +}
- static s32 fbm_free_frame_buffer(vpicture_t* picture)
- {
- @@ -315,12 +506,17 @@
- u32 size_alpha[2],
- _3d_mode_e out_3d_mode,
- pixel_format_e format,
- + u8 is_preview_mode,
- void* parent)
- {
- s32 i;
- fbm_t* fbm;
- - video_decoder_t* decoder;
- + //video_decoder_t* decoder;
- +
- +
- + if(size_y[0] >= (480*272))
- + max_frame_num = min_frame_num;
- if(max_frame_num < min_frame_num)
- {
- @@ -338,16 +534,27 @@
- return NULL;
- }
- mem_set(fbm, 0, sizeof(fbm_t));
- +
- +#if 0
- libve_io_ctrl(LIBVE_COMMAND_GET_PARENT, (u32)&decoder, parent);
- if(decoder == NULL)
- {
- mem_free(fbm);
- }
- +
- if(decoder->status == CEDARV_STATUS_PREVIEW)
- {
- - max_frame_num = 1;
- - min_frame_num = 1;
- + max_frame_num = 2;
- + min_frame_num = 2;
- + }
- +#else
- + if(is_preview_mode)
- + {
- + max_frame_num = 2;
- + min_frame_num = 2;
- }
- +
- +#endif
- //* alloc memory frame buffer.
- for(i=0; i<(s32)max_frame_num; i++)
- {
- @@ -404,6 +611,230 @@
- return (Handle)fbm;
- }
- +Handle fbm_init_ex_yv12(u32 max_frame_num,
- + u32 min_frame_num,
- + u32 size_y[2],
- + u32 size_u[2],
- + u32 size_v[2],
- + u32 size_alpha[2],
- + _3d_mode_e out_3d_mode,
- + pixel_format_e format,
- + u8 is_preview_mode,
- + void* parent)
- +
- +{
- + s32 i;
- + fbm_t* fbm;
- + //video_decoder_t* decoder;
- +
- + if(size_y[0] >= (480*272))
- + max_frame_num = min_frame_num;
- + if(max_frame_num < min_frame_num)
- + {
- + max_frame_num = min_frame_num;
- + }
- + if(min_frame_num > FBM_MAX_FRAME_NUM)
- + return NULL;
- +
- + if(max_frame_num > FBM_MAX_FRAME_NUM)
- + max_frame_num = FBM_MAX_FRAME_NUM;
- +
- + fbm = (fbm_t*) mem_alloc(sizeof(fbm_t));
- + if(!fbm)
- + {
- + return NULL;
- + }
- + mem_set(fbm, 0, sizeof(fbm_t));
- +
- +#if 0
- + libve_io_ctrl(LIBVE_COMMAND_GET_PARENT, (u32)&decoder, parent);
- + if(decoder == NULL)
- + {
- + mem_free(fbm);
- + }
- +
- + if(decoder->status == CEDARV_STATUS_PREVIEW)
- + {
- + max_frame_num = 2;
- + min_frame_num = 2;
- + }
- +#else
- + if(is_preview_mode)
- + {
- + max_frame_num = 2;
- + min_frame_num = 2;
- + }
- +
- +#endif
- + //* alloc memory frame buffer.
- + for(i=0; i<(s32)max_frame_num; i++)
- + {
- + fbm->frames[i].picture.id = i;
- + fbm->frames[i].picture.size_y = size_y[0];
- + fbm->frames[i].picture.size_u = size_u[0]/2;
- + fbm->frames[i].picture.size_v = size_u[0]/2;
- + fbm->frames[i].picture.size_alpha = size_alpha[0];
- +
- + fbm->frames[i].picture.size_y2 = size_y[1];
- + fbm->frames[i].picture.size_u2 = size_u[1];
- + fbm->frames[i].picture.size_v2 = size_v[1];
- + fbm->frames[i].picture.size_alpha2 = size_alpha[1];
- +
- + if(fbm_alloc_yv12_frame_buffer(&fbm->frames[i].picture) != 0)
- + {
- + break;
- + }
- + }
- + if(i < (s32)min_frame_num)
- + {
- + for(; i>=0; i--)
- + fbm_free_frame_buffer(&fbm->frames[i].picture);
- +
- + mem_free(fbm);
- + return NULL;
- + }
- +
- + fbm->max_frame_num = i;
- + /*if(out_3d_mode == _3D_MODE_DOUBLE_STREAM)
- + {
- + if(fbm_alloc_redBlue_frame_buffer((Handle)fbm) < 0)
- + {
- + fbm_release((Handle)fbm, parent);
- + return NULL;
- + }
- + }*/
- +
- +
- + //* initialize empty frame queue semaphore.
- + fbm->mutex = semaphore_create(1);
- + if(fbm->mutex == NULL)
- + {
- + fbm_release((Handle)fbm, parent);
- + return NULL;
- + }
- +
- + //* put all frame to empty frame queue.
- + for(i=0; i<(s32)fbm->max_frame_num; i++)
- + {
- + fbm_enqueue(&fbm->empty_queue, &fbm->frames[i]);
- + }
- +
- + return (Handle)fbm;
- +}
- +
- +Handle fbm_init_yv32(u32 max_frame_num,
- + u32 min_frame_num,
- + u32 size_y[2],
- + u32 size_u[2],
- + u32 size_v[2],
- + u32 size_alpha[2],
- + _3d_mode_e out_3d_mode,
- + pixel_format_e format,
- + u8 is_preview_mode,
- + void* parent)
- +
- +{
- + s32 i;
- + fbm_t* fbm;
- + //video_decoder_t* decoder;
- +
- +
- + if(size_y[0] >= (480*272))
- + max_frame_num = min_frame_num;
- +
- + if(max_frame_num < min_frame_num)
- + {
- + max_frame_num = min_frame_num;
- + }
- + if(min_frame_num > FBM_MAX_FRAME_NUM)
- + return NULL;
- +
- + if(max_frame_num > FBM_MAX_FRAME_NUM)
- + max_frame_num = FBM_MAX_FRAME_NUM;
- +
- + fbm = (fbm_t*) mem_alloc(sizeof(fbm_t));
- + if(!fbm)
- + {
- + return NULL;
- + }
- + mem_set(fbm, 0, sizeof(fbm_t));
- +
- +#if 0
- + libve_io_ctrl(LIBVE_COMMAND_GET_PARENT, (u32)&decoder, parent);
- + if(decoder == NULL)
- + {
- + mem_free(fbm);
- + }
- +
- + if(decoder->status == CEDARV_STATUS_PREVIEW)
- + {
- + max_frame_num = 2;
- + min_frame_num = 2;
- + }
- +#else
- + if(is_preview_mode)
- + {
- + max_frame_num = 2;
- + min_frame_num = 2;
- + }
- +
- +#endif
- + //* alloc memory frame buffer.
- + for(i=0; i<(s32)max_frame_num; i++)
- + {
- + fbm->frames[i].picture.id = i;
- + fbm->frames[i].picture.size_y = size_y[0];
- + fbm->frames[i].picture.size_u = size_u[0];
- + fbm->frames[i].picture.size_v = size_v[0];
- + fbm->frames[i].picture.size_alpha = size_alpha[0];
- +
- + fbm->frames[i].picture.size_y2 = size_y[1];
- + fbm->frames[i].picture.size_u2 = size_u[1];
- + fbm->frames[i].picture.size_v2 = size_v[1];
- + fbm->frames[i].picture.size_alpha2 = size_alpha[1];
- +
- + //if(fbm_alloc_yv32_frame_buffer(&fbm->frames[i].picture) != 0)
- + if(fbm_alloc_frame_buffer(&fbm->frames[i].picture) != 0)
- + {
- + break;
- + }
- + }
- + if(i < (s32)min_frame_num)
- + {
- + for(; i>=0; i--)
- + fbm_free_frame_buffer(&fbm->frames[i].picture);
- +
- + mem_free(fbm);
- + return NULL;
- + }
- +
- + fbm->max_frame_num = i;
- +// if(out_3d_mode == _3D_MODE_DOUBLE_STREAM)
- +// {
- +// if(fbm_alloc_redBlue_frame_buffer((Handle)fbm) < 0)
- +// {
- +// fbm_release((Handle)fbm, parent);
- +// return NULL;
- +// }
- +// }
- +
- +
- + //* initialize empty frame queue semaphore.
- + fbm->mutex = semaphore_create(1);
- + if(fbm->mutex == NULL)
- + {
- + fbm_release((Handle)fbm, parent);
- + return NULL;
- + }
- +
- + //* put all frame to empty frame queue.
- + for(i=0; i<(s32)fbm->max_frame_num; i++)
- + {
- + fbm_enqueue(&fbm->empty_queue, &fbm->frames[i]);
- + }
- +
- + return (Handle)fbm;
- +}
- void fbm_release(Handle h, void* parent)
- {
- @@ -545,7 +976,6 @@
- return 0;
- }
- -
- vpicture_t* fbm_decoder_request_frame(Handle h)
- {
- u32 i;
- @@ -753,6 +1183,39 @@
- return ;
- }
- +/*MVC MINOR DISCARD.By mickey.*/
- +void fbm_flush_frame(Handle h, s64 pts)
- +{
- + fbm_t * fbm;
- + frame_info_t* display_head, *frame_info;
- +
- + fbm = (fbm_t*)h;
- + if(fbm == NULL)
- + return ;
- +
- + frame_info = fbm->display_queue;
- + display_head = frame_info;
- + while(frame_info)
- + {
- + if(frame_info->picture.pts == pts)
- + {
- + if(frame_info == fbm->display_queue) {
- + fbm->display_queue = frame_info->next;
- + }
- + else {
- + display_head->next = frame_info->next;
- + }
- +
- + fbm_enqueue(&fbm->empty_queue, frame_info);
- + frame_info->status = FS_EMPTY;
- + frame_info->next = NULL;
- + break;
- + }
- + display_head = frame_info;
- + frame_info = frame_info->next;
- + }
- +}
- +
- vpicture_t* fbm_display_pick_frame(Handle h)
- {
- fbm_t* fbm;
- @@ -893,3 +1356,20 @@
- }
- #endif
- +
- +//****************************************************************************//
- +//************************ Instance of FBM Interface *************************//
- +//****************************************************************************//
- +IFBM_t IFBM =
- +{
- + fbm_release,
- + fbm_decoder_request_frame,
- + fbm_decoder_return_frame,
- + fbm_decoder_share_frame,
- + fbm_init_ex,
- + fbm_init_ex_yv12,
- + fbm_init_yv32,
- + fbm_flush_frame,
- + fbm_print_status
- +};
- +
- diff -b -u -r -N '--exclude=.git' linux-armhf/fbm/fbm.h linux-armel_new/fbm/fbm.h
- --- linux-armhf/fbm/fbm.h 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/fbm/fbm.h 2013-06-19 12:18:14.000000000 +0200
- @@ -54,6 +54,7 @@
- u32 size_alpha[],
- _3d_mode_e _3d_mode,
- pixel_format_e format,
- + u8 is_preview_mode,
- void* parent);
- void fbm_release(Handle h, void* parent);
- @@ -74,7 +75,8 @@
- s32 fbm_alloc_redBlue_frame_buffer(Handle h);
- s32 fbm_free_redBlue_frame_buffer(Handle h);
- s32 fbm_alloc_rotate_frame_buffer(Handle h);
- -
- + void fbm_flush_frame(Handle h, s64 pts);
- + void fbm_print_status(Handle h);
- #ifdef __cplusplus
- }
- #endif
- diff -b -u -r -N '--exclude=.git' linux-armhf/libcedarv/vdecoder.c linux-armel_new/libcedarv/vdecoder.c
- --- linux-armhf/libcedarv/vdecoder.c 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/libcedarv/vdecoder.c 2013-06-19 12:18:14.000000000 +0200
- @@ -21,12 +21,6 @@
- extern s32 cedardev_init(void);
- extern s32 cedardev_exit(void);
- -
- -extern IVEControl_t gIVE;
- -extern IOS_t gIOS;
- -extern IFBM_t gIFBM;
- -extern IVBV_t gIVBV;
- -
- //#define SAVE_DATA
- #ifdef SAVE_DATA
- static FILE * fpStream = NULL;
- @@ -117,7 +111,6 @@
- video_decoder_t* decoder;
- if(p == NULL)
- return CEDARV_RESULT_ERR_INVALID_PARAM;
- - Log("xxxxxxxxxxxxxxxxxx");
- decoder = (video_decoder_t*)p;
- if(decoder->stream_info.format == STREAM_FORMAT_UNKNOW)
- return CEDARV_RESULT_ERR_UNSUPPORTED;
- @@ -137,12 +130,6 @@
- return CEDARV_RESULT_ERR_NO_MEMORY;
- }
- - //* set method pointers first.
- - libve_set_ive(&gIVE);
- - libve_set_ios(&gIOS);
- - libve_set_ifbm(&gIFBM);
- - libve_set_ivbv(&gIVBV);
- -
- decoder->ve = libve_open(&decoder->config_info, &decoder->stream_info, (void*)decoder);
- if(decoder->ve == NULL)
- {
- @@ -729,13 +716,8 @@
- picture->pcr = frame->pcr;
- //* the CedarX player need we return physic address of display frame.
- -#if 0
- picture->y = (unsigned char*)mem_get_phy_addr((unsigned int)frame->y);
- picture->u = (unsigned char*)mem_get_phy_addr((unsigned int)frame->u);
- -#else
- - picture->y = (unsigned char*)frame->y;
- - picture->u = (unsigned char*)frame->u;
- -#endif
- picture->v = NULL;
- picture->alpha = NULL;
- Binärdateien linux-armhf/libvecore/libcedarxalloc.so and linux-armel_new/libvecore/libcedarxalloc.so sind verschieden.
- diff -b -u -r -N '--exclude=.git' linux-armhf/libvecore/libve_adapter.h linux-armel_new/libvecore/libve_adapter.h
- --- linux-armhf/libvecore/libve_adapter.h 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/libvecore/libve_adapter.h 2013-06-19 12:18:14.000000000 +0200
- @@ -110,6 +110,12 @@
- }IVBV_t;
- + extern IVEControl_t IVE;
- + extern IOS_t IOS;
- + extern IFBM_t IFBM;
- + extern IVBV_t IVBV;
- +
- +
- #ifdef __cplusplus
- }
- #endif
- Binärdateien linux-armhf/libvecore/libve_base.so and linux-armel_new/libvecore/libve_base.so sind verschieden.
- Binärdateien linux-armhf/libvecore/libvecore.so and linux-armel_new/libvecore/libvecore.so sind verschieden.
- diff -b -u -r -N '--exclude=.git' linux-armhf/libvecore/libve.h linux-armel_new/libvecore/libve.h
- --- linux-armhf/libvecore/libve.h 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/libvecore/libve.h 2013-06-19 12:18:14.000000000 +0200
- @@ -128,14 +128,6 @@
- u8* libve_get_last_error(Handle libve); //* get a text description of last happened error;
- - vresult_e libve_set_ive(IVEControl_t* ive);
- -
- - vresult_e libve_set_ios(IOS_t* ios);
- -
- - vresult_e libve_set_ifbm(IFBM_t* ifbm);
- -
- - vresult_e libve_set_ivbv(IVBV_t* ivbv);
- -
- #ifdef __cplusplus
- }
- #endif
- diff -b -u -r -N '--exclude=.git' linux-armhf/libve_types.h linux-armel_new/libve_types.h
- --- linux-armhf/libve_types.h 1970-01-01 01:00:00.000000000 +0100
- +++ linux-armel_new/libve_types.h 2013-06-19 12:18:14.000000000 +0200
- @@ -0,0 +1,14 @@
- +#ifndef _LIBVE_TYPES_H
- +#define _LIBVE_TYPES_H
- +
- +typedef unsigned char __u8;
- +typedef signed char __s8;
- +typedef unsigned short __u16;
- +typedef short __s16;
- +typedef unsigned int __u32;
- +typedef int __s32;
- +typedef unsigned long long __u64;
- +typedef signed long long __s64;
- +typedef char __bool;
- +
- +#endif /* _LIBVE_TYPES_H */
- Binärdateien linux-armhf/sample/data/h264.buf and linux-armel_new/sample/data/h264.buf sind verschieden.
- Binärdateien linux-armhf/sample/data/h264.buf-old and linux-armel_new/sample/data/h264.buf-old sind verschieden.
- Binärdateien linux-armhf/sample/data/h264.buf-old2 and linux-armel_new/sample/data/h264.buf-old2 sind verschieden.
- Binärdateien linux-armhf/sample/doc/decoder demo.pdf and linux-armel_new/sample/doc/decoder demo.pdf sind verschieden.
- Binärdateien linux-armhf/sample/doc/init data设置指导.doc and linux-armel_new/sample/doc/init data设置指导.doc sind verschieden.
- Binärdateien linux-armhf/sample/doc/PMP file format.pdf and linux-armel_new/sample/doc/PMP file format.pdf sind verschieden.
- diff -b -u -r -N '--exclude=.git' linux-armhf/vbv/vbv.c linux-armel_new/vbv/vbv.c
- --- linux-armhf/vbv/vbv.c 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/vbv/vbv.c 2013-06-19 12:18:14.000000000 +0200
- @@ -1,4 +1,5 @@
- +#include "commom_type.h"
- #include "vbv.h"
- #define __msg(msg...) {printf("%s:%d ", __FILE__, __LINE__); printf(msg); printf("\n");}
- @@ -40,6 +41,7 @@
- stream_fifo_t frame_fifo;
- stream_queue_t frame_queue;
- + free_buffer_sem_cb free_buffer_sem;
- void* parent;
- }vbv_t;
- @@ -58,9 +60,11 @@
- if(vbv_size == 0 || max_frame_num == 0)
- return NULL;
- +
- vbv_buf = (u8*)mem_palloc(vbv_size, 1024);
- if (vbv_buf == NULL)
- return NULL;
- +
- vbv = (vbv_t*)mem_alloc(sizeof(vbv_t));
- if (vbv == NULL)
- {
- @@ -91,6 +95,7 @@
- mem_pfree(vbv_buf);
- return NULL;
- }
- +
- vbv->vbv_buf = vbv_buf;
- vbv->max_size = vbv_size;
- vbv->vbv_buf_end = vbv_buf + vbv_size - 1;
- @@ -219,7 +224,10 @@
- unlock(v);
- return -1;
- }
- -
- + if(stream->valid == 0)
- + {
- + stream->valid = 1;
- + }
- write_index = v->frame_fifo.write_index;
- mem_cpy(&v->frame_fifo.in_frames[write_index].vstream, stream, sizeof(vstream_data_t));
- enqueue_to_tail(&v->frame_fifo.in_frames[write_index], &v->frame_queue); //* add this frame to the queue tail.
- @@ -316,6 +324,39 @@
- return;
- }
- +void vbv_set_free_vbs_sem_cb(free_buffer_sem_cb cb, Handle vbv)
- +{
- + vbv_t* v = (vbv_t*)vbv;
- +
- + if (v != NULL)
- + {
- + v->free_buffer_sem = cb;
- + }
- +
- + return;
- +}
- +
- +void vbv_free_vbs_sem(Handle vbv)
- +{
- + vbv_t* v;
- +
- + v = (vbv_t*)vbv;
- +
- + if (v == NULL)
- + {
- + return;
- + }
- +
- + if (lock(v) != 0)
- + {
- + return;
- + }
- + if(v->free_buffer_sem && v->parent)
- + {
- + v->free_buffer_sem(v->parent);
- + }
- + unlock(v);
- +}
- void vbv_flush_stream_frame(vstream_data_t* stream, Handle vbv)
- {
- @@ -574,3 +615,24 @@
- }
- +static void flush_stream_frame(vstream_data_t* stream, Handle vbv)
- +{
- + vbv_flush_stream_frame(stream, vbv);
- + vbv_free_vbs_sem(vbv);
- +
- +}
- +
- +
- +//****************************************************************************//
- +//************************ Instance of VBV Interface *************************//
- +//****************************************************************************//
- +
- +IVBV_t IVBV =
- +{
- + vbv_request_stream_frame,
- + vbv_return_stream_frame,
- + flush_stream_frame,
- + vbv_get_base_addr,
- + vbv_get_buffer_size
- +};
- +
- diff -b -u -r -N '--exclude=.git' linux-armhf/vbv/vbv.h linux-armel_new/vbv/vbv.h
- --- linux-armhf/vbv/vbv.h 2013-06-19 12:18:15.000000000 +0200
- +++ linux-armel_new/vbv/vbv.h 2013-06-19 12:18:14.000000000 +0200
- @@ -9,6 +9,8 @@
- extern "C" {
- #endif
- + typedef void (*free_buffer_sem_cb)(void* handle);
- +
- Handle vbv_init(u32 vbv_size, u32 max_frame_num);
- void vbv_release(Handle vbv);
- @@ -43,6 +45,10 @@
- void* vbv_get_parent(Handle vbv);
- + void vbv_free_vbs_sem(Handle vbv);
- +
- + void vbv_set_free_vbs_sem_cb(free_buffer_sem_cb cb, Handle vbv);
- +
- #ifdef __cplusplus
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement