@@ -17,9 +17,9 @@ bool frame_callback(const CcapVideoFrame* frame, void* userData) {
1717
1818 CcapVideoFrameInfo frameInfo ;
1919 if (ccap_video_frame_get_info (frame , & frameInfo )) {
20- printf ("Frame %d: %dx%d, format=%d, timestamp=%d \n" ,
20+ printf ("Frame %d: %dx%d, format=%d, timestamp=%llu \n" ,
2121 frameCount , frameInfo .width , frameInfo .height ,
22- frameInfo .pixelFormat , ( int ) frameInfo .timestamp );
22+ frameInfo .pixelFormat , frameInfo .timestamp );
2323 }
2424
2525 // Return false to keep the frame available for grab()
@@ -71,14 +71,17 @@ int main() {
7171 // Get device info
7272 CcapDeviceInfo deviceInfo ;
7373 if (ccap_provider_get_device_info (provider , & deviceInfo )) {
74- printf ("Device: %s\n" , deviceInfo .deviceName ? deviceInfo .deviceName : "Unknown" );
74+ printf ("Device: %s\n" , deviceInfo .deviceName [ 0 ] ? deviceInfo .deviceName : "Unknown" );
7575 printf ("Supported pixel formats: %zu\n" , deviceInfo .pixelFormatCount );
7676 printf ("Supported resolutions: %zu\n" , deviceInfo .resolutionCount );
7777
7878 if (deviceInfo .resolutionCount > 0 ) {
79- printf ("First resolution: %dx%d\n" ,
80- deviceInfo .supportedResolutions [0 ].width ,
81- deviceInfo .supportedResolutions [0 ].height );
79+ printf ("Supported resolutions:\n" );
80+ for (size_t i = 0 ; i < deviceInfo .resolutionCount ; i ++ ) {
81+ printf (" %zu: %dx%d\n" , i + 1 ,
82+ deviceInfo .supportedResolutions [i ].width ,
83+ deviceInfo .supportedResolutions [i ].height );
84+ }
8285 }
8386 }
8487
@@ -127,4 +130,4 @@ int main() {
127130
128131 printf ("Example completed successfully\n" );
129132 return 0 ;
130- }
133+ }
0 commit comments