Skip to content

Commit

Permalink
bump up frame rate to 30fps in example
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Jan 25, 2024
1 parent 9db1fdf commit 536c823
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/Video/video_capture/video_capture.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//--------------------------------------------------------------------+
#define FRAME_WIDTH 128
#define FRAME_HEIGHT 96
#define FRAME_RATE 10
#define FRAME_RATE 30

uint8_t const desc_video[] = {
TUD_VIDEO_CAPTURE_DESCRIPTOR_UNCOMPR_BULK(0, 0x80, FRAME_WIDTH, FRAME_HEIGHT, FRAME_RATE, 64)
Expand All @@ -41,7 +41,6 @@ static void fill_color_bar(uint8_t* buffer, unsigned start_position);

void setup() {
Serial.begin(115200);
// Serial.end();
usb_video.begin();
}

Expand Down
9 changes: 9 additions & 0 deletions src/arduino/video/Adafruit_USBD_Video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Adafruit_USBD_Video::Adafruit_USBD_Video(uint8_t const *desc_itf,
size_t desc_len) {
_desc_itf = desc_itf;
_desc_len = desc_len;
_vc_id = 0;
}

bool Adafruit_USBD_Video::begin() {
Expand All @@ -57,4 +58,12 @@ uint16_t Adafruit_USBD_Video::getInterfaceDescriptor(uint8_t itfnum,
return _desc_len;
}

//--------------------------------------------------------------------+
// API
//--------------------------------------------------------------------+

// bool Adafruit_USBD_Video::isStreaming(uint8_t stream_idx) {
// return tud_video_n_streaming(_vc_id, stream_idx);
// }

#endif
4 changes: 4 additions & 0 deletions src/arduino/video/Adafruit_USBD_Video.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ class Adafruit_USBD_Video : public Adafruit_USBD_Interface {

bool begin();

//------------- API -------------//
// bool isStreaming(uint8_t stream_idx);

// from Adafruit_USBD_Interface
virtual uint16_t getInterfaceDescriptor(uint8_t itfnum, uint8_t *buf,
uint16_t bufsize);

private:
uint8_t const *_desc_itf;
size_t _desc_len;
uint8_t _vc_id;
};

#endif

0 comments on commit 536c823

Please sign in to comment.