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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 11 08:11:27 CDT 2007


Author: rizzo
Date: Thu Oct 11 08:11:26 2007
New Revision: 85393

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85393
Log:
add "qmin" as a config file/cli parameter


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

Modified: team/rizzo/video_v2/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/channels/chan_oss.c?view=diff&rev=85393&r1=85392&r2=85393
==============================================================================
--- team/rizzo/video_v2/channels/chan_oss.c (original)
+++ team/rizzo/video_v2/channels/chan_oss.c Thu Oct 11 08:11:26 2007
@@ -1122,7 +1122,7 @@
 	case CLI_INIT:
 		e->command = "console [sendvideo|device|videodevice|"
 			"fps|bitrate|videoformat|video_size|camera_size|"
-			"remote_size|local_size]";
+			"remote_size|local_size|qmin]";
 		e->usage =
 			"Usage: console ...\n"
 			"       Generic handler for console commands.\n";

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=85393&r1=85392&r2=85393
==============================================================================
--- team/rizzo/video_v2/channels/console_video.c (original)
+++ team/rizzo/video_v2/channels/console_video.c Thu Oct 11 08:11:26 2007
@@ -194,6 +194,7 @@
 	char		videodevice[64];
 	int		fps;
 	int		bitrate;
+	int		qmin;
 
 	int sendvideo;
 
@@ -561,9 +562,7 @@
 	v->enc_ctx->flags |=CODEC_FLAG_H263P_SLICE_STRUCT; /* annex k */
 	v->enc_ctx->flags |= CODEC_FLAG_H263P_AIC; /* annex I */
 
-	v->enc_ctx->bit_rate = v->bitrate;
 	v->enc_ctx->gop_size = v->fps*5; // emit I frame every 5 seconds
-	v->enc_ctx->qmin = 3;	/* should be configured */
 	return 0;
 }
 
@@ -748,9 +747,7 @@
 	v->enc_ctx->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
 	v->enc_ctx->flags |= CODEC_FLAG_AC_PRED;
 
-	v->enc_ctx->bit_rate = v->bitrate;
 	v->enc_ctx->gop_size = v->fps*5;
-	v->enc_ctx->qmin = 3;
 
 	return 0;
 }
@@ -918,14 +915,11 @@
 /*---- h261 support -----*/
 static int h261_enc_init(struct video_out_desc *v)
 {
-	v->enc_ctx->bit_rate = v->bitrate;
-	v->enc_ctx->gop_size = v->fps*5;
-	v->enc_ctx->qmin = 3;
+	v->enc_ctx->gop_size = 0; // v->fps*5;
 
 	v->enc_ctx->rtp_mode = 0;
 #if 0
 	v->enc_ctx->rtp_payload_size = 0;
-	v->enc_ctx->bit_rate_tolerance = 0;	/* not good */
 #endif
 	return 0;
 }
@@ -971,7 +965,7 @@
 	 */
 	for (i = H261_MIN_LEN, start = 0; start < len - 1; start = i, i += 4) {
 #if 0	/* test - disable packetization */
-		i = len;
+		i = len;	/* wrong... */
 #else
 		int found = 0, found_ebit = 0;	/* last GBSC position found */
 		for (; i < len ; i++) {
@@ -1019,6 +1013,7 @@
 		/* This frame is up to offset i (not inclusive).
 		 * We do not split it yet even if larger than MTU.
 		 */
+		ast_log(LOG_WARNING, "frame size %d\n", i - start);
 		f = create_video_frame(d + start, d+i, AST_FORMAT_H261,
 				pheader_len, cur);
 
@@ -1533,11 +1528,13 @@
 	 */
 	v->enc_ctx->rtp_mode = 1;
 	v->enc_ctx->rtp_payload_size = v->mtu / 2; // mtu/2
+	v->enc_ctx->bit_rate = v->bitrate;
 	v->enc_ctx->bit_rate_tolerance = v->enc_ctx->bit_rate/2;
+	v->enc_ctx->qmin = v->qmin;	/* should be configured */
+	v->enc_ctx->time_base = (AVRational){1, v->fps};
 
 	v->enc->enc_init(v);
  
-	v->enc_ctx->time_base = (AVRational){1, v->fps};
 	if (avcodec_open(v->enc_ctx, v->codec) < 0) {
 		ast_log(LOG_WARNING, "Unable to initialize the encoder %d\n",
 			codec);
@@ -2111,6 +2108,8 @@
 			env->in.dec_out.w, env->in.dec_out.h);
         } else if (!strcasecmp(var, "bitrate")) {
 		ast_cli(fd, "bitrate is [%d]\n", env->out.bitrate);
+        } else if (!strcasecmp(var, "qmin")) {
+		ast_cli(fd, "qmin is [%d]\n", env->out.qmin);
         } else if (!strcasecmp(var, "fps")) {
 		ast_cli(fd, "fps is [%d]\n", env->out.fps);
         } else {
@@ -2143,6 +2142,7 @@
 		env->out.fps = 5;
 		env->out.bitrate = 65000;
 		env->out.sendvideo = 1;
+		env->out.qmin = 3;
 	}
         M_STR("videodevice", env->out.videodevice)
         M_BOOL("sendvideo", env->out.sendvideo)
@@ -2152,6 +2152,7 @@
         M_F("remote_size", video_geom(&env->in.rem_dpy, val))
         M_UINT("fps", env->out.fps)
         M_UINT("bitrate", env->out.bitrate)
+        M_UINT("qmin", env->out.qmin)
 	M_STR("videoformat", env->codec_name)
 	M_END(return 1;)	/* the 'nothing found' case */
 	return 0;		/* found something */




More information about the asterisk-commits mailing list