decode_thread
(setup)	av_find_stream_info
			try_decode_frame
				avcodec_decode_video2 (ret !=0 good)
					decode_frame (libavcodec/h264.c)
						decode_nal_units
							decode_slice_header
								ff_h264_decode_ref_pic_list_reordering
		av_find_best_stream
		stream_component_open
			avcodec_open

(loop)	av_read_frame (libavformat/utils.c)
			av_read_frame_internal (libavformat/utils.c)
				av_read_packet
					ff_rtsp_fetch_packet
		packet_queue_put (&is->videoq, pkt)

video_thread
(setup)	(Config filters)
		configure_video_filters
			avfilter_graph_config
				ff_avfilter_graph_config_formats
					query_formats
						avfilter_insert_filter

(loop)	get_filtered_video_frame (cmdutils)
			avfilter_request_frame (avfilter)
				link->srcpad->request_frame = input_request_frame
					get_video_frame
						packet_queue_get (&is->videoq,pkt)
						avcodec_decode_video2
							decode_frame
								decode_nal_units
									decode_slice_header
										ff_h264_decode_ref_pic_list_reordering	
		output_picture2
			queue_picture (is->pictq_size++)
				compute_target_time (vp->target_clock)

main
	event_loop (FF_REFRESH_EVENT)
		video_refresh_timer (is->pictq_size--)
			video_display
				video_image_display
					SDL_Display_YUVOverlay
						SDL_Display_YUV_SW (SDL_yuv_sw.c)
							swdata->Display1X = SDL_SoftStretch
								copy_row2
							SDL_UpdateRects
								DIB_NormalUpdate

audio (callback)
	 sdl_audio_callback
		audio_decode_frame
			packet_queue_get(&is->audioq,pkt)
		synchronize_audio

refresh_thread
	set FF_REFRESH_EVENT

===============================================================
== Setup code for decoding (from decode thread)
===============================================================
av_find_stream_info
	avcodec_find_decoder (e.g. CODEC_ID_MPEG1VIDEO)
	avcodec_open (set AVCodecContext (ic->streams[0]->codec))
				 look @ avcodec_get_context_defaults3
	(loop)
	av_read_frame_internal
	add_to_pktbuf
	try_decode_frame
		avcodec_get_frame_defaults
		avcodec_decode_video2
	(end loop)


================================================================
== Code path for retrieving key-frame information
================================================================
int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
	AVFilterBufferRef **picref_ptr, AVRational *tb)
		avfilter_request_frame(ctx->inputs[0])				 

		int avfilter_request_frame(AVFilterLink *link)
			link->srcpad->request_frame(link)
			
			static int input_request_frame(AVFilterLink *link)
				get_video_frame(priv->is,priv->frame,&pts,&pkt)
