mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
libobs, plugins: Deprecate obs_output_t functions with flag parameters
This deprecates the following functions, replacing them with new versions: - `obs_output_can_begin_data_capture()` - now `*capture2()` - `obs_output_initialize_encoders()` - now `*encoders2()` - `obs_output_begin_data_capture()` - now `*capture2()` The flags parameter was initially designed to support audio-only or video-only operation of an output which had the `OBS_OUTPUT_AV` flag, however, full support for that was never implemented, and there are likely fundamental issues with an implementation, mainly that most outputs are programmed assuming that there will always be at least one audio and one video track. This requires new flags specifying support for optional audio/video, among other things. An implementation to allow audio/video to be optional is best done using the flag technique above, with audio/video enablement specified by whether media (raw, `video_t/audio_t`) or encoder (`obs_encoder_t`) objects are specified. Since every implementation I could find always specifies `flags` as 0, I was able to safely conclude that immediately removing the parameter's functionality is safe to do.
This commit is contained in:
@@ -882,44 +882,35 @@ Functions used by outputs
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: bool obs_output_can_begin_data_capture(const obs_output_t *output, uint32_t flags)
|
||||
.. function:: bool obs_output_can_begin_data_capture2(const obs_output_t *output)
|
||||
|
||||
Determines whether video/audio capture (encoded or raw) is able to
|
||||
start. Call this before initializing any output data to ensure that
|
||||
start. Call this before initializing any output state to ensure that
|
||||
the output can start.
|
||||
|
||||
:param flags: Set to 0 to initialize both audio/video, otherwise a
|
||||
bitwise OR combination of OBS_OUTPUT_VIDEO and/or
|
||||
OBS_OUTPUT_AUDIO
|
||||
:return: *true* if data capture can begin
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: bool obs_output_initialize_encoders(obs_output_t *output, uint32_t flags)
|
||||
.. function:: bool obs_output_initialize_encoders2(obs_output_t *output)
|
||||
|
||||
Initializes any encoders/services associated with the output. This
|
||||
must be called for encoded outputs before calling
|
||||
:c:func:`obs_output_begin_data_capture()`.
|
||||
:c:func:`obs_output_begin_data_capture2()`.
|
||||
|
||||
:param flags: Set to 0 to initialize both audio/video, otherwise a
|
||||
bitwise OR combination of OBS_OUTPUT_VIDEO and/or
|
||||
OBS_OUTPUT_AUDIO
|
||||
:return: *true* if successful, *false* otherwise
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: bool obs_output_begin_data_capture(obs_output_t *output, uint32_t flags)
|
||||
.. function:: bool obs_output_begin_data_capture2(obs_output_t *output)
|
||||
|
||||
Begins data capture from raw media or encoders. This is typically
|
||||
when the output actually activates (starts) internally. Video/audio
|
||||
data will start being sent to the callbacks of the output.
|
||||
|
||||
:param flags: Set to 0 to initialize both audio/video, otherwise a
|
||||
bitwise OR combination of OBS_OUTPUT_VIDEO and/or
|
||||
OBS_OUTPUT_AUDIO
|
||||
:return: *true* if successful, *false* otherwise. Typically the
|
||||
return value does not need to be checked if
|
||||
:c:func:`obs_output_can_begin_data_capture()` was
|
||||
:c:func:`obs_output_can_begin_data_capture2()` was
|
||||
called
|
||||
|
||||
---------------------
|
||||
|
||||
Reference in New Issue
Block a user