This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
h264_encoder_node_config.cpp
61 lines (51 loc) · 2.5 KB
/
h264_encoder_node_config.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <aws/core/utils/logging/LogMacros.h>
#include <h264_encoder_core/h264_encoder_node_config.h>
namespace Aws {
namespace Kinesis {
constexpr char kSubscriptionTopicKey[] = "subscription_topic";
constexpr char kMetadataTopicKey[] = "metadata_topic";
constexpr char kPublicationTopicKey[] = "publication_topic";
constexpr char kQueueSizeKey[] = "queue_size";
constexpr char kDefaultSubscriptionTopic[] = "/raspicam_node/image";
constexpr char kDefaultMetadataTopic[] = "/image_metadata";
constexpr char kDefaultPublicationTopic[] = "/video/encoded";
constexpr int kDefaultQueueSize = 100;
Aws::AwsError GetH264EncoderNodeParams(const Aws::Client::ParameterReaderInterface & param_reader,
H264EncoderNodeParams & params)
{
params.subscription_topic = kDefaultSubscriptionTopic;
param_reader.ReadParam(Aws::Client::ParameterPath(kSubscriptionTopicKey), params.subscription_topic);
params.metadata_topic = kDefaultMetadataTopic;
param_reader.ReadParam(Aws::Client::ParameterPath(kMetadataTopicKey), params.metadata_topic);
params.publication_topic = kDefaultPublicationTopic;
param_reader.ReadParam(Aws::Client::ParameterPath(kPublicationTopicKey), params.publication_topic);
params.queue_size = kDefaultQueueSize;
param_reader.ReadParam(Aws::Client::ParameterPath(kQueueSizeKey), params.queue_size);
if (params.queue_size < 0) {
AWS_LOGSTREAM_ERROR(__func__, "Invalid queue size " << params.queue_size << "!");
return AWS_ERR_PARAM;
} else if (params.queue_size == 0) {
AWS_LOGSTREAM_WARN(__func__, "Queue size is set to " << params.queue_size << " (infinity)!");
}
return AWS_ERR_OK;
}
} // namespace Kinesis
} // namespace Aws