Skip to content

Commit ec503eb

Browse files
committed
AVInput COM-RPC Support: WIP
1 parent 52893da commit ec503eb

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

AVInput/AVInputUtils.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,24 @@
1717
* limitations under the License.
1818
*/
1919

20-
#include "AVInputUtils.h"
20+
#include "AVInputUtils.h"
2121

2222
int getTypeOfInput(const std::string& sType) {
23-
if (strcmp(sType.c_str(), INPUT_TYPE_STRING_HDMI) == 0)
23+
if (sType == INPUT_TYPE_STRING_HDMI)
2424
return INPUT_TYPE_INT_HDMI;
25-
else if (strcmp(sType.c_str(), INPUT_TYPE_STRING_COMPOSITE) == 0)
25+
else if (sType == INPUT_TYPE_STRING_COMPOSITE)
2626
return INPUT_TYPE_INT_COMPOSITE;
27-
else if (strcmp(sType.c_str(), INPUT_TYPE_STRING_ALL) == 0)
27+
else if (sType == INPUT_TYPE_STRING_ALL)
2828
return INPUT_TYPE_INT_ALL;
2929
else throw "Invalid type of INPUT, please specify HDMI/COMPOSITE/ALL";
3030
}
3131

32-
std::string& getTypeOfInput(const int type) {
32+
const std::string& getTypeOfInput(const int type) {
3333
switch(type) {
34-
case INPUT_TYPE_INT_HDMI:
35-
return INPUT_TYPE_STRING_HDMI;
36-
break;
37-
case INPUT_TYPE_INT_COMPOSITE:
38-
return INPUT_TYPE_STRING_COMPOSITE;
39-
break;
40-
case INPUT_TYPE_INT_ALL:
41-
return INPUT_TYPE_STRING_ALL;
42-
break;
43-
default:
44-
throw "Invalid input type";
34+
case INPUT_TYPE_INT_HDMI: return INPUT_TYPE_STRING_HDMI;
35+
case INPUT_TYPE_INT_COMPOSITE: return INPUT_TYPE_STRING_COMPOSITE;
36+
case INPUT_TYPE_INT_ALL: return INPUT_TYPE_STRING_ALL;
37+
default: throw "Invalid input type";
4538
}
4639
}
4740

AVInput/AVInputUtils.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,15 @@
1919

2020
#pragma once
2121

22-
// <pca> debug
23-
// #define INPUT_TYPE_STRING_ALL "ALL"
24-
// #define INPUT_TYPE_STRING_HDMI "HDMI"
25-
// #define INPUT_TYPE_STRING_COMPOSITE "COMPOSITE"
26-
static const string INPUT_TYPE_STRING_ALL "ALL"
27-
static const string INPUT_TYPE_STRING_HDMI "HDMI"
28-
static const string INPUT_TYPE_STRING_COMPOSITE "COMPOSITE"
22+
#include <string>
2923

30-
// #define INPUT_TYPE_INT_ALL -1
31-
// #define INPUT_TYPE_INT_HDMI 0
32-
// #define INPUT_TYPE_INT_COMPOSITE 1
33-
static const int INPUT_TYPE_INT_ALL -1
34-
static const int INPUT_TYPE_INT_HDMI 0
35-
static const int INPUT_TYPE_INT_COMPOSITE 1
36-
// </pca>
24+
static const std::string INPUT_TYPE_STRING_ALL = "ALL";
25+
static const std::string INPUT_TYPE_STRING_HDMI = "HDMI";
26+
static const std::string INPUT_TYPE_STRING_COMPOSITE = "COMPOSITE";
27+
28+
static const int INPUT_TYPE_INT_ALL = -1;
29+
static const int INPUT_TYPE_INT_HDMI = 0;
30+
static const int INPUT_TYPE_INT_COMPOSITE = 1;
3731

3832
class AVInputUtils {
3933
public:

0 commit comments

Comments
 (0)