BaseJpegDeocde exampe program
Dependencies: BaseJpegDecode Terminal BaseUsbHost mbed mbed-rtos
Fork of BaseJpegDecode by
Diff: UvcCam/UvcCam.h
- Revision:
- 7:3ad9c948bc06
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UvcCam/UvcCam.h Sun Jan 27 11:15:26 2013 +0000 @@ -0,0 +1,55 @@ +// UvcCam.h 2012/12/9 +#ifndef UVC_CAM_H +#define UVC_CAM_H + +#define UVC_160x120 2 +#define UVC_176x144 3 +#define UVC_320x176 4 +#define UVC_320x240 5 +#define UVC_352x288 6 +#define UVC_432x240 7 +#define UVC_640x480 1 +#define UVC_544x288 8 +#define UVC_640x360 9 +#define UVC_752x416 10 +#define UVC_800x448 11 +#define UVC_800x600 12 + +#define UVC_MJPEG 2 +#define UVC_YUY2 1 + +#define VERBOSE(...) do{printf(__VA_ARGS__);} while(0); + +class UvcCam : public BaseUvc { +public: + UvcCam(int formatIndex = UVC_MJPEG, int frameIndex = UVC_160x120, uint32_t interval = _5FPS, ControlEp* ctlEp = NULL); + static bool check(ControlEp* ctlEp); +}; + +class UvcCfg { +public: + UvcCfg(int formatIndex, int frameIndex, ControlEp* ctlEp); + uint8_t bEndpointAddress; + uint16_t wMaxPacketSize; + uint8_t FormatIndex; + uint8_t FrameIndex; + uint32_t dwFrameInterval; + uint8_t bInterface; + uint8_t bAlternate; + uint16_t bcdUVC; +protected: + void _parserAudioControl(uint8_t* buf, int len); + void _parserAudioStream(uint8_t* buf, int len); + void _parserVideoControl(uint8_t* buf, int len); + void _parserVideoStream(uint8_t* buf, int len); + void _parserConfigurationDescriptor(uint8_t* buf, int len); + uint16_t _width; + uint16_t _height; + uint8_t _payload; + int _If; + int _Ifalt; + int _IfClass; + int _IfSubClass; +}; + +#endif //UVC_CAM_H