/**
 * Update any annotation data specific to the video.
 * This simply passes on the setting from cli, or
 * if application defined annotate requested, updates
 * with the H264 parameters
 *
 * @param state Pointer to state control struct
 *
 */
void update_annotation_data(RASPIVID_STATE *state)
{
    // So, if we have asked for a application supplied string, set it to the H264 parameters
    if (state->camera_parameters.enable_annotate & ANNOTATE_APP_TEXT)
    {
        char *text;
        const char *refresh = raspicli_unmap_xref(state->intra_refresh_type, 
                intra_refresh_map, intra_refresh_map_size);

        asprintf(&text,  "%dk,%df,%s,%d,%s",
                 state->bitrate / 1000,  state->framerate,
                 refresh ? refresh : "(none)",
                 state->intraperiod,
                 raspicli_unmap_xref(state->profile, profile_map, profile_map_size));

        raspicamcontrol_set_annotate(state->camera_component, 
                state->camera_parameters.enable_annotate, text,
                state->camera_parameters.annotate_text_size,
                state->camera_parameters.annotate_text_colour,
                state->camera_parameters.annotate_bg_colour);

        free(text);
    }
    else
    {
        raspicamcontrol_set_annotate(state->camera_component, 
                state->camera_parameters.enable_annotate, 
                state->camera_parameters.annotate_string,
                state->camera_parameters.annotate_text_size,
                state->camera_parameters.annotate_text_colour,
                state->camera_parameters.annotate_bg_colour);
    }
}
예제 #2
0
/**
 * Dump contents of camera parameter structure to stdout for debugging/verbose logging
 *
 * @param params Const pointer to parameters structure to dump
 */
void raspicamcontrol_dump_parameters(const RASPICAM_CAMERA_PARAMETERS *params)
{
   const char *exp_mode = raspicli_unmap_xref(params->exposureMode, exposure_map, exposure_map_size);
   const char *awb_mode = raspicli_unmap_xref(params->awbMode, awb_map, awb_map_size);
   const char *image_effect = raspicli_unmap_xref(params->imageEffect, imagefx_map, imagefx_map_size);
   const char *metering_mode = raspicli_unmap_xref(params->exposureMeterMode, metering_mode_map, metering_mode_map_size);

   fprintf(stderr, "Sharpness %d, Contrast %d, Brightness %d\n", params->sharpness, params->contrast, params->brightness);
   fprintf(stderr, "Saturation %d, ISO %d, Video Stabilisation %s, Exposure compensation %d\n", params->saturation, params->ISO, params->videoStabilisation ? "Yes": "No", params->exposureCompensation);
   fprintf(stderr, "Exposure Mode '%s', AWB Mode '%s', Image Effect '%s'\n", exp_mode, awb_mode, image_effect);
   fprintf(stderr, "Metering Mode '%s', Colour Effect Enabled %s with U = %d, V = %d\n", metering_mode, params->colourEffects.enable ? "Yes":"No", params->colourEffects.u, params->colourEffects.v);
   fprintf(stderr, "Rotation %d, hflip %s, vflip %s\n", params->rotation, params->hflip ? "Yes":"No",params->vflip ? "Yes":"No");
   fprintf(stderr, "ROI x %lf, y %f, w %f h %f\n", params->roi.x, params->roi.y, params->roi.w, params->roi.h);
}
/**
 * Dump image state parameters to stderr.
 *
 * @param state Pointer to state structure to assign defaults to
 */
void dump_status(RASPIVID_STATE *state)
{
    if (!state)
    {
        vcos_assert(0);
        return;
    }

    DLOG_FORMAT("Width %d, Height %d", state->width, state->height );
    DLOG_FORMAT("bitrate %d, framerate %d", state->bitrate, state->framerate );
    DLOG_FORMAT("H264 Profile %s", raspicli_unmap_xref(state->profile, profile_map, profile_map_size));
    DLOG_FORMAT("H264 Quantisation level %d, Inline headers %s",
                state->quantisationParameter, state->bInlineHeaders ? "Yes" : "No");
    DLOG_FORMAT("H264 Intra refresh type %s, period %d",
                raspicli_unmap_xref(state->intra_refresh_type, intra_refresh_map, intra_refresh_map_size),
                state->intraperiod);

    raspipreview_dump_parameters(&state->preview_parameters);
    raspicamcontrol_dump_parameters(&state->camera_parameters);
}
예제 #4
0
파일: RaspiVid.c 프로젝트: jharan/userland
/**
 * Dump image state parameters to printf. Used for debugging
 *
 * @param state Pointer to state structure to assign defaults to
 */
static void dump_status(RASPIVID_STATE *state)
{
   if (!state)
   {
      vcos_assert(0);
      return;
   }

   fprintf(stderr, "Width %d, Height %d, filename %s\n", state->width, state->height, state->filename);
   fprintf(stderr, "bitrate %d, framerate %d, time delay %d\n", state->bitrate, state->framerate, state->timeout);
   fprintf(stderr, "H264 Profile %s\n", raspicli_unmap_xref(state->profile, profile_map, profile_map_size));

   raspipreview_dump_parameters(&state->preview_parameters);
   raspicamcontrol_dump_parameters(&state->camera_parameters);
}