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

📄 terminal_dev.h

📁 一个用于智能手机的多媒体库适合S60 WinCE的跨平台开发库
💻 H
📖 第 1 页 / 共 2 页
字号:
	/*security check on channel*/	u32 chan_id;	/*service this channel belongs to*/	GF_ClientService *service;	/*stream descriptor*/	GF_ESD *esd;	/*parent OD for this stream*/	struct _od_manager *odm;	u32 es_state;	Bool is_pulling;	u32 media_padding_bytes;	/*IO mutex*/	GF_Mutex *mx;	u32 AU_Count;	/*decoding buffers for push mode*/	struct _decoding_buffer * AU_buffer_first, * AU_buffer_last;	/*static decoding buffer for pull mode*/	struct _decoding_buffer * AU_buffer_pull;	/*channel buffer flag*/	Bool BufferOn;	/*min level to trigger buffering on, max to trigger it off. */	u32 MinBuffer, MaxBuffer;	/*amount of buffered media - this is the DTS of the last recieved AU minus the onject clock time, to make sure	we always have MaxBuffer ms ready for composition when resuming the clock*/	s32 BufferTime;	/*last recieved AU time - if exceeding a certain time and buffering is on, buffering is turned off.	This is needed for streams with very short duration (less than buffer time) and stream with only one AU (BIFS/OD)*/	u32 last_au_time;	/*Current reassemnbling buffer - currently packets are NOT reordered, only AUs are*/	char *buffer;	u32 len, allocSize;	/*only for last packet of an AU*/	u8 padingBits;	Bool IsEndOfStream;	/*	SL reassembler	*/	/*current AU TSs*/	u32 DTS, CTS;	/*AU and Packet seq num info*/	u32 au_sn, pck_sn;	u32 max_au_sn, max_pck_sn;	/*the AU length indicated in the SL Header. */	u32 AULength;	/*state indicator: 0 OK, 1: not tuned in, 2: has error and needs RAP*/	u32 stream_state;	/*the AU in reception is RAP*/	Bool IsRap;	/*signal that next AU is an AU start*/	Bool NextIsAUStart;	/*if codec resilient, packet drops are not considered as fatal for AU reconstruction (eg no wait for RAP)*/	Bool codec_resilient;	/*when starting a channel, the first AU is ALWAYS fetched when buffering - this forces	BIFS and OD to be decoded and first frame render, in order to detect media objects that would also need	buffering - note this doesn't affect the clock, it is still paused if buffering*/	Bool first_au_fetched;	/* TimeStamp to Media Time mapping*/	/*TS (in TSResolution) corresponding to the SeedTime of the decoder. Delivered by net, otherwise 0*/	u64 seed_ts;	/*media time offset corresponding to SeedTS. This is needed when the channel doesn't own the clock*/	u32 ts_offset;	/*scaling factors to remap to timestamps in milliseconds*/	u64 ts_res;	Double ocr_scale;	/*clock driving this stream - currently only CTS is supported (no OCR)*/	struct _object_clock *clock;	/*flag for clock init. Only a channel owning the clock will set this flag on clock init*/	Bool IsClockInit;	/*duration of last recieved AU if any, 0 if not known (most of the time)*/	u32 au_duration;	Bool skip_sl;	Bool is_protected;	GF_IPMPTool *ipmp_tool;	/*TSs as recieved from network - these are used for cache storage*/	u64 net_dts, net_cts;};/*creates a new channel for this stream*/GF_Channel *gf_es_new(GF_ESD *esd);/*destroys channel*/void gf_es_del(GF_Channel *ch);/*(un)locks channel*/void gf_es_lock(GF_Channel *ch, u32 LockIt);/*setup channel for reception of data*/GF_Err gf_es_start(GF_Channel *ch);/*stop channel from receiving data*/GF_Err gf_es_stop(GF_Channel *ch);/*handles reception of an SL PDU*/void gf_es_receive_sl_packet(GF_ClientService *serv, GF_Channel *ch, char *StreamBuf, u32 StreamLength, GF_SLHeader *header, GF_Err reception_status);/*signals end of stream on the channel*/void gf_es_on_eos(GF_Channel *ch);/*fetches first AU available for decoding on this channel*/struct _decoding_buffer *gf_es_get_au(GF_Channel *ch);/*drops first AU on this channel*/void gf_es_drop_au(GF_Channel *ch);/*performs final setup upon connection confirm*/void gf_es_on_connect(GF_Channel *ch);/*reconfigure SL for this channel*/void gf_es_reconfig_sl(GF_Channel *ch, GF_SLConfig *slc);/*hack for streaming: whenever a time map (media time <-> TS time) event is recieved on the channel reset decoding bufferthis is needed because all server tested resend packets on already running channel*/void gf_es_map_time(GF_Channel *ch, Bool reset);/*dummy channels are used by scene decoders which don't use ESM but load directly the scene graph themselvesthese channels are ALWAYS pulling ones, and this function will init the channel clock if needed*/void gf_es_init_dummy(GF_Channel *ch);/*setup DRM info*/void gf_es_config_drm(GF_Channel *ch, GF_NetComDRMConfig *isma_cryp);/*		decoder stuff*/enum{	/*stop: the decoder is not playing*/	GF_ESM_CODEC_STOP	=	0,	/*stop: the decoder is playing*/	GF_ESM_CODEC_PLAY	=	1,	/*End Of Stream: when the base layer signals it's done, this triggers media-specific	handling of the CB. 	For video, the output is kept alive, For audio, the output is reseted (don't want audio loop ;)*/	GF_ESM_CODEC_EOS	=	2,	/*pause: the decoder is stoped but the CB is kept intact	THIS IS NOT USED AS A CODEC STATUS, but only for signaling that the CB shouldn't 	be reseted - the real status of a "paused" decoder is STOP*/	GF_ESM_CODEC_PAUSE	=	3,	/*Buffer: transition state: the decoder runs (fetch data/decode) but the clock	is not running (no composition). This is used for rebuffering channels (rtp...)*/	GF_ESM_CODEC_BUFFER =	4};enum{	GF_ESM_CODEC_HAS_UPSTREAM = 1,	/*the codec uses the interface from another codec (only used by private scene streams to handle	any intern sprite/animation streams)*/	GF_ESM_CODEC_IS_USE = 1<<1,	/*set for OD codec when all ressources are static and scene graph is generated on the fly*/	GF_ESM_CODEC_IS_SCENE_OD = 1<<2,	/*set for OD codec when static (ressources are declared in OD stream esd a la ISMA*/	GF_ESM_CODEC_IS_STATIC_OD = 1<<3,};struct _generic_codec {	/*codec type (streamType from base layer)*/	u32 type;	u32 flags;	/*current decoder interface */	GF_BaseDecoder *decio;	/*composition memory for media streams*/	struct _composition_memory *CB;	/*input media channles*/	GF_List *inChannels;	/*a pointer to the OD that owns the decoder.*/	struct _od_manager *odm;	u32 Status;	Bool Muted;	struct _object_clock *ck;	/*priority of this media object. This is ALWAYS the base layer priority	PriorityBoost is set when the CB is under critical limit (for now only audio uses the feature)	and results in a bigger time slice for the codec. Only on/off value for now*/	u32 Priority, PriorityBoost;	/*last processed DTS - sanity check for scalability*/	u32 last_unit_dts;	/*last processed CTS on base layer - seeking detection*/	u32 last_unit_cts;	/*in case the codec performs temporal re-ordering itself*/	Bool is_reordering;	u32 prev_au_size;	u32 bytes_per_sec;	Double fps;	/*statistics*/	u32 last_stat_start, cur_bit_size;	u32 avg_bit_rate, max_bit_rate;	u32 total_dec_time, nb_dec_frames, max_dec_time;	/*number of droped frames*/	u32 nb_droped;	/*for CTS reconstruction (channels not using SL): we cannot just update timing at each frame, not precise enough 	since we use ms and not microsec TSs*/	u32 cur_audio_bytes, cur_video_frames;};GF_Codec *gf_codec_new(GF_ObjectManager *odm, GF_ESD *base_layer, s32 PL, GF_Err *e);void gf_codec_del(GF_Codec *codec);GF_Err gf_codec_add_channel(GF_Codec *codec, GF_Channel *ch);/*returns TRUE if stream was present, false otherwise*/Bool gf_codec_remove_channel(GF_Codec *codec, GF_Channel *ch);GF_Err gf_codec_process(GF_Codec *codec, u32 TimeAvailable);GF_Err gf_codec_get_capability(GF_Codec *codec, GF_CodecCapability *cap);GF_Err gf_codec_set_capability(GF_Codec *codec, GF_CodecCapability cap);void gf_codec_set_status(GF_Codec *codec, u32 Status);/*returns a new codec using an existing loaded decoder - only used by private scene to handle != timelines, for instance when loading a BT with an animation stream*/GF_Codec *gf_codec_use_codec(GF_Codec *codec, GF_ObjectManager *odm);/*OD manager*//*all inserted ODs have this ODID*/#define GF_ESM_DYNAMIC_OD_ID	1050enum{	/*flag set if object cannot be time-controloed*/	GF_ODM_NO_TIME_CTRL = (1<<1),	/*flag set if subscene uses parent scene timeline*/	GF_ODM_INHERIT_TIMELINE = (1<<2),	/*flag set if object has been redirected*/	GF_ODM_REMOTE_OD = (1<<3),	/*flag set if object has profile indications*/	GF_ODM_HAS_PROFILES = (1<<4),	/*flag set if object governs profile of inline subscenes*/	GF_ODM_INLINE_PROFILES = (1<<5),	/*flag set if object declared by network service, not from OD stream*/	GF_ODM_NOT_IN_OD_STREAM = (1<<6),};enum{	GF_ODM_STATE_STOP,	GF_ODM_STATE_PLAY,	GF_ODM_STATE_IN_SETUP,	GF_ODM_STATE_BLOCKED,};struct _od_manager{	/*pointer to terminal*/	struct _tag_terminal *term;	/*the service used by this ODM. If the service private data is this ODM, then the service was created for this ODM*/	GF_ClientService *net_service;	/*parent scene or NULL for root scene*/	struct _inline_scene *parentscene;	/*channels associated with this object (media channels, OCR, IPMP, OCI, etc)*/	GF_List *channels;	/*sub scene for inline/animation or NULL */	struct _inline_scene *subscene;	/*object codec (media or BIFS for AnimationStream) attached if any*/	struct _generic_codec *codec;	/*OCI codec attached if any*/	struct _generic_codec *oci_codec;	/*OCR codec attached if any*/	struct _generic_codec *ocr_codec;	/*MPEG-4 object descriptor*/	GF_ObjectDescriptor *OD;	/*exclusive access is required since rendering and media management don't always take place in the same thread*/	GF_Mutex *mx;	u32 flags;	/*PLs*/	u8 Audio_PL, Graphics_PL, OD_PL, Scene_PL, Visual_PL;		/*interface with scene rendering*/	struct _mediaobj *mo;		/*number of channels with connection not yet acknowledge*/	u32 pending_channels;	u32 state;	/* during playback: timing as evaluated by the composition memory or the scene codec */	u32 current_time;	/*full object duration 0 if unknown*/	u64 duration;	/*	upon start: media start time as requested by scene renderer (eg not media control)	set to -1 upon stop to postpone stop request	*/	u64 media_start_time, media_stop_time;	/*the one and only media control currently attached to this object*/	struct _media_control *media_ctrl;	/*the list of media control controling the object*/	GF_List *mc_stack;	/*the media sensor(s) attached to this object*/	GF_List *ms_stack;};GF_ObjectManager *gf_odm_new();void gf_odm_del(GF_ObjectManager *ODMan);void gf_odm_lock(GF_ObjectManager *odm, u32 LockIt);/*setup service entry point*/void gf_odm_setup_entry_point(GF_ObjectManager *odm, const char *sub_url);/*setup OD*/void gf_odm_setup_object(GF_ObjectManager *odm, GF_ClientService *parent_serv);/*disctonnect OD and removes it if desired (otherwise only STOP is propagated)*/void gf_odm_disconnect(GF_ObjectManager *odman, Bool do_remove);/*setup an ESD*/GF_Err gf_odm_setup_es(GF_ObjectManager *odm, GF_ESD *esd, GF_ClientService *service, GF_MediaObject *sync_ref);/*removes an ESD (this destroys associated channel if any)*/void gf_odm_remove_es(GF_ObjectManager *odm, u16 ES_ID);/*set stream duration - updates object duration accordingly*/void gf_odm_set_duration(GF_ObjectManager *odm, GF_Channel *, u64 stream_duration);/*signals end of stream on channels*/void gf_odm_on_eos(GF_ObjectManager *odm, GF_Channel *);/*start Object streams and queue object for network PLAY*/void gf_odm_start(GF_ObjectManager *odm);/*stop OD streams*/void gf_odm_stop(GF_ObjectManager *odm, Bool force_close);/*send PLAY request to network - needed to properly handle multiplexed inputs ONLY called by service handler (media manager thread)*/void gf_odm_play(GF_ObjectManager *odm);/*returns 1 if this is a segment switch, 0 otherwise - takes care of object restart if segment switch*/Bool gf_odm_check_segment_switch(GF_ObjectManager *odm);/*pause object (mediaControl use only)*/void gf_odm_pause(GF_ObjectManager *odm);/*resume object (mediaControl use only)*/void gf_odm_resume(GF_ObjectManager *odm);/*set object speed*/void gf_odm_set_speed(GF_ObjectManager *odm, Fixed speed);/*returns the clock of the media stream (video, audio or bifs), NULL otherwise */struct _object_clock *gf_odm_get_media_clock(GF_ObjectManager *odm);/*adds segment descriptors targeted by the URL to the list and sort them - the input list must be empty*/void gf_odm_init_segments(GF_ObjectManager *odm, GF_List *list, MFURL *url);/*returns true if this OD depends on the given clock*/Bool gf_odm_shares_clock(GF_ObjectManager *odm, struct _object_clock *ock);/*refresh all ODs when an non-interactive stream is found*/void gf_odm_refresh_uninteractives(GF_ObjectManager *odm);GF_Segment *gf_odm_find_segment(GF_ObjectManager *odm, char *descName);/*locks ODM with destruction check - returns 0 if object manager is not attached to object*/Bool gf_odm_lock_mo(struct _mediaobj *mo);/*GF_MediaObject: link between real object manager and scene. although there is a one-to-one mapping between a MediaObject and an ObjectManager, we have to keep them seperated in order to handle OD remove commands which destroyObjectManagers. */struct _mediaobj{	/*type is as defined in constants.h # GF_MEDIA_OBJECT_* */	u32 type;	/*one of the above flags*/	u32 flags;	/* private to ESM*/	/*media object manager - private to the sync engine*/	struct _od_manager *odm;	/*OD ID of the object*/	u32 OD_ID;	/*OD URL for object not using MPEG4 OD urls*/	MFURL URLs;	/*session join*/	u32 num_open;	/*shared object restart handling*/	u32 num_to_restart, num_restart;	Fixed speed;	/*shared object info: if 0 a new frame will be checked, otherwise current is returned*/	u32 nb_fetch;	/*frame presentation time*/	u32 timestamp;	/*data frame size*/	u32 framesize;	/*pointer to data frame */	char *frame;};GF_MediaObject *gf_mo_new();/*used for delayed channel setup*/typedef struct {	struct _generic_codec *dec;	struct _es_channel *ch;	} GF_ChannelSetup;/*post-poned channel connect*/GF_Err gf_odm_post_es_setup(struct _es_channel *ch, struct _generic_codec *dec, GF_Err err);/*	special entry point: specify directly a service interface for service input*/void gf_term_attach_service(GF_Terminal *term, GF_InputService *service_hdl);u32 URL_GetODID(MFURL *url);#ifdef __cplusplus}#endif#endif	/*_GF_TERMINAL_DEV_H_*/

⌨️ 快捷键说明

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