Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minoru001 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libuvccamera/src/main/jni/UVCCamera/UVCPreview.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#define DEFAULT_PREVIEW_WIDTH 640
#define DEFAULT_PREVIEW_HEIGHT 480
#define DEFAULT_PREVIEW_FPS 30
#define DEFAULT_PREVIEW_FPS 15
#define DEFAULT_PREVIEW_MODE 0
#define DEFAULT_BANDWIDTH 1.0f

Expand Down
9 changes: 5 additions & 4 deletions libuvccamera/src/main/jni/libuvc/src/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,7 @@ uvc_error_t uvc_stream_start_bandwidth(uvc_stream_handle_t *strmh,
* packet sizes are increasing. */
const int num_alt = interface->num_altsetting - 1;
for (alt_idx = 0; alt_idx <= num_alt ; alt_idx++) {
alt_idx = 4; // FIXME just for test
altsetting = interface->altsetting + alt_idx;
endpoint_bytes_per_packet = 0;

Expand All @@ -1484,8 +1485,8 @@ uvc_error_t uvc_stream_start_bandwidth(uvc_stream_handle_t *strmh,
}
// XXX config_bytes_per_packet should not be zero otherwise zero divided exception occur
if (LIKELY(endpoint_bytes_per_packet)) {
if ( (endpoint_bytes_per_packet >= config_bytes_per_packet)
|| (alt_idx == num_alt) ) { // XXX always match to last altsetting for buggy device
// if ( (endpoint_bytes_per_packet >= config_bytes_per_packet) // FIXME just for test
// || (alt_idx == num_alt) ) { // XXX always match to last altsetting for buggy device // FIXME just for test
/* Transfers will be at most one frame long: Divide the maximum frame size
* by the size of the endpoint and round up */
packets_per_transfer = (dwMaxVideoFrameSize
Expand All @@ -1498,7 +1499,7 @@ uvc_error_t uvc_stream_start_bandwidth(uvc_stream_handle_t *strmh,

total_transfer_size = packets_per_transfer * endpoint_bytes_per_packet;
break;
}
// }
}
}
if (UNLIKELY(!endpoint_bytes_per_packet)) {
Expand All @@ -1520,7 +1521,7 @@ uvc_error_t uvc_stream_start_bandwidth(uvc_stream_handle_t *strmh,
} */

/* Select the altsetting */
MARK("Select the altsetting");
MARK("Select altsetting:%d", altsetting->bAlternateSetting);
ret = libusb_set_interface_alt_setting(strmh->devh->usb_devh,
altsetting->bInterfaceNumber, altsetting->bAlternateSetting);
if (UNLIKELY(ret != UVC_SUCCESS)) {
Expand Down
Binary file modified libuvccamera/src/main/libs/armeabi-v7a/libUVCCamera.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/armeabi-v7a/libuvc.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/armeabi/libUVCCamera.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/armeabi/libuvc.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/mips/libUVCCamera.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/mips/libuvc.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/x86/libUVCCamera.so
Binary file not shown.
Binary file modified libuvccamera/src/main/libs/x86/libuvc.so
Binary file not shown.
12 changes: 11 additions & 1 deletion usbCameraTest7/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@
<activity
android:name="com.serenegiant.usbcameratest7.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape" >
android:screenOrientation="landscape"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
</activity>
</application>

Expand Down
Loading