Skip to content

Commit 536c823

Browse files
committed
bump up frame rate to 30fps in example
1 parent 9db1fdf commit 536c823

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

examples/Video/video_capture/video_capture.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//--------------------------------------------------------------------+
1818
#define FRAME_WIDTH 128
1919
#define FRAME_HEIGHT 96
20-
#define FRAME_RATE 10
20+
#define FRAME_RATE 30
2121

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

4242
void setup() {
4343
Serial.begin(115200);
44-
// Serial.end();
4544
usb_video.begin();
4645
}
4746

src/arduino/video/Adafruit_USBD_Video.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Adafruit_USBD_Video::Adafruit_USBD_Video(uint8_t const *desc_itf,
3434
size_t desc_len) {
3535
_desc_itf = desc_itf;
3636
_desc_len = desc_len;
37+
_vc_id = 0;
3738
}
3839

3940
bool Adafruit_USBD_Video::begin() {
@@ -57,4 +58,12 @@ uint16_t Adafruit_USBD_Video::getInterfaceDescriptor(uint8_t itfnum,
5758
return _desc_len;
5859
}
5960

61+
//--------------------------------------------------------------------+
62+
// API
63+
//--------------------------------------------------------------------+
64+
65+
// bool Adafruit_USBD_Video::isStreaming(uint8_t stream_idx) {
66+
// return tud_video_n_streaming(_vc_id, stream_idx);
67+
// }
68+
6069
#endif

src/arduino/video/Adafruit_USBD_Video.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ class Adafruit_USBD_Video : public Adafruit_USBD_Interface {
3535

3636
bool begin();
3737

38+
//------------- API -------------//
39+
// bool isStreaming(uint8_t stream_idx);
40+
3841
// from Adafruit_USBD_Interface
3942
virtual uint16_t getInterfaceDescriptor(uint8_t itfnum, uint8_t *buf,
4043
uint16_t bufsize);
4144

4245
private:
4346
uint8_t const *_desc_itf;
4447
size_t _desc_len;
48+
uint8_t _vc_id;
4549
};
4650

4751
#endif

0 commit comments

Comments
 (0)