Skip to content

Commit

Permalink
Linux openpnp-capture-test: Output more keyboard control documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
trcwm committed May 4, 2020
1 parent 9321372 commit ce6e0a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions linux/platformcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ bool PlatformContext::enumerateDevices()
frmindex++;
cinfo.fps = findMaxFrameRate(fd, fmtdesc.pixelformat, cinfo.width, cinfo.height);
dinfo->m_formats.push_back(cinfo);
LOG(LOG_INFO, " %d x %d\n", cinfo.width, cinfo.height);
LOG(LOG_VERBOSE, " %d x %d\n", cinfo.width, cinfo.height);
}
}
index++;
Expand Down Expand Up @@ -207,11 +207,12 @@ uint32_t PlatformContext::findMaxFrameRate(int fd, uint32_t pixelformat,
ivals.width = width;
ivals.height = height;
ivals.index = 0;
LOG(LOG_VERBOSE,"Finding max frame rates: \n");
while (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &ivals) != -1)
{
if (ivals.type == V4L2_FRMIVAL_TYPE_DISCRETE)
{
LOG(LOG_INFO," FPS %d/%d", ivals.discrete.denominator, ivals.discrete.numerator);
LOG(LOG_VERBOSE," FPS %d/%d\n", ivals.discrete.denominator, ivals.discrete.numerator);
uint32_t v = ivals.discrete.denominator/ivals.discrete.numerator;
if (fps < v)
{
Expand Down
11 changes: 11 additions & 0 deletions linux/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ int main(int argc, char*argv[])
std::vector<uint8_t> m_buffer;
m_buffer.resize(finfo.width*finfo.height*3);

printf("Use the following keys:\n");
printf(" +/- : change the exposure\n");
printf(" 0 : set exposure to 0\n");
printf(" f/g : change the focus\n");
printf(" z/x : change the zoom\n");
printf(" [/] : change the white balance\n");
printf(" a/s : change the gain\n");
printf(" p : estimate the frame rate\n");
printf(" w : write one frame to a PPM file\n");
printf(" q : quit\n");

char c = 0;
int32_t v = 0;
uint32_t frameWriteCounter=0;
Expand Down

0 comments on commit ce6e0a0

Please sign in to comment.