瀏覽代碼

win-dshow: Use actual encoder names

Was using a temporary name for the encoders still; now uses the actual
encoder names.
jp9000 11 年之前
父節點
當前提交
c456e42191
共有 2 個文件被更改,包括 11 次插入3 次删除
  1. 2 0
      plugins/win-dshow/data/locale/en-US.ini
  2. 9 3
      plugins/win-dshow/win-dshow-encoder.cpp

+ 2 - 0
plugins/win-dshow/data/locale/en-US.ini

@@ -18,3 +18,5 @@ AudioDevice="Audio Device"
 
 # encoder text
 Bitrate="Bitrate"
+Encoder.C985="AverMedia C985 Hardware Encoder"
+Encoder.C353="AverMedia C353 Hardware Encoder"

+ 9 - 3
plugins/win-dshow/win-dshow-encoder.cpp

@@ -42,9 +42,14 @@ struct DShowEncoder {
 			struct encoder_packet *packet, bool *received_packet);
 };
 
-static const char *GetDShowEncoderName(void)
+static const char *GetC985EncoderName(void)
 {
-	return "DShow Encoder (temp)";
+	return obs_module_text("Encoder.C985");
+}
+
+static const char *GetC353EncoderName(void)
+{
+	return obs_module_text("Encoder.C353");
 }
 
 static inline void FindDevice(DeviceId &id, const wchar_t *name)
@@ -331,7 +336,6 @@ void RegisterDShowEncoders()
 	obs_encoder_info info  = {};
 	info.type              = OBS_ENCODER_VIDEO;
 	info.codec             = "h264";
-	info.get_name          = GetDShowEncoderName;
 	info.destroy           = DestroyDShowEncoder;
 	info.encode            = DShowEncode;
 	info.update            = UpdateDShowEncoder;
@@ -348,12 +352,14 @@ void RegisterDShowEncoders()
 	for (const DeviceId &device : devices) {
 		if (!foundC985 && device.name.find(L"C985") != string::npos) {
 			info.id = "dshow_c985_h264";
+			info.get_name = GetC985EncoderName;
 			info.create = CreateC985Encoder;
 			obs_register_encoder(&info);
 			foundC985 = true;
 
 		} else if (device.name.find(L"C353") != string::npos) {
 			info.id = "dshow_c353_h264";
+			info.get_name = GetC353EncoderName;
 			info.create = CreateC353Encoder;
 			obs_register_encoder(&info);
 		}