@@ -866,6 +866,163 @@ RequestResult RequestHandler::SetInputAudioTracks(const Request &request)
866
866
return RequestResult::Success ();
867
867
}
868
868
869
+ /* *
870
+ * Gets the deinterlace mode of an input.
871
+ *
872
+ * Deinterlace Modes:
873
+ *
874
+ * - `OBS_DEINTERLACE_MODE_DISABLE`
875
+ * - `OBS_DEINTERLACE_MODE_DISCARD`
876
+ * - `OBS_DEINTERLACE_MODE_RETRO`
877
+ * - `OBS_DEINTERLACE_MODE_BLEND`
878
+ * - `OBS_DEINTERLACE_MODE_BLEND_2X`
879
+ * - `OBS_DEINTERLACE_MODE_LINEAR`
880
+ * - `OBS_DEINTERLACE_MODE_LINEAR_2X`
881
+ * - `OBS_DEINTERLACE_MODE_YADIF`
882
+ * - `OBS_DEINTERLACE_MODE_YADIF_2X`
883
+ *
884
+ * Note: Deinterlacing functionality is restricted to async inputs only.
885
+ *
886
+ * @requestField ?inputName | String | Name of the input
887
+ * @requestField ?inputUuid | String | UUID of the input
888
+ *
889
+ * @responseField inputDeinterlaceMode | String | Deinterlace mode of the input
890
+ *
891
+ * @requestType GetInputDeinterlaceMode
892
+ * @complexity 2
893
+ * @rpcVersion -1
894
+ * @initialVersion 5.6.0
895
+ * @api requests
896
+ * @category inputs
897
+ */
898
+ RequestResult RequestHandler::GetInputDeinterlaceMode (const Request &request)
899
+ {
900
+ RequestStatus::RequestStatus statusCode;
901
+ std::string comment;
902
+ OBSSourceAutoRelease input = request.ValidateInput (statusCode, comment);
903
+ if (!input)
904
+ return RequestResult::Error (statusCode, comment);
905
+
906
+ if (!(obs_source_get_output_flags (input) & OBS_SOURCE_ASYNC))
907
+ return RequestResult::Error (RequestStatus::InvalidResourceState, " The specified input is not async." );
908
+
909
+ json responseData;
910
+ responseData[" inputDeinterlaceMode" ] = obs_source_get_deinterlace_mode (input);
911
+
912
+ return RequestResult::Success (responseData);
913
+ }
914
+
915
+ /* *
916
+ * Sets the deinterlace mode of an input.
917
+ *
918
+ * Note: Deinterlacing functionality is restricted to async inputs only.
919
+ *
920
+ * @requestField ?inputName | String | Name of the input
921
+ * @requestField ?inputUuid | String | UUID of the input
922
+ * @requestField inputDeinterlaceMode | String | Deinterlace mode for the input
923
+ *
924
+ * @requestType SetInputDeinterlaceMode
925
+ * @complexity 2
926
+ * @rpcVersion -1
927
+ * @initialVersion 5.6.0
928
+ * @api requests
929
+ * @category inputs
930
+ */
931
+ RequestResult RequestHandler::SetInputDeinterlaceMode (const Request &request)
932
+ {
933
+ RequestStatus::RequestStatus statusCode;
934
+ std::string comment;
935
+ OBSSourceAutoRelease input = request.ValidateInput (statusCode, comment);
936
+ if (!input || !request.ValidateString (" inputDeinterlaceMode" , statusCode, comment))
937
+ return RequestResult::Error (statusCode, comment);
938
+
939
+ if (!(obs_source_get_output_flags (input) & OBS_SOURCE_ASYNC))
940
+ return RequestResult::Error (RequestStatus::InvalidResourceState, " The specified input is not async." );
941
+
942
+ enum obs_deinterlace_mode deinterlaceMode = request.RequestData [" inputDeinterlaceMode" ];
943
+ if (deinterlaceMode == OBS_DEINTERLACE_MODE_DISABLE && request.RequestData [" inputDeinterlaceMode" ] != " OBS_DEINTERLACE_MODE_DISABLE" )
944
+ return RequestResult::Error (RequestStatus::InvalidRequestField, " The field inputDeinterlaceMode has an invalid value." );
945
+
946
+ obs_source_set_deinterlace_mode (input, deinterlaceMode);
947
+
948
+ return RequestResult::Success ();
949
+ }
950
+
951
+ /* *
952
+ * Gets the deinterlace field order of an input.
953
+ *
954
+ * Deinterlace Field Orders:
955
+ *
956
+ * - `OBS_DEINTERLACE_FIELD_ORDER_TOP`
957
+ * - `OBS_DEINTERLACE_FIELD_ORDER_BOTTOM`
958
+ *
959
+ * Note: Deinterlacing functionality is restricted to async inputs only.
960
+ *
961
+ * @requestField ?inputName | String | Name of the input
962
+ * @requestField ?inputUuid | String | UUID of the input
963
+ *
964
+ * @responseField inputDeinterlaceFieldOrder | String | Deinterlace field order of the input
965
+ *
966
+ * @requestType GetInputDeinterlaceFieldOrder
967
+ * @complexity 2
968
+ * @rpcVersion -1
969
+ * @initialVersion 5.6.0
970
+ * @api requests
971
+ * @category inputs
972
+ */
973
+ RequestResult RequestHandler::GetInputDeinterlaceFieldOrder (const Request &request)
974
+ {
975
+ RequestStatus::RequestStatus statusCode;
976
+ std::string comment;
977
+ OBSSourceAutoRelease input = request.ValidateInput (statusCode, comment);
978
+ if (!input)
979
+ return RequestResult::Error (statusCode, comment);
980
+
981
+ if (!(obs_source_get_output_flags (input) & OBS_SOURCE_ASYNC))
982
+ return RequestResult::Error (RequestStatus::InvalidResourceState, " The specified input is not async." );
983
+
984
+ json responseData;
985
+ responseData[" inputDeinterlaceFieldOrder" ] = obs_source_get_deinterlace_field_order (input);
986
+
987
+ return RequestResult::Success (responseData);
988
+ }
989
+
990
+ /* *
991
+ * Sets the deinterlace field order of an input.
992
+ *
993
+ * Note: Deinterlacing functionality is restricted to async inputs only.
994
+ *
995
+ * @requestField ?inputName | String | Name of the input
996
+ * @requestField ?inputUuid | String | UUID of the input
997
+ * @requestField inputDeinterlaceFieldOrder | String | Deinterlace field order for the input
998
+ *
999
+ * @requestType SetInputDeinterlaceFieldOrder
1000
+ * @complexity 2
1001
+ * @rpcVersion -1
1002
+ * @initialVersion 5.6.0
1003
+ * @api requests
1004
+ * @category inputs
1005
+ */
1006
+ RequestResult RequestHandler::SetInputDeinterlaceFieldOrder (const Request &request)
1007
+ {
1008
+ RequestStatus::RequestStatus statusCode;
1009
+ std::string comment;
1010
+ OBSSourceAutoRelease input = request.ValidateInput (statusCode, comment);
1011
+ if (!input || !request.ValidateString (" inputDeinterlaceFieldOrder" , statusCode, comment))
1012
+ return RequestResult::Error (statusCode, comment);
1013
+
1014
+ if (!(obs_source_get_output_flags (input) & OBS_SOURCE_ASYNC))
1015
+ return RequestResult::Error (RequestStatus::InvalidResourceState, " The specified input is not async." );
1016
+
1017
+ enum obs_deinterlace_field_order deinterlaceFieldOrder = request.RequestData [" inputDeinterlaceFieldOrder" ];
1018
+ if (deinterlaceFieldOrder == OBS_DEINTERLACE_FIELD_ORDER_TOP && request.RequestData [" inputDeinterlaceFieldOrder" ] != " OBS_DEINTERLACE_FIELD_ORDER_TOP" )
1019
+ return RequestResult::Error (RequestStatus::InvalidRequestField, " The field inputDeinterlaceFieldOrder has an invalid value." );
1020
+
1021
+ obs_source_set_deinterlace_field_order (input, deinterlaceFieldOrder);
1022
+
1023
+ return RequestResult::Success ();
1024
+ }
1025
+
869
1026
/* *
870
1027
* Gets the items of a list property from an input's properties.
871
1028
*
0 commit comments