The page below shows how to set the resolution and FPS for color and depth.
Taking this line as an example:
cfg.enable_stream( RS2_STREAM_COLOR, 1920, 1080, RS2_FORMAT_RGB8, 30 );
The first two numbers in the bracket set the resolution. So 1280x1024 would be:
cfg.enable_stream( RS2_STREAM_COLOR, 1280, 1024, RS2_FORMAT_RGB8, 30 );
The third and final number at the end of the bracket sets the FPS. Please refer to the table in the linked article to find an FPS supported by your chosen resolution.
To set the infrared resolution, use RS2_STREAM_INFRARED
cfg.enable_stream(RS2_STREAM_INFRARED, 640, 480, RS2_FORMAT_Y8, 30);
This page has some useful sample scripts for getting started with SDK 2.0 programming: