Agora Java API Reference for Android
video_config_i.h
1 //
2 // Agora Media SDK
3 //
4 // Created by Rao Qi in 2019-05.
5 // Copyright (c) 2019 Agora IO. All rights reserved.
6 //
7 #pragma once
8 
9 #include <cstdint>
10 #include <sstream>
11 #include <string>
12 
13 #include "AgoraBase.h"
14 #include "AgoraOptional.h"
15 
16 #if defined(WEBRTC_WIN)
17 #define NEW_LINE "\r\n"
18 #else
19 #define NEW_LINE "\n"
20 #endif
21 
22 namespace agora {
23 namespace rtc {
24 
26  public:
27  // do NOT add any default value here
28  VideoConfigurationEx() = default;
29  ~VideoConfigurationEx() = default;
30  void SetAll(const VideoConfigurationEx& change) {
31 #define SET_FROM(X) SetFrom(&X, change.X)
32 
33  SET_FROM(codec_type);
34  SET_FROM(frame_width);
35  SET_FROM(frame_height);
36  SET_FROM(frame_rate);
37  SET_FROM(start_bitrate);
38  SET_FROM(target_bitrate);
39  SET_FROM(min_bitrate);
40  SET_FROM(max_bitrate);
41  SET_FROM(orientation_mode);
42  SET_FROM(number_of_temporal_layers);
43  SET_FROM(sps_data);
44  SET_FROM(pps_data);
45  SET_FROM(h264_profile);
46  SET_FROM(adaptive_op_mode);
47  SET_FROM(number_of_spatial_layers);
48  SET_FROM(flexible_mode);
49  SET_FROM(interlayer_pred);
50  SET_FROM(num_of_encoder_cores);
51  SET_FROM(degradation_preference);
52  SET_FROM(fps_down_step);
53  SET_FROM(fps_up_step);
54  SET_FROM(vqc_version);
55  SET_FROM(complexity);
56  SET_FROM(denoising_on);
57  SET_FROM(automatic_resize_on);
58  SET_FROM(frame_dropping_on);
59  SET_FROM(has_intra_request);
60  SET_FROM(key_frame_interval);
61  SET_FROM(entropy_coding_mode_flag);
62  SET_FROM(loop_filter_disable_idc);
63  SET_FROM(background_detection_on);
64  SET_FROM(posted_frames_waiting_for_encode);
65  SET_FROM(bitrate_adjust_ratio);
66  SET_FROM(minbitrate_ratio);
67  SET_FROM(quality_scale_only_on_average_qp);
68  SET_FROM(h264_qp_thresholds_low);
69  SET_FROM(h264_qp_thresholds_high);
70  SET_FROM(enable_hw_encoder);
71  SET_FROM(enable_hw_decoder);
72  SET_FROM(hw_encoder_provider);
73  SET_FROM(av_dec_common_input_format);
74  SET_FROM(av_dec_common_output_format);
75  SET_FROM(av_dec_mmcss_class);
76  SET_FROM(av_enc_codec_type);
77  SET_FROM(av_enc_common_buffer_in_level);
78  SET_FROM(av_enc_common_buffer_out_level);
79  SET_FROM(av_enc_common_buffer_size);
80  SET_FROM(av_enc_common_format_constraint);
81  SET_FROM(av_enc_common_low_latency);
82  SET_FROM(av_enc_common_max_bit_rate);
83  SET_FROM(av_enc_common_mean_bit_rate);
84  SET_FROM(av_enc_common_mean_bit_rate_interval);
85  SET_FROM(av_enc_common_min_bit_rate);
86  SET_FROM(av_enc_common_quality);
87  SET_FROM(av_enc_common_quality_vs_speed);
88  SET_FROM(av_enc_common_rate_control_mode);
89  SET_FROM(av_enc_common_real_time);
90  SET_FROM(av_enc_common_stream_end_handling);
91  SET_FROM(av_enc_mux_output_stream_type);
92  SET_FROM(av_dec_video_acceleration_h264);
93  SET_FROM(av_dec_video_acceleration_mpeg2);
94  SET_FROM(av_dec_video_acceleration_vc1);
95  SET_FROM(av_dec_video_drop_pic_with_missing_ref);
96  SET_FROM(av_dec_video_fast_decode_mode);
97  SET_FROM(av_dec_video_input_scan_type);
98  SET_FROM(av_dec_video_pixel_aspect_ratio);
99  SET_FROM(av_dec_video_software_deinterlace_mode);
100  SET_FROM(av_dec_video_sw_power_level);
101  SET_FROM(av_dec_video_thumbnail_generation_mode);
102  SET_FROM(av_enc_input_video_system);
103  SET_FROM(av_enc_video_cbr_motion_tradeoff);
104  SET_FROM(av_enc_video_coded_video_access_unit_size);
105  SET_FROM(av_enc_video_default_upper_field_dominant);
106  SET_FROM(av_enc_video_display_dimension);
107  SET_FROM(av_enc_video_encode_dimension);
108  SET_FROM(av_enc_video_encode_offset_origin);
109  SET_FROM(av_enc_video_field_swap);
110  SET_FROM(av_enc_video_force_source_scan_type);
111  SET_FROM(av_enc_video_header_drop_frame);
112  SET_FROM(av_enc_video_header_frames);
113  SET_FROM(av_enc_video_header_hours);
114  SET_FROM(av_enc_video_header_minutes);
115  SET_FROM(av_enc_video_header_seconds);
116  SET_FROM(av_enc_video_input_chroma_resolution);
117  SET_FROM(av_enc_video_input_chroma_subsampling);
118  SET_FROM(av_enc_video_input_color_lighting);
119  SET_FROM(av_enc_video_input_color_nominal_range);
120  SET_FROM(av_enc_video_input_color_primaries);
121  SET_FROM(av_enc_video_input_color_transfer_function);
122  SET_FROM(av_enc_video_input_color_transfer_matrix);
123  SET_FROM(av_enc_video_inverse_telecine_enable);
124  SET_FROM(av_enc_video_inverse_telecine_threshold);
125  SET_FROM(av_enc_video_max_keyframe_distance);
126  SET_FROM(av_enc_video_no_of_fields_to_encode);
127  SET_FROM(av_enc_video_no_of_fields_to_skip);
128  SET_FROM(av_enc_video_output_chroma_resolution);
129  SET_FROM(av_enc_video_output_chroma_subsampling);
130  SET_FROM(av_enc_video_output_color_lighting);
131  SET_FROM(av_enc_video_output_color_nominal_range);
132  SET_FROM(av_enc_video_output_color_primaries);
133  SET_FROM(av_enc_video_output_color_transfer_function);
134  SET_FROM(av_enc_video_output_color_transfer_matrix);
135  SET_FROM(av_enc_video_output_frame_rate);
136  SET_FROM(av_enc_video_output_frame_rate_conversion);
137  SET_FROM(av_enc_video_output_scan_type);
138  SET_FROM(av_enc_video_pixel_aspect_ratio);
139  SET_FROM(av_enc_video_source_film_content);
140  SET_FROM(av_enc_video_source_is_bw);
141  SET_FROM(av_enc_mpv_add_seq_end_code);
142  SET_FROM(av_enc_mpv_default_b_picture_count);
143  SET_FROM(av_enc_mpv_frame_field_mode);
144  SET_FROM(av_enc_mpv_generate_header_pic_disp_ext);
145  SET_FROM(av_enc_mpv_generate_header_pic_ext);
146  SET_FROM(av_enc_mpv_generate_header_seq_disp_ext);
147  SET_FROM(av_enc_mpv_generate_header_seq_ext);
148  SET_FROM(av_enc_mpv_generate_header_seq_scale_ext);
149  SET_FROM(av_enc_mpvgop_open);
150  SET_FROM(av_enc_mpvgops_in_seq);
151  SET_FROM(av_enc_mpvgop_size);
152  SET_FROM(av_enc_mpv_intra_dc_precision);
153  SET_FROM(av_enc_mpv_intra_vlc_table);
154  SET_FROM(av_enc_mpv_level);
155  SET_FROM(av_enc_mpv_profile);
156  SET_FROM(av_enc_mpvq_scale_type);
157  SET_FROM(av_enc_mpv_quant_matrix_chroma_intra);
158  SET_FROM(av_enc_mpv_quant_matrix_chroma_non_intra);
159  SET_FROM(av_enc_mpv_quant_matrix_intra);
160  SET_FROM(av_enc_mpv_quant_matrix_non_intra);
161  SET_FROM(av_enc_mpv_scan_pattern);
162  SET_FROM(av_enc_mpv_scene_detection);
163  SET_FROM(av_enc_mpv_use_concealment_motion_vectors);
164  SET_FROM(vdm_not_override_lua_smallvideo_not_use_hwenc_policy);
165  SET_FROM(enable_video_sender_frame_dropper);
166 
167 #undef SET_FROM
168  }
169 
170  bool operator==(const VideoConfigurationEx& o) const {
171 #define BEGIN_COMPARE() bool b = true
172 #define ADD_COMPARE(X) b = (b && (X == o.X))
173 #define END_COMPARE()
174 
175  BEGIN_COMPARE();
176  ADD_COMPARE(codec_type);
177  ADD_COMPARE(frame_width);
178  ADD_COMPARE(frame_height);
179  ADD_COMPARE(frame_rate);
180  ADD_COMPARE(start_bitrate);
181  ADD_COMPARE(target_bitrate);
182  ADD_COMPARE(min_bitrate);
183  ADD_COMPARE(orientation_mode);
184  ADD_COMPARE(number_of_temporal_layers);
185  ADD_COMPARE(sps_data);
186  ADD_COMPARE(pps_data);
187  ADD_COMPARE(h264_profile);
188  ADD_COMPARE(adaptive_op_mode);
189  ADD_COMPARE(number_of_spatial_layers);
190  ADD_COMPARE(flexible_mode);
191  ADD_COMPARE(interlayer_pred);
192  ADD_COMPARE(num_of_encoder_cores);
193  ADD_COMPARE(degradation_preference);
194  ADD_COMPARE(fps_down_step);
195  ADD_COMPARE(fps_up_step);
196  ADD_COMPARE(vqc_version);
197  ADD_COMPARE(complexity);
198  ADD_COMPARE(denoising_on);
199  ADD_COMPARE(automatic_resize_on);
200  ADD_COMPARE(frame_dropping_on);
201  ADD_COMPARE(has_intra_request);
202  ADD_COMPARE(key_frame_interval);
203  ADD_COMPARE(entropy_coding_mode_flag);
204  ADD_COMPARE(loop_filter_disable_idc);
205  ADD_COMPARE(background_detection_on);
206  ADD_COMPARE(posted_frames_waiting_for_encode);
207  ADD_COMPARE(bitrate_adjust_ratio);
208  ADD_COMPARE(minbitrate_ratio);
209  ADD_COMPARE(quality_scale_only_on_average_qp);
210  ADD_COMPARE(h264_qp_thresholds_low);
211  ADD_COMPARE(h264_qp_thresholds_high);
212  ADD_COMPARE(enable_hw_encoder);
213  ADD_COMPARE(enable_hw_decoder);
214  ADD_COMPARE(hw_encoder_provider);
215  ADD_COMPARE(av_dec_common_input_format);
216  ADD_COMPARE(av_dec_common_output_format);
217  ADD_COMPARE(av_dec_mmcss_class);
218  ADD_COMPARE(av_enc_codec_type);
219  ADD_COMPARE(av_enc_common_buffer_in_level);
220  ADD_COMPARE(av_enc_common_buffer_out_level);
221  ADD_COMPARE(av_enc_common_buffer_size);
222  ADD_COMPARE(av_enc_common_format_constraint);
223  ADD_COMPARE(av_enc_common_low_latency);
224  ADD_COMPARE(av_enc_common_max_bit_rate);
225  ADD_COMPARE(av_enc_common_mean_bit_rate);
226  ADD_COMPARE(av_enc_common_mean_bit_rate_interval);
227  ADD_COMPARE(av_enc_common_min_bit_rate);
228  ADD_COMPARE(av_enc_common_quality);
229  ADD_COMPARE(av_enc_common_quality_vs_speed);
230  ADD_COMPARE(av_enc_common_rate_control_mode);
231  ADD_COMPARE(av_enc_common_real_time);
232  ADD_COMPARE(av_enc_common_stream_end_handling);
233  ADD_COMPARE(av_enc_mux_output_stream_type);
234  ADD_COMPARE(av_dec_video_acceleration_h264);
235  ADD_COMPARE(av_dec_video_acceleration_mpeg2);
236  ADD_COMPARE(av_dec_video_acceleration_vc1);
237  ADD_COMPARE(av_dec_video_drop_pic_with_missing_ref);
238  ADD_COMPARE(av_dec_video_fast_decode_mode);
239  ADD_COMPARE(av_dec_video_input_scan_type);
240  ADD_COMPARE(av_dec_video_pixel_aspect_ratio);
241  ADD_COMPARE(av_dec_video_software_deinterlace_mode);
242  ADD_COMPARE(av_dec_video_sw_power_level);
243  ADD_COMPARE(av_dec_video_thumbnail_generation_mode);
244  ADD_COMPARE(av_enc_input_video_system);
245  ADD_COMPARE(av_enc_video_cbr_motion_tradeoff);
246  ADD_COMPARE(av_enc_video_coded_video_access_unit_size);
247  ADD_COMPARE(av_enc_video_default_upper_field_dominant);
248  ADD_COMPARE(av_enc_video_display_dimension);
249  ADD_COMPARE(av_enc_video_encode_dimension);
250  ADD_COMPARE(av_enc_video_encode_offset_origin);
251  ADD_COMPARE(av_enc_video_field_swap);
252  ADD_COMPARE(av_enc_video_force_source_scan_type);
253  ADD_COMPARE(av_enc_video_header_drop_frame);
254  ADD_COMPARE(av_enc_video_header_frames);
255  ADD_COMPARE(av_enc_video_header_hours);
256  ADD_COMPARE(av_enc_video_header_minutes);
257  ADD_COMPARE(av_enc_video_header_seconds);
258  ADD_COMPARE(av_enc_video_input_chroma_resolution);
259  ADD_COMPARE(av_enc_video_input_chroma_subsampling);
260  ADD_COMPARE(av_enc_video_input_color_lighting);
261  ADD_COMPARE(av_enc_video_input_color_nominal_range);
262  ADD_COMPARE(av_enc_video_input_color_primaries);
263  ADD_COMPARE(av_enc_video_input_color_transfer_function);
264  ADD_COMPARE(av_enc_video_input_color_transfer_matrix);
265  ADD_COMPARE(av_enc_video_inverse_telecine_enable);
266  ADD_COMPARE(av_enc_video_inverse_telecine_threshold);
267  ADD_COMPARE(av_enc_video_max_keyframe_distance);
268  ADD_COMPARE(av_enc_video_no_of_fields_to_encode);
269  ADD_COMPARE(av_enc_video_no_of_fields_to_skip);
270  ADD_COMPARE(av_enc_video_output_chroma_resolution);
271  ADD_COMPARE(av_enc_video_output_chroma_subsampling);
272  ADD_COMPARE(av_enc_video_output_color_lighting);
273  ADD_COMPARE(av_enc_video_output_color_nominal_range);
274  ADD_COMPARE(av_enc_video_output_color_primaries);
275  ADD_COMPARE(av_enc_video_output_color_transfer_function);
276  ADD_COMPARE(av_enc_video_output_color_transfer_matrix);
277  ADD_COMPARE(av_enc_video_output_frame_rate);
278  ADD_COMPARE(av_enc_video_output_frame_rate_conversion);
279  ADD_COMPARE(av_enc_video_output_scan_type);
280  ADD_COMPARE(av_enc_video_pixel_aspect_ratio);
281  ADD_COMPARE(av_enc_video_source_film_content);
282  ADD_COMPARE(av_enc_video_source_is_bw);
283  ADD_COMPARE(av_enc_mpv_add_seq_end_code);
284  ADD_COMPARE(av_enc_mpv_default_b_picture_count);
285  ADD_COMPARE(av_enc_mpv_frame_field_mode);
286  ADD_COMPARE(av_enc_mpv_generate_header_pic_disp_ext);
287  ADD_COMPARE(av_enc_mpv_generate_header_pic_ext);
288  ADD_COMPARE(av_enc_mpv_generate_header_seq_disp_ext);
289  ADD_COMPARE(av_enc_mpv_generate_header_seq_ext);
290  ADD_COMPARE(av_enc_mpv_generate_header_seq_scale_ext);
291  ADD_COMPARE(av_enc_mpvgop_open);
292  ADD_COMPARE(av_enc_mpvgops_in_seq);
293  ADD_COMPARE(av_enc_mpvgop_size);
294  ADD_COMPARE(av_enc_mpv_intra_dc_precision);
295  ADD_COMPARE(av_enc_mpv_intra_vlc_table);
296  ADD_COMPARE(av_enc_mpv_level);
297  ADD_COMPARE(av_enc_mpv_profile);
298  ADD_COMPARE(av_enc_mpvq_scale_type);
299  ADD_COMPARE(av_enc_mpv_quant_matrix_chroma_intra);
300  ADD_COMPARE(av_enc_mpv_quant_matrix_chroma_non_intra);
301  ADD_COMPARE(av_enc_mpv_quant_matrix_intra);
302  ADD_COMPARE(av_enc_mpv_quant_matrix_non_intra);
303  ADD_COMPARE(av_enc_mpv_scan_pattern);
304  ADD_COMPARE(av_enc_mpv_scene_detection);
305  ADD_COMPARE(av_enc_mpv_use_concealment_motion_vectors);
306  ADD_COMPARE(vdm_not_override_lua_smallvideo_not_use_hwenc_policy);
307  ADD_COMPARE(enable_video_sender_frame_dropper);
308  END_COMPARE();
309 
310 #undef BEGIN_COMPARE
311 #undef ADD_COMPARE
312 #undef END_COMPARE
313  return b;
314  }
315 
316  bool operator!=(const VideoConfigurationEx& o) const { return !(*this == o); }
317 
318  std::string ToString() const {
319 #define ADD_STRING(X) ost << ToStringIfSet(#X, X)
320 
321  std::ostringstream ost;
322  ADD_STRING(codec_type);
323  ADD_STRING(frame_width);
324  ADD_STRING(frame_height);
325  ADD_STRING(frame_rate);
326  ADD_STRING(start_bitrate);
327  ADD_STRING(target_bitrate);
328  ADD_STRING(min_bitrate);
329  ADD_STRING(max_bitrate);
330  ADD_STRING(orientation_mode);
331  ADD_STRING(number_of_temporal_layers);
332  ADD_STRING(sps_data);
333  ADD_STRING(pps_data);
334  ADD_STRING(h264_profile);
335  ADD_STRING(adaptive_op_mode);
336  ADD_STRING(number_of_spatial_layers);
337  ADD_STRING(flexible_mode);
338  ADD_STRING(interlayer_pred);
339  ADD_STRING(num_of_encoder_cores);
340  ADD_STRING(degradation_preference);
341  ADD_STRING(fps_down_step);
342  ADD_STRING(fps_up_step);
343  ADD_STRING(vqc_version);
344  ADD_STRING(complexity);
345  ADD_STRING(denoising_on);
346  ADD_STRING(automatic_resize_on);
347  ADD_STRING(frame_dropping_on);
348  ADD_STRING(has_intra_request);
349  ADD_STRING(key_frame_interval);
350  ADD_STRING(entropy_coding_mode_flag);
351  ADD_STRING(loop_filter_disable_idc);
352  ADD_STRING(background_detection_on);
353  ADD_STRING(posted_frames_waiting_for_encode);
354  ADD_STRING(bitrate_adjust_ratio);
355  ADD_STRING(minbitrate_ratio);
356  ADD_STRING(quality_scale_only_on_average_qp);
357  ADD_STRING(h264_qp_thresholds_low);
358  ADD_STRING(h264_qp_thresholds_high);
359  ADD_STRING(enable_hw_encoder);
360  ADD_STRING(enable_hw_decoder);
361  ADD_STRING(hw_encoder_provider);
362  ADD_STRING(av_dec_common_input_format);
363  ADD_STRING(av_dec_common_output_format);
364  ADD_STRING(av_dec_mmcss_class);
365  ADD_STRING(av_enc_codec_type);
366  ADD_STRING(av_enc_common_buffer_in_level);
367  ADD_STRING(av_enc_common_buffer_out_level);
368  ADD_STRING(av_enc_common_buffer_size);
369  ADD_STRING(av_enc_common_format_constraint);
370  ADD_STRING(av_enc_common_low_latency);
371  ADD_STRING(av_enc_common_max_bit_rate);
372  ADD_STRING(av_enc_common_mean_bit_rate);
373  ADD_STRING(av_enc_common_mean_bit_rate_interval);
374  ADD_STRING(av_enc_common_min_bit_rate);
375  ADD_STRING(av_enc_common_quality);
376  ADD_STRING(av_enc_common_quality_vs_speed);
377  ADD_STRING(av_enc_common_rate_control_mode);
378  ADD_STRING(av_enc_common_real_time);
379  ADD_STRING(av_enc_common_stream_end_handling);
380  ADD_STRING(av_enc_mux_output_stream_type);
381  ADD_STRING(av_dec_video_acceleration_h264);
382  ADD_STRING(av_dec_video_acceleration_mpeg2);
383  ADD_STRING(av_dec_video_acceleration_vc1);
384  ADD_STRING(av_dec_video_drop_pic_with_missing_ref);
385  ADD_STRING(av_dec_video_fast_decode_mode);
386  ADD_STRING(av_dec_video_input_scan_type);
387  ADD_STRING(av_dec_video_pixel_aspect_ratio);
388  ADD_STRING(av_dec_video_software_deinterlace_mode);
389  ADD_STRING(av_dec_video_sw_power_level);
390  ADD_STRING(av_dec_video_thumbnail_generation_mode);
391  ADD_STRING(av_enc_input_video_system);
392  ADD_STRING(av_enc_video_cbr_motion_tradeoff);
393  ADD_STRING(av_enc_video_coded_video_access_unit_size);
394  ADD_STRING(av_enc_video_default_upper_field_dominant);
395  ADD_STRING(av_enc_video_display_dimension);
396  ADD_STRING(av_enc_video_encode_dimension);
397  ADD_STRING(av_enc_video_encode_offset_origin);
398  ADD_STRING(av_enc_video_field_swap);
399  ADD_STRING(av_enc_video_force_source_scan_type);
400  ADD_STRING(av_enc_video_header_drop_frame);
401  ADD_STRING(av_enc_video_header_frames);
402  ADD_STRING(av_enc_video_header_hours);
403  ADD_STRING(av_enc_video_header_minutes);
404  ADD_STRING(av_enc_video_header_seconds);
405  ADD_STRING(av_enc_video_input_chroma_resolution);
406  ADD_STRING(av_enc_video_input_chroma_subsampling);
407  ADD_STRING(av_enc_video_input_color_lighting);
408  ADD_STRING(av_enc_video_input_color_nominal_range);
409  ADD_STRING(av_enc_video_input_color_primaries);
410  ADD_STRING(av_enc_video_input_color_transfer_function);
411  ADD_STRING(av_enc_video_input_color_transfer_matrix);
412  ADD_STRING(av_enc_video_inverse_telecine_enable);
413  ADD_STRING(av_enc_video_inverse_telecine_threshold);
414  ADD_STRING(av_enc_video_max_keyframe_distance);
415  ADD_STRING(av_enc_video_no_of_fields_to_encode);
416  ADD_STRING(av_enc_video_no_of_fields_to_skip);
417  ADD_STRING(av_enc_video_output_chroma_resolution);
418  ADD_STRING(av_enc_video_output_chroma_subsampling);
419  ADD_STRING(av_enc_video_output_color_lighting);
420  ADD_STRING(av_enc_video_output_color_nominal_range);
421  ADD_STRING(av_enc_video_output_color_primaries);
422  ADD_STRING(av_enc_video_output_color_transfer_function);
423  ADD_STRING(av_enc_video_output_color_transfer_matrix);
424  ADD_STRING(av_enc_video_output_frame_rate);
425  ADD_STRING(av_enc_video_output_frame_rate_conversion);
426  ADD_STRING(av_enc_video_output_scan_type);
427  ADD_STRING(av_enc_video_pixel_aspect_ratio);
428  ADD_STRING(av_enc_video_source_film_content);
429  ADD_STRING(av_enc_video_source_is_bw);
430  ADD_STRING(av_enc_mpv_add_seq_end_code);
431  ADD_STRING(av_enc_mpv_default_b_picture_count);
432  ADD_STRING(av_enc_mpv_frame_field_mode);
433  ADD_STRING(av_enc_mpv_generate_header_pic_disp_ext);
434  ADD_STRING(av_enc_mpv_generate_header_pic_ext);
435  ADD_STRING(av_enc_mpv_generate_header_seq_disp_ext);
436  ADD_STRING(av_enc_mpv_generate_header_seq_ext);
437  ADD_STRING(av_enc_mpv_generate_header_seq_scale_ext);
438  ADD_STRING(av_enc_mpvgop_open);
439  ADD_STRING(av_enc_mpvgops_in_seq);
440  ADD_STRING(av_enc_mpvgop_size);
441  ADD_STRING(av_enc_mpv_intra_dc_precision);
442  ADD_STRING(av_enc_mpv_intra_vlc_table);
443  ADD_STRING(av_enc_mpv_level);
444  ADD_STRING(av_enc_mpv_profile);
445  ADD_STRING(av_enc_mpvq_scale_type);
446  ADD_STRING(av_enc_mpv_quant_matrix_chroma_intra);
447  ADD_STRING(av_enc_mpv_quant_matrix_chroma_non_intra);
448  ADD_STRING(av_enc_mpv_quant_matrix_intra);
449  ADD_STRING(av_enc_mpv_quant_matrix_non_intra);
450  ADD_STRING(av_enc_mpv_scan_pattern);
451  ADD_STRING(av_enc_mpv_scene_detection);
452  ADD_STRING(av_enc_mpv_use_concealment_motion_vectors);
453  ADD_STRING(vdm_not_override_lua_smallvideo_not_use_hwenc_policy);
454  ADD_STRING(enable_video_sender_frame_dropper);
455 
456 #undef ADD_STRING
457  std::string ret = ost.str();
458  auto index = ret.rfind(",");
459  if (index != ret.npos) {
460  ret = ret.substr(0, index);
461  ret += NEW_LINE;
462  }
463 
464  return "{" NEW_LINE + ret + "}";
465  }
466 
467  Optional<int> codec_type;
468  Optional<int> frame_width;
469  Optional<int> frame_height;
470  Optional<int> frame_rate;
471  Optional<int> start_bitrate;
472  Optional<int> target_bitrate;
473  Optional<int> min_bitrate;
474  Optional<int> max_bitrate;
475  Optional<int> orientation_mode;
476  Optional<uint8_t> number_of_temporal_layers;
477  Optional<std::string> sps_data;
478  Optional<std::string> pps_data;
479  Optional<int> h264_profile;
480  Optional<bool> adaptive_op_mode;
481  Optional<uint8_t> number_of_spatial_layers;
482  Optional<bool> flexible_mode;
483  Optional<int> interlayer_pred;
484  Optional<int> num_of_encoder_cores;
485  Optional<int> degradation_preference;
486  Optional<int> vqc_version;
487  Optional<int> fps_down_step;
488  Optional<int> fps_up_step;
489  Optional<int> complexity;
490  Optional<bool> denoising_on;
491  Optional<bool> automatic_resize_on;
492  Optional<bool> frame_dropping_on;
493  Optional<bool> has_intra_request;
494  Optional<int> key_frame_interval;
495  Optional<int> entropy_coding_mode_flag;
496  Optional<int> loop_filter_disable_idc;
497  Optional<bool> background_detection_on;
498  Optional<int> posted_frames_waiting_for_encode;
499  Optional<std::string> bitrate_adjust_ratio;
500  Optional<std::string> minbitrate_ratio;
501  // followings are hw setting
502 
503  // h264 quality scaler settings
504  Optional<bool> quality_scale_only_on_average_qp;
505  Optional<int> h264_qp_thresholds_low;
506  Optional<int> h264_qp_thresholds_high;
507 
508  // Specifies whether or not to enable hw encode.
509  Optional<bool> enable_hw_encoder;
510  // Specifies whether or not to enable hw decode.
511  Optional<bool> enable_hw_decoder;
512  // Specifies hw encode provider.
513  Optional<std::string> hw_encoder_provider;
514  // Specifies the current input format for the decoder.
515  Optional<std::string> av_dec_common_input_format;
516  // Specifies the output format for the decoder.
517  Optional<std::string> av_dec_common_output_format;
518  // Specifies the Multimedia Class Scheduler Service (MMCSS) class for the decoding thread.
519  Optional<std::string> av_dec_mmcss_class;
520 
521  // Specifies the encoding scheme.
522  Optional<std::string> av_enc_codec_type;
523  // Specifies the initial level of the encoding buffer.
524  Optional<uint32_t> av_enc_common_buffer_in_level;
525  // Specifies the final level of the encoding buffer at the end of the encoding process.
526  Optional<uint32_t> av_enc_common_buffer_out_level;
527  // Specifies the size of the buffer used during encoding.
528  Optional<uint32_t> av_enc_common_buffer_size;
529  // Specifies the target format for an encoder.
530  Optional<std::string> av_enc_common_format_constraint;
531  // Specifies whether the output stream should be structured so that the encoded stream has a
532  // low decoding latency.
533  Optional<bool> av_enc_common_low_latency;
534  // Specifies the maximum bit rate.
535  Optional<int> av_enc_common_max_bit_rate;
536  // Specifies the average bit rate.
537  Optional<int> av_enc_common_mean_bit_rate;
538  // Specifies the time interval over which the average bit rate applies.
539  Optional<int> av_enc_common_mean_bit_rate_interval;
540  // Specifies the minimum bit rate.
541  Optional<int> av_enc_common_min_bit_rate;
542  // Specifies the quality level for encoding.
543  // 0 Minimum quality, smaller output size.
544  // 100 Maximum quality, larger output size.
545  Optional<uint32_t> av_enc_common_quality;
546  // Specifies the tradeoff between encoding quality and speed.
547  // 0 Lower quality, faster encoding.
548  // 100 Higher quality, slower encoding.
549  Optional<uint32_t> av_enc_common_quality_vs_speed;
550  // Specifies the rate control mode.
551  // eAVEncCommonRateControlMode_CBR,
552  // eAVEncCommonRateControlMode_PeakConstrainedVBR,
553  // eAVEncCommonRateControlMode_UnconstrainedVBR,
554  // eAVEncCommonRateControlMode_Quality,
555  // eAVEncCommonRateControlMode_LowDelayVBR,
556  // eAVEncCommonRateControlMode_GlobalVBR,
557  // eAVEncCommonRateControlMode_GlobalLowDelayVBR
558  Optional<uint32_t> av_enc_common_rate_control_mode;
559  // Specifies whether the application requires real-time encoding performance.
560  Optional<bool> av_enc_common_real_time;
561  // Specifies whether the encoder discards partial groups of pictures (GOPs)
562  // at the end of the stream.
563  Optional<bool> av_enc_common_stream_end_handling;
564  // Specifies the type of output stream produced by a multiplexer.
565  // eAVEncMuxOutputAuto,
566  // eAVEncMuxOutputPS,
567  // eAVEncMuxOutputTS
568  Optional<uint32_t> av_enc_mux_output_stream_type;
569 
570  // Enables or disables hardware acceleration for H.264 video decoding.
571  // set this property before the decoder's output pin is connected.
572  Optional<uint32_t> av_dec_video_acceleration_h264;
573  // Enables or disables hardware acceleration for MPEG-2 video decoding.
574  // set this property before the decoder's output pin is connected.
575  Optional<uint32_t> av_dec_video_acceleration_mpeg2;
576  // Enables or disables hardware acceleration for VC-1 video decoding.
577  // set this property before the decoder's output pin is connected.
578  Optional<uint32_t> av_dec_video_acceleration_vc1;
579  // Specifies whether the decoder drops intra frames with missing reference frames.
580  Optional<bool> av_dec_video_drop_pic_with_missing_ref;
581  // Sets the video decoding speed.
582  // 0 indicates normal decoding and 32 is the fastest decoding mode.
583  Optional<uint32_t> av_dec_video_fast_decode_mode;
584  // Specifies how the decoded video stream is interlaced.
585  // eAVDecVideoInputScan_Unknown,
586  // eAVDecVideoInputScan_Progressive,
587  // eAVDecVideoInputScan_Interlaced_UpperFieldFirst,
588  // eAVDecVideoInputScan_Interlaced_LowerFieldFirst
589  Optional<uint32_t> av_dec_video_input_scan_type;
590  // Specifies the pixel aspect ratio of the decoded video stream.
591  // The upper 16 bits of the value contain the width, and the lower 16 bits contain the height.
592  Optional<uint32_t> av_dec_video_pixel_aspect_ratio;
593  // Specifies the decoders software deinterlace mode.
594  // eAVDecVideoSoftwareDeinterlaceMode_NoDeinterlacing,
595  // eAVDecVideoSoftwareDeinterlaceMode_ProgressiveDeinterlacing,
596  // eAVDecVideoSoftwareDeinterlaceMode_BOBDeinterlacing,
597  // eAVDecVideoSoftwareDeinterlaceMode_SmartBOBDeinterlacing
598  Optional<uint32_t> av_dec_video_software_deinterlace_mode;
599  // Specifies the power-saving level.
600  // 0 Optimize for battery life.
601  // 100 Optimize for video quality.
602  Optional<uint32_t> av_dec_video_sw_power_level;
603  // Enables or disables thumbnail generation mode.
604  Optional<bool> av_dec_video_thumbnail_generation_mode;
605  // Specifies the video system of the source content.
606  // eAVEncInputVideoSystem_Unspecified,
607  // eAVEncInputVideoSystem_PAL,
608  // eAVEncInputVideoSystem_NTSC,
609  // eAVEncInputVideoSystem_SECAM,
610  // eAVEncInputVideoSystem_MAC,
611  // eAVEncInputVideoSystem_HDV,
612  // eAVEncInputVideoSystem_Component
613  Optional<uint32_t> av_enc_input_video_system;
614  // Specifies the tradeoff between motion and still images.
615  // 0 Optimize for still images
616  // 100 Optimize for motion.
617  Optional<uint32_t> av_enc_video_cbr_motion_tradeoff;
618  // Specifies the size of the video access units.
619  Optional<uint32_t> av_enc_video_coded_video_access_unit_size;
620  // Specifies which field is displayed first.
621  Optional<bool> av_enc_video_default_upper_field_dominant;
622  // Specifies the size of the video stream when it is decoded.
623  // The upper 16 bits of the value contain the width, in pixels. The lower 16 bits contain the
624  // height, in pixels.
625  Optional<uint32_t> av_enc_video_display_dimension;
626  // Specifies the width and height of the encoded video, if the video is cropped.
627  // The upper 16 bits of the value contain the width, in pixels. The lower 16 bits contain the
628  // height, in pixels.
629  Optional<uint32_t> av_enc_video_encode_dimension;
630  // Specifies the left and top corners of the clipping rectangle, if the video is cropped.
631  // The upper 16 bits of the value contain the offset from the left edge of the input frame, in
632  // pixels. The lower 16 bits contain the offset from the top edge of the input frame, in pixels.
633  Optional<uint32_t> av_enc_video_encode_offset_origin;
634  // Reverses the order of the interlaced fields in the source video.
635  Optional<bool> av_enc_video_field_swap;
636  // Specifies whether the input frames are progressive or interlaced.
637  // eAVEncVideoSourceScan_Automatic,
638  // eAVEncVideoSourceScan_Interlaced,
639  // eAVEncVideoSourceScan_Progressive
640  Optional<uint32_t> av_enc_video_force_source_scan_type;
641  // Specifies the value of drop-frame flag in the GOP header.
642  // The value of this property can be 0 or 1.
643  Optional<uint32_t> av_enc_video_header_drop_frame;
644  // Specifies the starting frame number in the GOP header.
645  Optional<uint32_t> av_enc_video_header_frames;
646  // Specifies the starting hour number in the GOP header.
647  Optional<uint32_t> av_enc_video_header_hours;
648  // Specifies the starting minute number in the GOP header.
649  Optional<uint32_t> av_enc_video_header_minutes;
650  // Specifies the starting second number in the GOP header.
651  Optional<uint32_t> av_enc_video_header_seconds;
652  // Specifies the chroma resolution of the input video.
653  // eAVEncVideoChromaResolution_SameAsSource,
654  // eAVEncVideoChromaResolution_444,
655  // eAVEncVideoChromaResolution_422,
656  // eAVEncVideoChromaResolution_420,
657  // eAVEncVideoChromaResolution_411
658  Optional<uint32_t> av_enc_video_input_chroma_resolution;
659  // Specifies the chroma siting for the input video.
660  Optional<uint32_t> av_enc_video_input_chroma_subsampling;
661  // Specifies the intended lighting conditions for viewing the input video.
662  // eAVEncVideoColorLighting_SameAsSource,
663  // eAVEncVideoColorLighting_Unknown,
664  // eAVEncVideoColorLighting_Bright,
665  // eAVEncVideoColorLighting_Office,
666  // eAVEncVideoColorLighting_Dim,
667  // eAVEncVideoColorLighting_Dark
668  Optional<uint32_t> av_enc_video_input_color_lighting;
669  // Specifies the nominal range for the input video.
670  // eAVEncVideoColorNominalRange_SameAsSource,
671  // eAVEncVideoColorNominalRange_0_255,
672  // eAVEncVideoColorNominalRange_16_235,
673  // eAVEncVideoColorNominalRange_48_208
674  Optional<uint32_t> av_enc_video_input_color_nominal_range;
675  // Specifies the color primaries for the input video.
676  // eAVEncVideoColorPrimaries_SameAsSource,
677  // eAVEncVideoColorPrimaries_Reserved,
678  // eAVEncVideoColorPrimaries_BT709,
679  // eAVEncVideoColorPrimaries_BT470_2_SysM,
680  // eAVEncVideoColorPrimaries_BT470_2_SysBG,
681  // eAVEncVideoColorPrimaries_SMPTE170M,
682  // eAVEncVideoColorPrimaries_SMPTE240M,
683  // eAVEncVideoColorPrimaries_EBU3231,
684  // eAVEncVideoColorPrimaries_SMPTE_C
685  Optional<uint32_t> av_enc_video_input_color_primaries;
686  // Specifies the conversion function from RGB to RGB for input video
687  // eAVEncVideoColorTransferFunction_SameAsSource,
688  // eAVEncVideoColorTransferFunction_10,
689  // eAVEncVideoColorTransferFunction_18,
690  // eAVEncVideoColorTransferFunction_20,
691  // eAVEncVideoColorTransferFunction_22,
692  // eAVEncVideoColorTransferFunction_22_709,
693  // eAVEncVideoColorTransferFunction_22_240M,
694  // eAVEncVideoColorTransferFunction_22_8bit_sRGB,
695  // eAVEncVideoColorTransferFunction_28
696  Optional<uint32_t> av_enc_video_input_color_transfer_function;
697  // Specifies the conversion matrix from the YCbCr color space to the RGB color space, for the
698  // input video.
699  // eAVEncVideoColorTransferMatrix_SameAsSource,
700  // eAVEncVideoColorTransferMatrix_BT709,
701  // eAVEncVideoColorTransferMatrix_BT601,
702  // eAVEncVideoColorTransferMatrix_SMPTE240M
703  Optional<uint32_t> av_enc_video_input_color_transfer_matrix;
704  // Specifies whether the encoder performs inverse telecine.
705  Optional<bool> av_enc_video_inverse_telecine_enable;
706  // Sets the threshold at which the encoder considers a video field redundant.
707  Optional<uint32_t> av_enc_video_inverse_telecine_threshold;
708  // Specifies the maximum number of frames between key frames.
709  Optional<uint32_t> av_enc_video_max_keyframe_distance;
710  // Specifies the number of fields to encode.
711  // For progressive video, set this property to twice the number of frames to encode.
712  Optional<uint32_t> av_enc_video_no_of_fields_to_encode;
713  // Specifies the number of fields to skip during encoding.
714  // For progressive video, set this property to twice the number of frames to skip.
715  Optional<uint64_t> av_enc_video_no_of_fields_to_skip;
716  // Specifies the chroma resolution of the encoded video.
717  // eAVEncVideoChromaResolution_SameAsSource,
718  // eAVEncVideoChromaResolution_444,
719  // eAVEncVideoChromaResolution_422,
720  // eAVEncVideoChromaResolution_420,
721  // eAVEncVideoChromaResolution_411
722  Optional<uint32_t> av_enc_video_output_chroma_resolution;
723  // Specifies the chroma siting for the encoded video.
724  // eAVEncVideoChromaSubsamplingFormat_SameAsSource,
725  // eAVEncVideoChromaSubsamplingFormat_ProgressiveChroma,
726  // eAVEncVideoChromaSubsamplingFormat_Horizontally_Cosited,
727  // eAVEncVideoChromaSubsamplingFormat_Vertically_Cosited,
728  // eAVEncVideoChromaSubsamplingFormat_Vertically_AlignedChromaPlanes
729  Optional<uint32_t> av_enc_video_output_chroma_subsampling;
730  // Specifies the intended lighting conditions for viewing the encoded video.
731  // eAVEncVideoColorLighting_SameAsSource,
732  // eAVEncVideoColorLighting_Unknown,
733  // eAVEncVideoColorLighting_Bright,
734  // eAVEncVideoColorLighting_Office,
735  // eAVEncVideoColorLighting_Dim,
736  // eAVEncVideoColorLighting_Dark
737  Optional<uint32_t> av_enc_video_output_color_lighting;
738  // Specifies the nominal range for the encoded video.
739  // eAVEncVideoColorNominalRange_SameAsSource,
740  // eAVEncVideoColorNominalRange_0_255,
741  // eAVEncVideoColorNominalRange_16_235,
742  // eAVEncVideoColorNominalRange_48_208
743  Optional<uint32_t> av_enc_video_output_color_nominal_range;
744  // Specifies the color primaries for the encoded video.
745  // eAVEncVideoColorPrimaries_SameAsSource,
746  // eAVEncVideoColorPrimaries_Reserved,
747  // eAVEncVideoColorPrimaries_BT709,
748  // eAVEncVideoColorPrimaries_BT470_2_SysM,
749  // eAVEncVideoColorPrimaries_BT470_2_SysBG,
750  // eAVEncVideoColorPrimaries_SMPTE170M,
751  // eAVEncVideoColorPrimaries_SMPTE240M,
752  // eAVEncVideoColorPrimaries_EBU3231,
753  // eAVEncVideoColorPrimaries_SMPTE_C
754  Optional<uint32_t> av_enc_video_output_color_primaries;
755  // Specifies the conversion function from RGB to RGB' for encoded video.
756  // eAVEncVideoColorTransferFunction_SameAsSource,
757  // eAVEncVideoColorTransferFunction_10,
758  // eAVEncVideoColorTransferFunction_18,
759  // eAVEncVideoColorTransferFunction_20,
760  // eAVEncVideoColorTransferFunction_22,
761  // eAVEncVideoColorTransferFunction_22_709,
762  // eAVEncVideoColorTransferFunction_22_240M,
763  // eAVEncVideoColorTransferFunction_22_8bit_sRGB,
764  // eAVEncVideoColorTransferFunction_28
765  Optional<uint32_t> av_enc_video_output_color_transfer_function;
766  // Specifies the conversion matrix from the YCbCr color space to the RGB color space, for the
767  // encoded video.
768  // eAVEncVideoColorTransferMatrix_SameAsSource,
769  // eAVEncVideoColorTransferMatrix_BT709,
770  // eAVEncVideoColorTransferMatrix_BT601,
771  // eAVEncVideoColorTransferMatrix_SMPTE240M
772  Optional<uint32_t> av_enc_video_output_color_transfer_matrix;
773  // Specifies the frame rate on the encoders output stream, in frames per second.
774  // Frame rate Ratio
775  // 23.97 24000/1001
776  // 24 24/1
777  // 25 25/1
778  // 29.97 30000/1001
779  // 30 30/1
780  // 50 50/1
781  // 59.94 60000/1001
782  // 60 60/1
783  Optional<uint64_t> av_enc_video_output_frame_rate;
784  // Specifies whether the encoder converts the frame rate when the output frame rate does not match
785  // the input frame rate.
786  // eAVEncVideoOutputFrameRateConversion_Disable,
787  // eAVEncVideoOutputFrameRateConversion_Enable,
788  // eAVEncVideoOutputFrameRateConversion_Alias
789  Optional<uint32_t> av_enc_video_output_frame_rate_conversion;
790  // Specifies how the encoder interlaces the output video.
791  // eAVEncVideoOutputScan_Progressive,
792  // eAVEncVideoOutputScan_Interlaced,
793  // eAVEncVideoOutputScan_SameAsInput,
794  // eAVEncVideoOutputScan_Automatic
795  Optional<uint32_t> av_enc_video_output_scan_type;
796  // Specifies the pixel aspect ratio.
797  // The upper 16 bits of the value contain the width, and the lower 16 bits contain the height.
798  Optional<uint32_t> av_enc_video_pixel_aspect_ratio;
799  // Specifies whether the original source of the input video was film or video.
800  // eAVEncVideoFilmContent_VideoOnly,
801  // eAVEncVideoFilmContent_FilmOnly,
802  // eAVEncVideoFilmContent_Mixed
803  Optional<uint32_t> av_enc_video_source_film_content;
804  // Specifies whether the video is monochrome (black and white) or contains color.
805  Optional<bool> av_enc_video_source_is_bw;
806  // Specifies whether the encoder adds a sequence end code at the end of the stream.
807  Optional<bool> av_enc_mpv_add_seq_end_code;
808  // Specifies the default number of consecutive B frames between I and P frames.
809  Optional<uint32_t> av_enc_mpv_default_b_picture_count;
810  // Specifies whether the encoder produces encoded fields or encoded frames.
811  // eAVEncMPVFrameFieldMode_FieldMode,
812  // eAVEncMPVFrameFieldMode_FrameMode
813  Optional<uint32_t> av_enc_mpv_frame_field_mode;
814  // Specifies whether the encoder generates picture display extension headers.
815  Optional<bool> av_enc_mpv_generate_header_pic_disp_ext;
816  // Specifies whether the encoder generates picture extension headers.
817  Optional<bool> av_enc_mpv_generate_header_pic_ext;
818  // Specifies whether the encoder generates sequence display extension headers.
819  Optional<bool> av_enc_mpv_generate_header_seq_disp_ext;
820  // Specifies whether the encoder generates sequence extension headers.
821  Optional<bool> av_enc_mpv_generate_header_seq_ext;
822  // Specifies whether the encoder generates sequence scalable extension headers.
823  Optional<bool> av_enc_mpv_generate_header_seq_scale_ext;
824  // Specifies whether the encoder produces open GOPs or closed GOPs.
825  Optional<bool> av_enc_mpvgop_open;
826  // Specifies the number of GOPs between sequence headers.
827  Optional<uint32_t> av_enc_mpvgops_in_seq;
828  // Specifies the maximum number of pictures from one GOP header to the next GOP header.
829  Optional<uint32_t> av_enc_mpvgop_size;
830  // Specifies the precision of the DC coefficients.
831  Optional<uint32_t> av_enc_mpv_intra_dc_precision;
832  // Specifies which variable-length coding (VLC) table to use for entropy coding.
833  // eAVEncMPVIntraVLCTable_Auto,
834  // eAVEncMPVIntraVLCTable_MPEG1,
835  // eAVEncMPVIntraVLCTable_Alternate
836  Optional<uint32_t> av_enc_mpv_intra_vlc_table;
837  // Specifies the MPEG-2 level.
838  // eAVEncMPVLevel_Low,
839  // eAVEncMPVLevel_Main,
840  // eAVEncMPVLevel_High1440,
841  // eAVEncMPVLevel_High
842  Optional<uint32_t> av_enc_mpv_level;
843  // Specifies the MPEG-2 profile.
844  // eAVEncMPVProfile_unknown,
845  // eAVEncMPVProfile_Simple,
846  // eAVEncMPVProfile_Main,
847  // eAVEncMPVProfile_High,
848  // eAVEncMPVProfile_422
849  Optional<uint32_t> av_enc_mpv_profile;
850  // Specifies whether the quantizer scale is linear or non-linear.
851  // eAVEncMPVQScaleType_Auto,
852  // eAVEncMPVQScaleType_Linear,
853  // eAVEncMPVQScaleType_NonLinear
854  Optional<uint32_t> av_enc_mpvq_scale_type;
855  // Specifies the chroma quantization matrix for intra macroblocks.
856  Optional<std::string> av_enc_mpv_quant_matrix_chroma_intra;
857  // Specifies the chroma quantization matrix for non-intra macroblocks.
858  Optional<std::string> av_enc_mpv_quant_matrix_chroma_non_intra;
859  // Specifies the luma quantization matrix for intra macroblocks.
860  Optional<std::string> av_enc_mpv_quant_matrix_intra;
861  // Specifies the luma quantization matrix for non-intra macroblocks.
862  Optional<std::string> av_enc_mpv_quant_matrix_non_intra;
863  // Specifies the macroblock scan pattern.
864  // eAVEncMPVScanPattern_Auto,
865  // eAVEncMPVScanPattern_ZigZagScan,
866  // eAVEncMPVScanPattern_AlternateScan
867  Optional<uint32_t> av_enc_mpv_scan_pattern;
868  // Specifies how the encoder behaves when it detects a new scene.
869  // eAVEncMPVSceneDetection_None,
870  // eAVEncMPVSceneDetection_InsertIPicture,
871  // eAVEncMPVSceneDetection_StartNewGOP,
872  // eAVEncMPVSceneDetection_StartNewLocatableGOP
873  Optional<uint32_t> av_enc_mpv_scene_detection;
874  // Specifies whether the encoder uses concealment motion vectors.
875  Optional<bool> enable_video_sender_frame_dropper;
876  Optional<bool> av_enc_mpv_use_concealment_motion_vectors;
877 
878  Optional<bool> enable_nvdia_first;
879  Optional<int32_t> nvdia_cpu_threshold_mhz;
880  Optional<int32_t> intel_cpu_threshold_mhz;
881  Optional<bool> vdm_not_override_lua_smallvideo_not_use_hwenc_policy;
882 
883  private:
884  template <class T>
885  std::string ToStringIfSet(const char* key, const Optional<T>& val) const {
886  std::string str;
887  if (val) {
888  str = key;
889  str = "\t\"" + str + "\"";
890  str += ": ";
891  str += std::to_string(*val);
892  str += ",";
893  str += NEW_LINE;
894  }
895  return str;
896  }
897 
898  std::string ToStringIfSet(const char* key, const Optional<std::string>& val) const {
899  std::string str;
900  if (val) {
901  str = key;
902  str = "\t\"" + str + "\"";
903  str += ": \"";
904  str += val.value();
905  str += "\",";
906  str += NEW_LINE;
907  }
908  return str;
909  }
910 
911  std::string ToStringIfSet(const char* key, const Optional<bool>& val) const {
912  std::string str;
913  if (val) {
914  str = key;
915  str = "\t\"" + str + "\"";
916  str += ": ";
917  str += *val ? "true" : "false";
918  str += ",";
919  str += NEW_LINE;
920  }
921  return str;
922  }
923 
924  template <typename T>
925  static void SetFrom(Optional<T>* s, const Optional<T>& o) {
926  if (o) {
927  *s = o;
928  }
929  }
930 };
931 
932 } // namespace rtc
933 } // namespace agora
agora::rtc::VideoConfigurationEx
Definition: video_config_i.h:25
agora::Optional< int >