[asterisk-commits] rizzo: branch rizzo/video_v2 r85388 - /team/rizzo/video_v2/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 11 03:10:17 CDT 2007


Author: rizzo
Date: Thu Oct 11 03:10:17 2007
New Revision: 85388

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85388
Log:
document where video buffers are allocated


Modified:
    team/rizzo/video_v2/channels/console_video.c

Modified: team/rizzo/video_v2/channels/console_video.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/channels/console_video.c?view=diff&rev=85388&r1=85387&r2=85388
==============================================================================
--- team/rizzo/video_v2/channels/console_video.c (original)
+++ team/rizzo/video_v2/channels/console_video.c Thu Oct 11 03:10:17 2007
@@ -197,10 +197,10 @@
 
 	int sendvideo;
 
-	struct fbuf_t	loc_src;	/* local source buffer */
-	struct fbuf_t	enc_in;		/* encoder input buffer */
-	struct fbuf_t	enc_out;	/* encoder output buffer */
-	struct fbuf_t	loc_dpy;	/* display source buffer */
+	struct fbuf_t	loc_src;	/* local source buffer, allocated in video_open() */
+	struct fbuf_t	enc_in;		/* encoder input buffer, allocated in video_out_init() */
+	struct fbuf_t	enc_out;	/* encoder output buffer, allocated in video_out_init() */
+	struct fbuf_t	loc_dpy;	/* display source buffer, no buffer (managed by SDL in bmp[1]) */
 
 	struct video_codec_desc *enc;	/* encoder */
 	AVCodecContext	*enc_ctx;	/* encoding context */
@@ -231,9 +231,9 @@
 	AVCodecParserContext    *parser;
 	uint16_t 		next_seq;	/* must be 16 bit */
 	int                     discard;	/* flag for discard status */
-	struct fbuf_t dec_in;	/* incoming bitstream */
-	struct fbuf_t dec_out;	/* decoded frame */
-	struct fbuf_t rem_dpy;	/* buffer for displayed remote img */
+	struct fbuf_t dec_in;	/* incoming bitstream, allocated/extended in fbuf_append() */
+	struct fbuf_t dec_out;	/* decoded frame, no buffer (data is in AVFrame) */
+	struct fbuf_t rem_dpy;	/* display remote image, no buffer (managed by SDL in bmp[0]) */
 };
 
 /*
@@ -1193,8 +1193,11 @@
 	int i;
 
 	for (i = 0; supported_codecs[i]; i++)
-		if (fmt == supported_codecs[i]->format)
+		if (fmt == supported_codecs[i]->format) {
+			ast_log(LOG_WARNING, "using %s for format 0x%x\n",
+				supported_codecs[i]->name, fmt);
 			return supported_codecs[i];
+		}
 	return NULL;
 }
 ;
@@ -1538,7 +1541,7 @@
  *
  * The size is taken from the configuration.
  *
- * 'out' is 0 for received data, 1 for the local video, 2 on init (debug)
+ * 'out' is 0 for remote video, 1 for the local video
  */
 static void show_frame(struct video_desc *env, int out)
 {
@@ -1821,7 +1824,10 @@
 		return;
 	env->owner = owner;
 	init_env(env);
-
+	env->out.enc = map_config_video_format(env->codec_name);
+
+	ast_log(LOG_WARNING, "start video out %s %dx%d\n",
+		env->codec_name, env->out.enc_in.w,  env->out.enc_in.h);
 	/*
 	 * Register all codecs supported by the ffmpeg library.
 	 * We only need to do it once, but probably doesn't
@@ -1830,7 +1836,6 @@
 	avcodec_init();
 	avcodec_register_all();
 	av_log_set_level(AV_LOG_ERROR);	/* only report errors */
-	env->out.enc = map_config_video_format(env->codec_name);
 
 	/*
 	 * initialize the SDL environment




More information about the asterisk-commits mailing list