Sfoglia il codice sorgente

libobs: Add encoder caps (with deprecated flag)

Allows the ability to mark an encoder as deprecated (such as the media
foundation h264 encoders)
jp9000 9 anni fa
parent
commit
e38a5c61d3
3 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. 6 0
      libobs/obs-encoder.c
  2. 4 0
      libobs/obs-encoder.h
  3. 2 0
      libobs/obs.h

+ 6 - 0
libobs/obs-encoder.c

@@ -1150,3 +1150,9 @@ const char *obs_encoder_get_id(const obs_encoder_t *encoder)
 	return obs_encoder_valid(encoder, "obs_encoder_get_id")
 		? encoder->info.id : NULL;
 }
+
+uint32_t obs_get_encoder_caps(const char *encoder_id)
+{
+	struct obs_encoder_info *info = find_encoder(encoder_id);
+	return info ? info->caps : 0;
+}

+ 4 - 0
libobs/obs-encoder.h

@@ -29,6 +29,8 @@
 extern "C" {
 #endif
 
+#define OBS_ENCODER_CAP_DEPRECATED             (1<<0)
+
 /** Specifies the encoder type */
 enum obs_encoder_type {
 	OBS_ENCODER_AUDIO, /**< The encoder provides an audio codec */
@@ -227,6 +229,8 @@ struct obs_encoder_info {
 
 	void *type_data;
 	void (*free_type_data)(void *type_data);
+
+	uint32_t caps;
 };
 
 EXPORT void obs_register_encoder_s(const struct obs_encoder_info *info,

+ 2 - 0
libobs/obs.h

@@ -1633,6 +1633,8 @@ EXPORT void *obs_encoder_get_type_data(obs_encoder_t *encoder);
 
 EXPORT const char *obs_encoder_get_id(const obs_encoder_t *encoder);
 
+EXPORT uint32_t obs_get_encoder_caps(const char *encoder_id);
+
 /** Duplicates an encoder packet */
 EXPORT void obs_duplicate_encoder_packet(struct encoder_packet *dst,
 		const struct encoder_packet *src);