Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <syslog.h>
00024 #include "mjpg_streamer.h"
00025 #define INPUT_PLUGIN_PREFIX " i: "
00026 #define IPRINT(...) { char _bf[1024] = {0}; snprintf(_bf, sizeof(_bf)-1, __VA_ARGS__); fprintf(stderr, "%s", INPUT_PLUGIN_PREFIX); fprintf(stderr, "%s", _bf); syslog(LOG_INFO, "%s", _bf); }
00027
00028
00029 typedef struct _input_parameter input_parameter;
00030 struct _input_parameter {
00031 int id;
00032 char *parameters;
00033 int argc;
00034 char *argv[MAX_PLUGIN_ARGUMENTS];
00035 struct _globals *global;
00036 };
00037
00038 typedef struct _input_resolution input_resolution;
00039 struct _input_resolution {
00040 unsigned int width;
00041 unsigned int height;
00042 };
00043
00044 typedef struct _input_format input_format;
00045 struct _input_format {
00046 struct v4l2_fmtdesc format;
00047 input_resolution *supportedResolutions;
00048 int resolutionCount;
00049 char currentResolution;
00050 };
00051
00052
00053 typedef struct _input input;
00054 struct _input {
00055 char *plugin;
00056 void *handle;
00057
00058 input_parameter param;
00059
00060
00061 struct _control *in_parameters;
00062 int parametercount;
00063
00064
00065 struct v4l2_jpegcompression jpegcomp;
00066
00067
00068 pthread_mutex_t db;
00069 pthread_cond_t db_update;
00070
00071
00072 unsigned char *buf;
00073 int size;
00074
00075
00076 struct timeval timestamp;
00077
00078 input_format *in_formats;
00079 int formatCount;
00080 int currentFormat;
00081
00082 int (*init)(input_parameter *, int id);
00083 int (*stop)(int);
00084 int (*run)(int);
00085 int (*cmd)(int plugin, unsigned int control_id, unsigned int group, int value);
00086 };