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

ux_host_class_video: Save clock frequency during video channel start #123

Open
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions common/usbx_host_classes/inc/ux_host_class_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ typedef struct UX_HOST_CLASS_VIDEO_STRUCT
UCHAR *ux_host_class_video_current_frame_address;
ULONG ux_host_class_video_current_frame_interval;
ULONG ux_host_class_video_current_max_payload_size;
ULONG ux_host_class_video_current_clock_frequency;
UX_TRANSFER ux_host_class_video_transfer_requests[UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST_COUNT];
ULONG ux_host_class_video_transfer_request_start_index;
ULONG ux_host_class_video_transfer_request_end_index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ UX_ENDPOINT *endpoint;
ULONG endpoint_index;
UINT streaming_interface;
UINT max_payload_size;
ULONG clock_frequency;


/* Protect thread reentry to this instance. */
Expand Down Expand Up @@ -202,6 +203,9 @@ UINT max_payload_size;
max_payload_size = video_parameter -> ux_host_class_video_parameter_channel_bandwidth_selection;
}

/* Save clock frequency of the video stream */
clock_frequency = _ux_utility_long_get(control_buffer + UX_HOST_CLASS_VIDEO_PROBE_COMMIT_CLOCK_FREQUENCY);

/* Search for the non zero alternate setting of the video stream. */
status = _ux_host_class_video_alternate_setting_locate(video, max_payload_size, &alternate_setting);

Expand Down Expand Up @@ -257,7 +261,10 @@ UINT max_payload_size;
It's not exceeding endpoint bandwidth since the interface alternate
setting is located by max payload size. */
video -> ux_host_class_video_current_max_payload_size = max_payload_size;


/* Save the clock frequecny */
video -> ux_host_class_video_current_clock_frequency = clock_frequency;

/* Free all used resources. */
_ux_utility_memory_free(control_buffer);

Expand Down