⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 renderer_dev.h

📁 一个用于智能手机的多媒体库适合S60 WinCE的跨平台开发库
💻 H
📖 第 1 页 / 共 2 页
字号:
/* *			GPAC - Multimedia Framework C SDK * *			Copyright (c) Jean Le Feuvre 2000-2005  *					All rights reserved * *  This file is part of GPAC / Scene Rendering sub-project * *  GPAC is free software; you can redistribute it and/or modify *  it under the terms of the GNU Lesser General Public License as published by *  the Free Software Foundation; either version 2, or (at your option) *  any later version. *    *  GPAC is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU Lesser General Public License for more details. *    *  You should have received a copy of the GNU Lesser General Public *  License along with this library; see the file COPYING.  If not, write to *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  * */#ifndef _GF_RENDERER_DEV_H_#define _GF_RENDERER_DEV_H_/*include scene graph API*/#include <gpac/renderer.h>/*include scene graph API*/#include <gpac/thread.h>/*bridge between the rendering engine and the systems media engine*/#include <gpac/mediaobject.h>/*raster2D API*/#include <gpac/modules/raster2d.h>/*font engine API*/#include <gpac/modules/font.h>/*AV hardware API*/#include <gpac/modules/video_out.h>#include <gpac/modules/audio_out.h>/*SVG properties*/#ifndef GPAC_DISABLE_SVG#include <gpac/scenegraph_svg.h>#endif#ifdef DANAEvoid *getDanaeMediaOjbectFromUrl(void *session, char *url, int dmo_type);void releaseDanaeMediaObject(void *dmo);void loadDanaeUrl(void *session, char *url);#endif#define GF_SR_EVENT_QUEUE	/*FPS computed on this number of frame*/#define GF_SR_FPS_COMPUTE_SIZE	30enum{	GF_SR_CFG_OVERRIDE_SIZE = 1,	GF_SR_CFG_SET_SIZE = 1<<1,	GF_SR_CFG_AR = 1<<2,	GF_SR_CFG_FULLSCREEN = 1<<3,	/*flag is set whenever we're reconfiguring visual. This will discard all UI	messages during this phase in order to avoid any deadlocks*/	GF_SR_IN_RECONFIG = 1<<4,	/*special flag indicating the set size is actually due to a notif by the plugin*/	GF_SR_CFG_WINDOWSIZE_NOTIF = 1<<10,};struct __tag_base_renderer{	/*the main user*/	GF_User *user;	/*the terminal running the graph - only used for InputSensor*/	GF_Terminal *term;#ifdef DANAE	void *danae_session;#endif	/*audio renderer*/	struct _audio_render *audio_renderer;	/*renderer module (cf below)*/	struct visual_render_module *visual_renderer;	/*video out*/	GF_VideoOutput *video_out;	/*2D rasterizer - now also used by 3D renderer for text texturing & gradients generation*/	GF_Raster2D *r2d;	/*visual rendering thread if used*/	GF_Thread *VisualThread;	/*0: not init, 1: running, 2: exit requested, 3: done*/	u32 video_th_state;	GF_Mutex *mx;	/*the main scene graph*/	GF_SceneGraph *scene;	/*extra scene graphs (OSD, etc), always registered in draw order. That's the module responsability	to draw them*/	GF_List *extra_scenes;		/*all time nodes registered*/	GF_List *time_nodes;	/*all textures (texture handlers)*/	GF_List *textures;#ifdef GF_SR_EVENT_QUEUE	/*event queue*/	GF_List *events;	GF_Mutex *ev_mx;#endif	/*simulation frame rate*/	Double frame_rate;	u32 frame_duration;	u32 frame_time[GF_SR_FPS_COMPUTE_SIZE];	u32 current_frame;	u32 scene_width, scene_height;	Bool has_size_info;	/*screen size*/	u32 width, height;	Bool fullscreen;	/*!! paused will not stop display (this enables pausing a VRML world and still examining it)*/	Bool paused, step_mode;	Bool draw_next_frame;	/*freeze_display prevents any screen updates - needed when output driver uses direct video memory access*/	Bool is_hidden, freeze_display;	u32 frame_number;	/*count number of initialized sensors*/	u32 interaction_sensors;	/*set whenever 3D HW ctx changes (need to rebuild dlists/textures if any used)*/	Bool reset_graphics;	/*font engine*/	GF_FontRaster *font_engine;	/*options*/	u32 aspect_ratio, antiAlias, texture_text_mode;	Bool high_speed, stress_mode;	/*key modif*/	u32 key_states;	u32 interaction_level;	/*size override when no size info is present		flags:	1: size override is requested (cfg)				2: size override has been applied	*/	u32 override_size_flags;	/*any of the above flags - reseted at each simulation tick*/	u32 msg_type;	/*for size*/	u32 new_width, new_height;	/*current background color*/	u32 back_color;	/*unit box (1.0 size) and unit sphere (1.0 radius)*/	u32 draw_bvol;	/*list of system colors*/	u32 sys_colors[28];};/*macro setting up rendering stack with following member @owner: node pointer and @compositor: compositor*/#define	gf_sr_traversable_setup(_object, _owner, _compositor)	\		_object->owner = _owner;		\		_object->compositor = _compositor; \/*base stack for timed nodes (nodes that activate themselves at given times)	@UpdateTimeNode: shall be setup by the node handler and is called once per simulation frame	@is_registerd: all handlers indicate store their state if wanted (provided for conveniency but not inspected by the renderer)	@needs_unregister: all handlers indicate they can be removed from the list of active time nodesin order to save time. THIS IS INSPECTED by the renderer at each simulation tick after calling UpdateTimeNodeand if set, the node is removed right away from the list*/typedef struct _time_node{	void (*UpdateTimeNode)(struct _time_node *);	Bool is_registered, needs_unregister;	GF_Node *obj;} GF_TimeNode;void gf_sr_register_time_node(GF_Renderer *sr, GF_TimeNode *tn);void gf_sr_unregister_time_node(GF_Renderer *sr, GF_TimeNode *tn);/*texturing - Movietexture, ImageTexture and PixelTextures are handled by main renderer*/typedef void *GF_HWTEXTURE;enum{	/*texture repeat along s*/	GF_SR_TEXTURE_REPEAT_S = (1<<0),	/*texture repeat along t*/	GF_SR_TEXTURE_REPEAT_T = (1<<1),	/*texture is a matte texture*/	GF_SR_TEXTURE_MATTE = (1<<2),};typedef struct _gf_sr_texture_handler{	GF_Node *owner;	GF_Renderer *compositor;	/*driver texture object*/	GF_HWTEXTURE hwtx;	/*media stream*/	GF_MediaObject *stream;	/*texture is open (for DEF/USE)*/	Bool is_open;	/*this is needed in case the Url is changed - note that media nodes cannot point to different	URLs (when they could in VRML), the MF is only holding media segment descriptions*/	MFURL current_url;	/*to override by each texture node*/	void (*update_texture_fcnt)(struct _gf_sr_texture_handler *txh);	/*needs_release if a visual frame is grabbed (not used by modules)*/	Bool needs_release;	/*stream_finished: indicates stream is over (not used by modules)*/	Bool stream_finished;	/*needs_refresh: indicates texture content has been changed - needed by modules performing tile drawing*/	Bool needs_refresh;	/*needed to discard same frame fetch*/	u32 last_frame_time;	/*active display in the texture (0, 0 == top, left)*/	//GF_Rect active_window;	/*texture is transparent*/			Bool transparent;	/*flags for user - the repeatS and repeatT are set upon creation, the rest is NEVER touched by renderer*/	u32 flags;	/*gradients are relative to the object bounds, therefore a gradient is not the same if used on 2 different	objects - since we don't want to build an offscreen texture for the gradient, gradients have to be updated 	at each draw - the matrix shall be updated to the gradient transformation in the local system	MUST be set for gradient textures*/	void (*compute_gradient_matrix)(struct _gf_sr_texture_handler *txh, GF_Rect *bounds, GF_Matrix2D *mat);	/*image data for natural media*/	char *data;	u32 width, height, stride, pixelformat, pixel_ar;	/*if set texture has been transformed by MatteTexture -> disable blit*/	Bool has_cmat;	/*matteTexture parent if any*/	GF_Node *matteTexture;#ifdef DANAE	/* DANAE GF_MediaObject equivalent */	void *dmo;#endif} GF_TextureHandler;/*setup texturing object*/void gf_sr_texture_setup(GF_TextureHandler *hdl, GF_Renderer *sr, GF_Node *owner);/*destroy texturing object*/void gf_sr_texture_destroy(GF_TextureHandler *txh);/*return texture handle for built-in textures (movieTexture, ImageTexture and PixelTexture)*/GF_TextureHandler *gf_sr_texture_get_handler(GF_Node *n);/*these ones are needed by modules only for Background(2D) handling*//*returns 1 if url changed from current one*/Bool gf_sr_texture_check_url_change(GF_TextureHandler *txh, MFURL *url);/*starts associated object*/GF_Err gf_sr_texture_play(GF_TextureHandler *txh, MFURL *url);GF_Err gf_sr_texture_play_from_to(GF_TextureHandler *txh, MFURL *url, Double start_offset, Double end_offset, Bool can_loop, Bool lock_scene_timeline);/*stops associated object*/void gf_sr_texture_stop(GF_TextureHandler *txh);/*restarts associated object - DO NOT CALL stop/start*/void gf_sr_texture_restart(GF_TextureHandler *txh);/*common routine for all video texture: fetches a frame and update the 2D texture object */void gf_sr_texture_update_frame(GF_TextureHandler *txh, Bool disable_resync);/*release video memory if needed*/void gf_sr_texture_release_stream(GF_TextureHandler *txh);/*		Renderer Module: this is a very basic interface allowing both 2D and 3D renderers		to be loaded at run-time*//*interface name for video output*/#define GF_RENDERER_INTERFACE	GF_4CC('G','R','E','N') 

⌨️ 快捷键说明

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