16 #include <aws/kinesis/KinesisClient.h> 17 #include <aws/kinesis/model/GetRecordsRequest.h> 18 #include <aws/kinesis/model/GetRecordsResult.h> 19 #include <aws/kinesis/model/Record.h> 22 #include <kinesis-video-producer/KinesisVideoProducer.h> 46 path += kStreamParameters.stream_namespace + std::to_string(stream_idx);
48 if (
nullptr != parameter_name) {
49 path += parameter_name;
85 std::unique_ptr<com::amazonaws::kinesis::video::DeviceInfoProvider>,
86 std::unique_ptr<com::amazonaws::kinesis::video::ClientCallbackProvider>,
87 std::unique_ptr<com::amazonaws::kinesis::video::StreamCallbackProvider>,
88 std::unique_ptr<com::amazonaws::kinesis::video::CredentialProvider>
104 std::unique_ptr<com::amazonaws::kinesis::video::DeviceInfoProvider> device_info_provider,
105 std::unique_ptr<com::amazonaws::kinesis::video::ClientCallbackProvider> client_callback_provider,
106 std::unique_ptr<com::amazonaws::kinesis::video::StreamCallbackProvider> stream_callback_provider,
107 std::unique_ptr<com::amazonaws::kinesis::video::CredentialProvider> credential_provider,
129 std::unique_ptr<com::amazonaws::kinesis::video::StreamDefinition> stream_definition) = 0;
151 const std::string & value)
const = 0;
170 const std::string &
stream_name, std::vector<uint8_t> codec_private_data) = 0;
180 Aws::Vector<Model::Record> * records) = 0;
184 std::unique_ptr<com::amazonaws::kinesis::video::DeviceInfoProvider> device_info_provider,
185 std::unique_ptr<com::amazonaws::kinesis::video::ClientCallbackProvider> client_callback_provider,
186 std::unique_ptr<com::amazonaws::kinesis::video::StreamCallbackProvider> stream_callback_provider,
187 std::unique_ptr<com::amazonaws::kinesis::video::CredentialProvider> credential_provider);
211 const PBYTE codec_private_data,
212 const uint32_t codec_private_data_size,
246 std::unique_ptr<KinesisClient> kinesis_client)
247 : kinesis_client_(
std::move(kinesis_client)),
249 subscription_installer){};
254 std::unique_ptr<com::amazonaws::kinesis::video::DeviceInfoProvider> device_info_provider,
255 std::unique_ptr<com::amazonaws::kinesis::video::ClientCallbackProvider> client_callback_provider,
256 std::unique_ptr<com::amazonaws::kinesis::video::StreamCallbackProvider> stream_callback_provider,
257 std::unique_ptr<com::amazonaws::kinesis::video::CredentialProvider> credential_provider,
263 std::unique_ptr<com::amazonaws::kinesis::video::StreamDefinition> stream_definition)
override;
268 const std::string & value)
const override;
270 void FreeStream(std::string stream_name)
override;
278 const PBYTE codec_private_data,
279 const uint32_t codec_private_data_size,
280 std::string * stream_name)
override 283 stream_idx, codec_private_data, codec_private_data_size, stream_name);
287 const std::string & stream_name, std::vector<uint8_t> codec_private_data)
override;
290 Aws::Vector<Model::Record> * records)
override;
294 return video_producer_.get();
310 std::map<std::string, std::shared_ptr<KinesisVideoStreamInterface>>
video_streams_;
320 std::map<std::string, RekognitionStreamInfo>
std::unique_ptr< KinesisClient > kinesis_client_
virtual KinesisManagerStatus PutMetadata(std::string stream_name, const std::string &name, const std::string &value) const =0
Aws::String data_stream_name
Aws::String shard_iterator
std::map< std::string, std::shared_ptr< KinesisVideoStreamInterface > > video_streams_
virtual void FreeStream(std::string stream_name)=0
std::map< std::string, std::vector< uint8_t > > video_streams_codec_data_
KinesisManagerStatus KinesisVideoStreamSetup(const uint16_t stream_idx, const PBYTE codec_private_data, const uint32_t codec_private_data_size, std::string *stream_name) override
enum Aws::Kinesis::kinesis_manager_status_e KinesisManagerStatus
StreamSubscriptionInstaller * subscription_installer_
Aws::Client::ParameterPath GetStreamParameterPrefix(int stream_idx)
KinesisManagerStatus KinesisVideoStreamerSetup() override
static std::unique_ptr< KinesisVideoProducerInterface > CreateDefaultVideoProducer(std::string region, std::unique_ptr< com::amazonaws::kinesis::video::DeviceInfoProvider > device_info_provider, std::unique_ptr< com::amazonaws::kinesis::video::ClientCallbackProvider > client_callback_provider, std::unique_ptr< com::amazonaws::kinesis::video::StreamCallbackProvider > stream_callback_provider, std::unique_ptr< com::amazonaws::kinesis::video::CredentialProvider > credential_provider)
const StreamDefinitionProvider * stream_definition_provider_
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
virtual KinesisManagerStatus FetchRekognitionResults(const std::string &stream_name, Aws::Vector< Model::Record > *records)=0
virtual KinesisManagerStatus InitializeStreamSubscription(const StreamSubscriptionDescriptor &descriptor)=0
virtual KinesisManagerStatus GenerateStreamSubscriptionDescriptor(int stream_idx, StreamSubscriptionDescriptor &descriptor)
virtual KinesisManagerStatus InitializeVideoStream(std::unique_ptr< com::amazonaws::kinesis::video::StreamDefinition > stream_definition)=0
#define INVALID_STREAM_ID
Aws::Client::ParameterPath GetStreamParameterPath(int stream_idx, const char *parameter_name)
std::unique_ptr< KinesisVideoProducerInterface > video_producer_
virtual KinesisManagerStatus ProcessCodecPrivateDataForStream(const std::string &stream_name, std::vector< uint8_t > codec_private_data)=0
KinesisStreamManager(Aws::Client::ParameterReaderInterface *parameter_reader, StreamDefinitionProvider *stream_definition_provider, StreamSubscriptionInstaller *subscription_installer, std::unique_ptr< KinesisClient > kinesis_client)
virtual KinesisManagerStatus InitializeVideoProducer(std::string region, std::unique_ptr< com::amazonaws::kinesis::video::DeviceInfoProvider > device_info_provider, std::unique_ptr< com::amazonaws::kinesis::video::ClientCallbackProvider > client_callback_provider, std::unique_ptr< com::amazonaws::kinesis::video::StreamCallbackProvider > stream_callback_provider, std::unique_ptr< com::amazonaws::kinesis::video::CredentialProvider > credential_provider, VideoProducerFactory video_producer_factory=KinesisStreamManagerInterface::CreateDefaultVideoProducer)=0
virtual KinesisManagerStatus KinesisVideoStreamSetup(const uint16_t stream_idx, const PBYTE codec_private_data, const uint32_t codec_private_data_size, std::string *stream_name)
Aws::Client::ParameterPath GetKinesisVideoParameter(const char *parameter_name)
KinesisVideoProducerInterface * get_video_producer()
const Aws::Client::ParameterReaderInterface * parameter_reader_
virtual KinesisManagerStatus PutFrame(std::string stream_name, Frame &frame) const =0
KinesisStreamManagerInterface()=default
virtual ~KinesisStreamManagerInterface()=default
virtual KinesisManagerStatus KinesisVideoStreamerSetup()
KinesisStreamManagerInterface(const Aws::Client::ParameterReaderInterface *parameter_reader, const StreamDefinitionProvider *stream_definition_provider, StreamSubscriptionInstaller *subscription_installer)
std::map< std::string, RekognitionStreamInfo > rekognition_config_