PiImageStreamer
Loading...
Searching...
No Matches
Cameracfg.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAMERA_FPS   (30)
 
#define STREAM_FPS   (10)
 
#define CAMERA_WIDTH   (800)
 
#define CAMERA_HEIGHT   (600)
 
#define STREAM_WIDTH   (800)
 
#define STREAM_HEIGHT   (600)
 
#define STREAM_IMAGE_COMPRESSION_QUALITY   (10)
 
#define MAX_BYTES_IN_DATAGRAM   (1472)
 
#define UDP_DATAGRAM_TOTAL_SIZE   MAX_BYTES_IN_DATAGRAM
 
#define DATAGRAM_HEADER_SIZE   (16 * 4)
 
#define UDP_IMAGE_PAYLOAD_SIZE   (UDP_DATAGRAM_TOTAL_SIZE - DATAGRAM_HEADER_SIZE)
 

Detailed Description

Author
Walter Schilling (schil.nosp@m.ling.nosp@m.@msoe.nosp@m..edu)
Version
1.0

LICENSE

This code is developed as part of the MSOE SWE4211 Real Time Systems course, but can be freely used by others.

SWE4211 Real Time Systems is a required course for students studying the discipline of software engineering.

This Software is provided under the License on an "AS IS" basis and without warranties of any kind concerning the Software, including without limitation merchantability, fitness for a particular purpose, absence of defects or errors, accuracy, and non-infringement of intellectual property rights other than copyright. This disclaimer of warranty is an essential part of the License and a condition for the grant of any rights to this Software.

DESCRIPTION

This file defines the configuration for the camera and the compressed image stream: capture rate and resolution, stream rate and resolution, JPEG compression quality, and the UDP datagram sizes used when the stream is transmitted over the network.

Macro Definition Documentation

◆ CAMERA_FPS

#define CAMERA_FPS   (30)

This defines the number of frames per second that the camera captures. It also sets the camera task period (see CAMERA_TASK_PERIOD in TaskRates.h).

◆ CAMERA_HEIGHT

#define CAMERA_HEIGHT   (600)

This defines the camera resolution height, in pixels.

◆ CAMERA_WIDTH

#define CAMERA_WIDTH   (800)

This defines the camera resolution width, in pixels.

◆ DATAGRAM_HEADER_SIZE

#define DATAGRAM_HEADER_SIZE   (16 * 4)

This is the size of the application-level header placed at the start of each image datagram: 16 fields of 4 bytes (32 bits) each.

◆ MAX_BYTES_IN_DATAGRAM

#define MAX_BYTES_IN_DATAGRAM   (1472)

This defines the maximum number of bytes that can be placed in one UDP datagram without IP fragmentation. Typical header sizes are:

  • IPv4 header: 20 bytes
  • UDP header: 8 bytes
  • Total overhead: 28 bytes

So, for a standard Ethernet MTU of 1500 bytes, the maximum safe UDP payload is 1500 (MTU) - 20 (IPv4) - 8 (UDP) = 1472 bytes.

◆ STREAM_FPS

#define STREAM_FPS   (10)

This defines the frames per second transmitted over the stream. It sets the image stream task period (see IMAGE_STREAM_TASK_PERIOD in TaskRates.h).

◆ STREAM_HEIGHT

#define STREAM_HEIGHT   (600)

This defines the height of the transmitted stream, in pixels. The commented-out value is an alternate, smaller setting.

◆ STREAM_IMAGE_COMPRESSION_QUALITY

#define STREAM_IMAGE_COMPRESSION_QUALITY   (10)

This config parameter will set the compression quality for the image stream. Lower values give smaller images (less bandwidth) at the cost of image quality.

◆ STREAM_WIDTH

#define STREAM_WIDTH   (800)

This defines the width of the transmitted stream, in pixels. The commented-out value is an alternate, smaller setting.

◆ UDP_DATAGRAM_TOTAL_SIZE

#define UDP_DATAGRAM_TOTAL_SIZE   MAX_BYTES_IN_DATAGRAM

This is the total size of each image datagram that is transmitted.

◆ UDP_IMAGE_PAYLOAD_SIZE

#define UDP_IMAGE_PAYLOAD_SIZE   (UDP_DATAGRAM_TOTAL_SIZE - DATAGRAM_HEADER_SIZE)

This is the number of bytes of image data that fit in each datagram once the application-level header has been accounted for.