*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
if (image_format == AM7XXX_IMAGE_FORMAT_NV12) {
fprintf(stdout, "using raw output format\n");
*/
if (image_format == AM7XXX_IMAGE_FORMAT_NV12) {
fprintf(stdout, "using raw output format\n");
* in particular they won't be 0, this is needed because they are used
* as divisor somewhere in the encoding process */
output_codec_ctx->qmin = output_codec_ctx->qmax = ((100 - (quality - 1)) * FF_QUALITY_SCALE) / 100;
* in particular they won't be 0, this is needed because they are used
* as divisor somewhere in the encoding process */
output_codec_ctx->qmin = output_codec_ctx->qmax = ((100 - (quality - 1)) * FF_QUALITY_SCALE) / 100;
- output_codec_ctx->mb_lmin = output_codec_ctx->lmin = output_codec_ctx->qmin * FF_QP2LAMBDA;
- output_codec_ctx->mb_lmax = output_codec_ctx->lmax = output_codec_ctx->qmax * FF_QP2LAMBDA;
+ output_codec_ctx->mb_lmin = output_codec_ctx->qmin * FF_QP2LAMBDA;
+ output_codec_ctx->mb_lmax = output_codec_ctx->qmax * FF_QP2LAMBDA;
output_codec_ctx->flags |= CODEC_FLAG_QSCALE;
output_codec_ctx->global_quality = output_codec_ctx->qmin * FF_QP2LAMBDA;
output_codec_ctx->flags |= CODEC_FLAG_QSCALE;
output_codec_ctx->global_quality = output_codec_ctx->qmin * FF_QP2LAMBDA;
if (picture_raw == NULL) {
fprintf(stderr, "cannot allocate the raw picture frame!\n");
ret = -ENOMEM;
if (picture_raw == NULL) {
fprintf(stderr, "cannot allocate the raw picture frame!\n");
ret = -ENOMEM;
if (picture_scaled == NULL) {
fprintf(stderr, "cannot allocate the scaled picture!\n");
ret = -ENOMEM;
goto cleanup_picture_raw;
}
if (picture_scaled == NULL) {
fprintf(stderr, "cannot allocate the scaled picture!\n");
ret = -ENOMEM;
goto cleanup_picture_raw;
}
/* calculate the bytes needed for the output image and create buffer for the output image */
out_buf_size = avpicture_get_size((output_ctx.codec_ctx)->pix_fmt,
/* calculate the bytes needed for the output image and create buffer for the output image */
out_buf_size = avpicture_get_size((output_ctx.codec_ctx)->pix_fmt,
- char filename[NAME_MAX];
- FILE *file;
- if (!output_ctx.raw_output)
- snprintf(filename, NAME_MAX, "out_q%03d.jpg", quality);
- else
- snprintf(filename, NAME_MAX, "out.raw");
- file = fopen(filename, "wb");
- fwrite(out_picture, 1, out_picture_size, file);
- fclose(file);
+ if (dump_frame) {
+ char filename[NAME_MAX];
+ FILE *file;
+ if (!output_ctx.raw_output)
+ snprintf(filename, NAME_MAX, "out_q%03d.jpg", quality);
+ else
+ snprintf(filename, NAME_MAX, "out.raw");
+ file = fopen(filename, "wb");
+ fwrite(out_picture, 1, out_picture_size, file);
+ fclose(file);
+ }
+#else
+ (void) dump_frame;
printf("usage: %s [OPTIONS]\n\n", name);
printf("OPTIONS:\n");
printf("\t-d <index>\t\tthe device index (default is 0)\n");
printf("usage: %s [OPTIONS]\n\n", name);
printf("OPTIONS:\n");
printf("\t-d <index>\t\tthe device index (default is 0)\n");
printf("\t-f <input format>\tthe input device format\n");
printf("\t-i <input path>\t\tthe input path\n");
printf("\t-o <options>\t\ta comma separated list of input format options\n");
printf("\t-f <input format>\tthe input device format\n");
printf("\t-i <input path>\t\tthe input path\n");
printf("\t-o <options>\t\ta comma separated list of input format options\n");
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
printf("\t\t\t\tWARNING: Level 2 and greater require the master AND\n");
printf("\t\t\t\t the slave connector to be plugged in.\n");
AM7XXX_POWER_OFF, AM7XXX_POWER_TURBO);
printf("\t\t\t\tWARNING: Level 2 and greater require the master AND\n");
printf("\t\t\t\t the slave connector to be plugged in.\n");
- printf("\t-z <zoom mode>\t\tthe display zoom mode, between %d (original) and %d (test)\n",
- AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TEST);
+ printf("\t-z <zoom mode>\t\tthe display zoom mode, between %d (original) and %d (tele)\n",
+ AM7XXX_ZOOM_ORIGINAL, AM7XXX_ZOOM_TELE);
printf("\t-h \t\t\tthis help message\n");
printf("\n\nEXAMPLES OF USE:\n");
printf("\t%s -f x11grab -i :0.0 -o video_size=800x480\n", name);
printf("\t-h \t\t\tthis help message\n");
printf("\n\nEXAMPLES OF USE:\n");
printf("\t%s -f x11grab -i :0.0 -o video_size=800x480\n", name);
fprintf(stdout, "Zoom: %d\n", zoom);
break;
default:
fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",
fprintf(stdout, "Zoom: %d\n", zoom);
break;
default:
fprintf(stderr, "Invalid zoom mode value, must be between %d and %d\n",