31 uint32_t get_codec_private_data_call_count = 0;
33 uint32_t get_stream_definition_call_count = 0;
34 StreamDefinition * get_stream_definition_return_value =
nullptr;
35 uint32_t subscribe_call_count = 0;
37 uint32_t initialize_video_producer_call_count = 0;
39 uint32_t initialize_video_stream_call_count = 0;
41 uint32_t put_frame_call_count = 0;
43 uint32_t put_metadata_call_count = 0;
45 uint32_t free_stream_call_count = 0;
46 uint32_t kinesis_video_frame_callback_call_count = 0;
47 uint32_t rekognition_kinesis_video_frame_callback_call_count = 0;
48 uint32_t fetch_rekognition_results_call_count = 0;
49 uint32_t image_callback_call_count = 0;
50 uint32_t process_codec_private_data_call_count = 0;
55 get_codec_private_data_call_count = 0;
57 get_stream_definition_call_count = 0;
58 get_stream_definition_return_value =
nullptr;
59 subscribe_call_count = 0;
61 initialize_video_producer_call_count = 0;
63 initialize_video_stream_call_count = 0;
65 put_frame_call_count = 0;
67 put_metadata_call_count = 0;
69 free_stream_call_count = 0;
70 kinesis_video_frame_callback_call_count = 0;
71 rekognition_kinesis_video_frame_callback_call_count = 0;
72 fetch_rekognition_results_call_count = 0;
73 image_callback_call_count = 0;
74 process_codec_private_data_call_count = 0;
86 PBYTE * out_codec_private_data,
87 uint32_t * out_codec_private_data_size)
const override 95 const PBYTE codec_private_data,
96 uint32_t codec_private_data_size)
const override 129 {test_prefix +
"retention_period", 2},
130 {test_prefix +
"streaming_type", 0},
131 {test_prefix +
"max_latency", 0},
132 {test_prefix +
"fragment_duration", 2},
133 {test_prefix +
"timecode_scale", 1},
134 {test_prefix +
"nal_adaptation_flags",
135 NAL_ADAPTATION_ANNEXB_NALS | NAL_ADAPTATION_ANNEXB_CPD_NALS},
136 {test_prefix +
"frame_rate", 24},
137 {test_prefix +
"avg_bandwidth_bps", 4 * 1024 * 1024},
138 {test_prefix +
"buffer_duration", 120},
139 {test_prefix +
"replay_duration", 40},
140 {test_prefix +
"connection_staleness", 30},
143 {test_prefix +
"key_frame_fragmentation",
true}, {test_prefix +
"frame_timecodes",
true},
144 {test_prefix +
"absolute_fragment_time",
true}, {test_prefix +
"fragment_acks",
true},
145 {test_prefix +
"restart_on_error",
true}, {test_prefix +
"recalculate_metrics",
true},
148 {test_prefix +
"stream_name",
"testStream"}, {test_prefix +
"kms_key_id",
""},
149 {test_prefix +
"content_type",
"video/h264"}, {test_prefix +
"codec_id",
"V_MPEG4/ISO/AVC"},
150 {test_prefix +
"track_name",
"kinesis_video"},
153 {test_prefix +
"tags", {{
"someKey",
"someValue"}}},
157 TestParameterReader(std::map<std::string, int> int_map, std::map<std::string, bool> bool_map,
158 std::map<std::string, std::string> string_map, std::map<std::string, std::map<std::string, std::string>> map_map)
159 : int_map_(int_map), bool_map_(bool_map), string_map_(string_map), map_map_(map_map)
165 std::string name = FormatParameterPath(param_path);
166 if (int_map_.count(name) > 0) {
167 out = int_map_.at(name);
175 std::string name = FormatParameterPath(param_path);
176 if (bool_map_.count(name) > 0) {
177 out = bool_map_.at(name);
185 std::string name = FormatParameterPath(param_path);
186 if (string_map_.count(name) > 0) {
187 out = string_map_.at(name);
200 std::string name = FormatParameterPath(param_path);
201 if (map_map_.count(name) > 0) {
202 out = map_map_.at(name);
218 std::map<std::string, int> int_map_;
219 std::map<std::string, bool> bool_map_;
220 std::map<std::string, std::string> string_map_;
221 std::map<std::string, std::map<std::string, std::string>> map_map_;
224 std::string FormatParameterPath(
const ParameterPath & param_path)
const 239 subscription_installer)
245 std::string region, std::unique_ptr<DeviceInfoProvider> device_info_provider,
246 std::unique_ptr<ClientCallbackProvider> client_callback_provider,
247 std::unique_ptr<StreamCallbackProvider> stream_callback_provider,
248 std::unique_ptr<CredentialProvider> credential_provider,
263 std::unique_ptr<StreamDefinition> stream_definition)
override 276 const std::string & value)
const 286 return KinesisStreamManagerInterface::KinesisVideoStreamerSetup();
290 const std::string & stream_name, std::vector<uint8_t> codec_private_data)
override 297 Aws::Vector<Model::Record> * records)
override 306 return KinesisStreamManagerInterface::GenerateStreamSubscriptionDescriptor(stream_idx,
313 return subscription_installer_->Install(descriptor);
KinesisManagerStatus GenerateStreamSubscriptionDescriptor(int stream_idx, StreamSubscriptionDescriptor &descriptor) override
KINESIS_MANAGER_STATUS_SUCCESS
uint32_t initialize_video_stream_call_count
StreamDefinition * get_stream_definition_return_value
KinesisManagerStatus PutMetadata(std::string stream_name, const std::string &name, const std::string &value) const
KinesisManagerStatus GetCodecPrivateData(const ParameterPath &prefix, const ParameterReaderInterface &reader, PBYTE *out_codec_private_data, uint32_t *out_codec_private_data_size) const override
MockStreamDefinitionProvider(TestData *data)
uint32_t subscribe_call_count
KinesisManagerStatus subscribe_return_value
enum Aws::Kinesis::kinesis_manager_status_e KinesisManagerStatus
KinesisManagerStatus KinesisVideoStreamerSetup() override
MockStreamSubscriptionInstaller(TestData *data, Aws::Kinesis::KinesisStreamManagerInterface &stream_manager, ros::NodeHandle &handle)
uint32_t put_frame_call_count
KinesisManagerStatus InitializeVideoStream(std::unique_ptr< StreamDefinition > stream_definition) override
KinesisManagerStatus put_metadata_return_value
MockStreamManager(TestData *data, TestParameterReader *parameter_reader, StreamDefinitionProvider *stream_definition_provider, StreamSubscriptionInstaller *subscription_installer)
std::function< std::unique_ptr< KinesisVideoProducerInterface >(std::string, std::unique_ptr< com::amazonaws::kinesis::video::DeviceInfoProvider >, std::unique_ptr< com::amazonaws::kinesis::video::ClientCallbackProvider >, std::unique_ptr< com::amazonaws::kinesis::video::StreamCallbackProvider >, std::unique_ptr< com::amazonaws::kinesis::video::CredentialProvider >)> VideoProducerFactory
KinesisManagerStatus PutFrame(std::string stream_name, Frame &frame) const override
KinesisManagerStatus InitializeVideoProducer(std::string region, VideoProducerFactory video_producer_factory) override
uint32_t free_stream_call_count
uint32_t process_codec_private_data_call_count
KinesisManagerStatus FetchRekognitionResults(const std::string &stream_name, Aws::Vector< Model::Record > *records) override
KinesisManagerStatus get_codec_private_data_return_value
uint32_t initialize_video_producer_call_count
std::string get_resolved_path(char node_namespace_separator, char parameter_namespace_separator) const
MockStreamManager(TestData *data)
uint32_t get_stream_definition_call_count
KinesisManagerStatus put_frame_return_value
uint32_t fetch_rekognition_results_call_count
KinesisManagerStatus initialize_video_producer_return_value
KinesisManagerStatus Install(const StreamSubscriptionDescriptor &descriptor) const override
KinesisManagerStatus InitializeVideoProducer(std::string region, std::unique_ptr< DeviceInfoProvider > device_info_provider, std::unique_ptr< ClientCallbackProvider > client_callback_provider, std::unique_ptr< StreamCallbackProvider > stream_callback_provider, std::unique_ptr< CredentialProvider > credential_provider, VideoProducerFactory video_producer_factory) override
void Uninstall(std::string &topic_name)
void FreeStream(std::string stream_name) override
KinesisManagerStatus initialize_video_stream_return_value
KinesisManagerStatus InitializeStreamSubscription(const StreamSubscriptionDescriptor &descriptor) override
std::unique_ptr< StreamDefinition > GetStreamDefinition(const ParameterPath &prefix, const ParameterReaderInterface &reader, const PBYTE codec_private_data, uint32_t codec_private_data_size) const override
KinesisManagerStatus ProcessCodecPrivateDataForStream(const std::string &stream_name, std::vector< uint8_t > codec_private_data) override
uint32_t put_metadata_call_count
KinesisManagerStatus process_codec_private_data_return_value
uint32_t get_codec_private_data_call_count