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