aboutsummaryrefslogtreecommitdiff
path: root/cast/streaming/capture_configs.h
diff options
context:
space:
mode:
Diffstat (limited to 'cast/streaming/capture_configs.h')
-rw-r--r--cast/streaming/capture_configs.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/cast/streaming/capture_configs.h b/cast/streaming/capture_configs.h
index fd99c17c..56b15898 100644
--- a/cast/streaming/capture_configs.h
+++ b/cast/streaming/capture_configs.h
@@ -9,6 +9,8 @@
#include <vector>
#include "cast/streaming/constants.h"
+#include "cast/streaming/resolution.h"
+#include "util/simple_fraction.h"
namespace openscreen {
namespace cast {
@@ -33,25 +35,11 @@ struct AudioCaptureConfig {
// Target playout delay in milliseconds.
std::chrono::milliseconds target_playout_delay = kDefaultTargetPlayoutDelay;
-};
-
-// Display resolution in pixels.
-struct DisplayResolution {
- // Width in pixels.
- int width = 1920;
- // Height in pixels.
- int height = 1080;
-};
-
-// Frame rates are expressed as a rational number, and must be positive.
-struct FrameRate {
- // For simple cases, the frame rate may be provided by simply setting the
- // number to the desired value, e.g. 30 or 60FPS. Some common frame rates like
- // 23.98 FPS (for NTSC compatibility) are represented as fractions, in this
- // case 24000/1001.
- int numerator = kDefaultFrameRate;
- int denominator = 1;
+ // The codec parameter for this configuration. Honors the format laid out
+ // in RFC 6381: https://datatracker.ietf.org/doc/html/rfc6381
+ // NOTE: the "profiles" parameter is not supported in our implementation.
+ std::string codec_parameter;
};
// A configuration set that can be used by the sender to capture video, as
@@ -62,7 +50,11 @@ struct VideoCaptureConfig {
VideoCodec codec = VideoCodec::kVp8;
// Maximum frame rate in frames per second.
- FrameRate max_frame_rate;
+ // For simple cases, the frame rate may be provided by simply setting the
+ // number to the desired value, e.g. 30 or 60FPS. Some common frame rates like
+ // 23.98 FPS (for NTSC compatibility) are represented as fractions, in this
+ // case 24000/1001.
+ SimpleFraction max_frame_rate{kDefaultFrameRate, 1};
// Number specifying the maximum bit rate for this stream. A value of
// zero means that the maximum bit rate should be automatically selected by
@@ -71,10 +63,18 @@ struct VideoCaptureConfig {
// Resolutions to be offered to the receiver. At least one resolution
// must be provided.
- std::vector<DisplayResolution> resolutions;
+ std::vector<Resolution> resolutions;
// Target playout delay in milliseconds.
std::chrono::milliseconds target_playout_delay = kDefaultTargetPlayoutDelay;
+
+ // The codec parameter for this configuration. Honors the format laid out
+ // in RFC 6381: https://datatracker.ietf.org/doc/html/rfc6381.
+ // VP8 and VP9 codec parameter versions are defined here:
+ // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#webm
+ // https://www.webmproject.org/vp9/mp4/#codecs-parameter-string
+ // NOTE: the "profiles" parameter is not supported in our implementation.
+ std::string codec_parameter;
};
} // namespace cast