aw_app.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 400 行 · 第 1/2 页

H
400
字号
/*****************************************************************
**                                                             	**
**  Copyright (C) 2004 Amlogic,Inc.                            	**
**  All rights reserved                                        	**
**        Filename : aw_app.h /Project:AVOS 	 				** 
**        Revision : 1.0                                       	**
**                                                             	**
*****************************************************************/
#ifndef _AW_APP_H
#define _AW_APP_H

#include "includes.h"

/**
 * @file aw_app.h
 * @author LiChao, chao_li@amlogic.com.cn
 *
 * This is the head file of Application manage program. Application manager is a control center, 
 * which will send user input command to application and receive command execute result and 
 * notification message from application, and forword these message to user customize code to
 * handle it.
 *
*/

/** @defgroup application_ctrl Application control center routines.
 * @ingroup gui
 */
  
/**
 * @brief Following is the defination of applications
 */
///Define None application 
#define MEDIA_NULL			0x00000000
///Define Application manage application, a special application
#define MEDIA_GUI			0x00000001
///Define a idle application, have lowest priority, responsible for collect device change information,
///File system information and other low priority task.
#define MEDIA_SYSTEM		0x00000002
///Define the DVD-Video application, which supply all meta function of DVD-Video.
#define MEDIA_DVD_VIDEO		0x00000004
///Define the DVD-Audio application, which supply all meta function of DVD-Audio.
#define MEDIA_DVD_AUDIO		0x00000008
///Define the VCD application, which supply all meta function of VCD/SVCD/CVD.
#define MEDIA_VCD			0x00000010
///Define the CDDA application, which supply all meta function of CDDA, include DTS-CD, HDCD, CDG.
#define MEDIA_CDA			0x00000020
///Define the GPLAYER application
#define MEDIA_GENERAL                   0x00000040
///Define the mp3 music format
#define MEDIA_MP3			MEDIA_GENERAL
///Define the WMA music format
#define MEDIA_WMA			MEDIA_GENERAL
///Define all music format that cann't support combo play.
#define MEDIA_GENERAL_		0x00000080
///Define the RESERVED application, which supply all meta function of JPEG.
#define MEDIA_NET             	0x00000100
///Define the MPEG2 file play application, which supply all meta function of MPEG2 file play.
#define MEDIA_MPEG2			0x00000200
///Define the txt file play application, which supply all meta function of txt file play.
#define MEDIA_TXT			0x00000400
///Define the MPEG1 file play application, which supply all meta function of MPEG1 file play.
#define MEDIA_MPEG1			MEDIA_MPEG2  //mpeg1 have same application as MEDIA_MPEG2
///Define the MPEG4 file play application, which supply all meta function of MPEG4 file play.
#define MEDIA_AVI			0x00000800
///Define the Tuner application, which supply all meta function of Tuner, include RDS.
#define MEDIA_TUNER			0x00001000
///Define the Analog IN application.
#define MEDIA_SWF			0x00002000
///Define the Digital IN application.
#define MEDIA_DIGITAL_IN	0x00004000
///Define the HVD application, which supply all meta function of HVD.
#define MEDIA_HVD			0x00008000
///Define the HTTP download application, which will manage http download process, 
///include download resume after power-off.
#define MEDIA_HTTP          0x00010000
///Define the PIC application, which supply all meta function of BMP.
#define MEDIA_PIC           0x00020000
///Define the iPod application, which supply all meta function of iPod.
#define MEDIA_IPOD          0x00040000
///Define the MIDI application, which supply all meta function of MIDI.
#define MEDIA_MIDI          0x00080000
///for temp use,no ID resource!!!!
#define MEDIA_TONE          MEDIA_MIDI

#define MEDIA_CDDA              0x00100000
//Define the Encoder application
#define MEDIA_ENCODER	0x00200000

#define MEDIA_DISC          0x00400000

#define MEDIA_MOV	           0x00800000      

#define MEDIA_REAL               0x01000000

///Define the LFTV application, which supply all meta function of LFTV.
#define MEDIA_LFTV               0x02000000

#define MEDIA_MP3ONLY       MEDIA_CDDA

#define MEDIA_AUDIO	MEDIA_CDDA

#define MEDIA_MP4	        MEDIA_MOV      

#define MEDIA_OTHER	        0x02000000
// media define will not over 0x01ffffff, because the upper 0xe0000000 was used by #define NAV_PATH_FLAG   0xF0000000
                                // same as NAV_IS_FILE

#define MEDIA_TYPE_MASK         0x01FFFFFF 
                                // same as NAV_IS_DIR

#define MEDIA_EXCLUDE_DIR       0x40000000
                                // same as (gnav_filter.show_dir == 0) when this bit is set in media_type; 
                                // this option is added because gnav_filter can not be changed after filenav is initialized
                
#define MEDIA_DIR               0x80000000 

#define MAX_APP_NUM				32

#define MAX_APP_MSG_NUM         32

/**
 * @brief Following is the defination of application status
 */
///This status means we don't found any resource for this type of applicaion.
#define APP_IDLE				0x0
///This status means we have found special resource for this type of applicaion, but the application not runing.
#define APP_READY				0x1
///This status means the applicaion is runing.
#define APP_RUNNING				0x2

/**
 * @brief Following is the define the storeage device we support
 */
#define ATAPI_DEVICE			0x1
#define USB_DEVICE				0x2
#define HD_DEVICE				0x4

typedef void (*APPMSGPROCESS)(AWMSG *pMsg) ;
typedef void (*APPGETINFO)(void *pAllAppInfo) ;
typedef void (*APPTASKFUNCTION)(void *opt) ;

typedef struct _apptaskarg *PAPPTASKARG ;
/**
 * @brief Following struct is the basic information for all applications, the application manage task 
 * will use these information to do the manage routine.
 */
typedef struct _apptaskarg{
    ///the media type of this application deal with, like DVD-Video,VCD,MP3...
	INT32U		app_media_type; 
	///the id of this application
	INT8U		app_id ; 
	///the status of this app,like idle, ready, running 
	INT8U		app_status ;	
	///if this app support auto run when it's ready.(0--don't auto run, 
	///1~255, auto run and it's priority, 
	/// when two app ready and the higher level should run first)
	INT8U		app_auto_run_priority; 
	///the input(key,mosue) handle priority of this app,
	///0 is lowest, 255 should be highest
	INT8U		app_input_process_priority; 
	///the task priority of this app when running
	INT8U		app_task_priority;	
	///memory map of then the task is running
	INT8U		app_memmap;
	////app's stack when running, it dynamic malloced by GUI task, should free by app itself 
	///when this app over
	OS_STK	*	app_task_stack ;
	///the size of stack this app needed
	INT16U		app_stack_size;
	///when create a task for this app, this is the task id of this app
	INT16U		app_task_id ; 
	///sync single, when create this app to running, the caller will 
	///waite for this single to ensure this app initial finished
	OS_EVENT *	aw_sem;	
        ///command dispatch queue
        list_t dispatch_queue;		
	///GUI's msg queue, receive all app's msg(notification or command result)
	OS_EVENT *	aw_msg_q ; 
    ///GUI's msg queue storage
    void *      app_msg_storage;
	///GUI's event handle , when all other app send msg to aw_msg_q, need post this event handle 
	///too call the app to ready mode from sleep mode if the app is wait for the event.
	AVSysEvent_t      aw_event_handle ;
	///the msg queue of this app, used to receive other app or gui task's msg
	OS_EVENT *	app_msg_q; 
	//the event_id of this app, used to send sync single to app when need send message to app
	AVSysEvent_t      app_event_handle ;
	///the stub function of this application, which is a customize
	///interface for this application, Control center will send input key 
	///and other msg to it and show some hint on screen;
	APPMSGPROCESS AppMsgProcess ; 
	///a interface of application which will return some static information 
    ///of this media type content;
	APPGETINFO AppGetInfo; 
	///the main function of this application, will created as a task
	///when running this application
	APPTASKFUNCTION AppTask ;
} APPTASKARG;

/**

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?