Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Aws::Kinesis::KinesisStreamManager Class Reference

#include <kinesis_stream_manager.h>

Inheritance diagram for Aws::Kinesis::KinesisStreamManager:
Inheritance graph
[legend]

Classes

struct  RekognitionStreamInfo
 

Public Member Functions

KinesisManagerStatus FetchRekognitionResults (const std::string &stream_name, Aws::Vector< Model::Record > *records) override
 
void FreeStream (std::string stream_name) override
 
KinesisVideoProducerInterfaceget_video_producer ()
 
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, KinesisStreamManagerInterface::VideoProducerFactory video_producer_factory=KinesisStreamManagerInterface::CreateDefaultVideoProducer) override
 
KinesisManagerStatus InitializeVideoProducer (std::string region, KinesisStreamManagerInterface::VideoProducerFactory video_producer_factory=KinesisStreamManagerInterface::CreateDefaultVideoProducer) override
 
KinesisManagerStatus InitializeVideoStream (std::unique_ptr< com::amazonaws::kinesis::video::StreamDefinition > stream_definition) override
 
 KinesisStreamManager (Aws::Client::ParameterReaderInterface *parameter_reader, StreamDefinitionProvider *stream_definition_provider, StreamSubscriptionInstaller *subscription_installer, std::unique_ptr< KinesisClient > kinesis_client)
 
 KinesisStreamManager ()=default
 
KinesisManagerStatus KinesisVideoStreamerSetup () override
 
KinesisManagerStatus KinesisVideoStreamSetup (const uint16_t stream_idx, const PBYTE codec_private_data, const uint32_t codec_private_data_size, std::string *stream_name) override
 
KinesisManagerStatus ProcessCodecPrivateDataForStream (const std::string &stream_name, std::vector< uint8_t > codec_private_data) override
 
KinesisManagerStatus PutFrame (std::string stream_name, Frame &frame) const override
 
KinesisManagerStatus PutMetadata (std::string stream_name, const std::string &name, const std::string &value) const override
 
 ~KinesisStreamManager ()=default
 
- Public Member Functions inherited from Aws::Kinesis::KinesisStreamManagerInterface
 KinesisStreamManagerInterface (const Aws::Client::ParameterReaderInterface *parameter_reader, const StreamDefinitionProvider *stream_definition_provider, StreamSubscriptionInstaller *subscription_installer)
 
 KinesisStreamManagerInterface ()=default
 
virtual ~KinesisStreamManagerInterface ()=default
 

Protected Member Functions

KinesisManagerStatus InitializeStreamSubscription (const StreamSubscriptionDescriptor &descriptor) override
 
- Protected Member Functions inherited from Aws::Kinesis::KinesisStreamManagerInterface
virtual KinesisManagerStatus GenerateStreamSubscriptionDescriptor (int stream_idx, StreamSubscriptionDescriptor &descriptor)
 

Private Member Functions

KinesisManagerStatus UpdateShardIterator (const std::string &stream_name)
 

Private Attributes

std::unique_ptr< KinesisClient > kinesis_client_
 
std::map< std::string, RekognitionStreamInforekognition_config_
 
std::unique_ptr< KinesisVideoProducerInterfacevideo_producer_
 
std::map< std::string, std::shared_ptr< KinesisVideoStreamInterface > > video_streams_
 
std::map< std::string, std::vector< uint8_t > > video_streams_codec_data_
 

Additional Inherited Members

- Public Types inherited from Aws::Kinesis::KinesisStreamManagerInterface
using VideoProducerFactory = 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 >)>
 
- Static Public Member Functions inherited from Aws::Kinesis::KinesisStreamManagerInterface
static std::unique_ptr< KinesisVideoProducerInterfaceCreateDefaultVideoProducer (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)
 
- Protected Attributes inherited from Aws::Kinesis::KinesisStreamManagerInterface
const Aws::Client::ParameterReaderInterfaceparameter_reader_ = nullptr
 
const StreamDefinitionProviderstream_definition_provider_ = nullptr
 
StreamSubscriptionInstallersubscription_installer_ = nullptr
 

Detailed Description

Use this class to manage AWS Kinesis streams. In order to use Video Streams, make sure to call InitializeVideoProducer before creating any streams.

Definition at line 240 of file kinesis_stream_manager.h.

Constructor & Destructor Documentation

Aws::Kinesis::KinesisStreamManager::KinesisStreamManager ( Aws::Client::ParameterReaderInterface parameter_reader,
StreamDefinitionProvider stream_definition_provider,
StreamSubscriptionInstaller subscription_installer,
std::unique_ptr< KinesisClient >  kinesis_client 
)
inline

Definition at line 243 of file kinesis_stream_manager.h.

Aws::Kinesis::KinesisStreamManager::KinesisStreamManager ( )
default
Aws::Kinesis::KinesisStreamManager::~KinesisStreamManager ( )
default

Member Function Documentation

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::FetchRekognitionResults ( const std::string &  stream_name,
Aws::Vector< Model::Record > *  records 
)
overridevirtual

This function returns the analysis results from Rekognition for the video stream, by reading the associated Kinesis data stream.

Parameters
stream_namethe name of the Kinesis video stream.
recordswill store the fetched records.
Returns
KINESIS_MANAGER_STATUS_SUCCESS If the GetRecords call completed successfully.

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 409 of file kinesis_stream_manager.cpp.

void Aws::Kinesis::KinesisStreamManager::FreeStream ( std::string  stream_name)
overridevirtual

Stops and frees the resources used by a given stream. This does not delete the stream in AWS Kinesis.

Parameters
stream_name

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 313 of file kinesis_stream_manager.cpp.

KinesisVideoProducerInterface* Aws::Kinesis::KinesisStreamManager::get_video_producer ( )
inline

Definition at line 292 of file kinesis_stream_manager.h.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::InitializeStreamSubscription ( const StreamSubscriptionDescriptor descriptor)
overrideprotectedvirtual

Initializes the subscription for the stream's input.

Parameters
descriptora subscription descriptor previously generated by GenerateStreamSubscriptionDescriptor.
Returns
KinesisManagerStatus

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 181 of file kinesis_stream_manager.cpp.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::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,
KinesisStreamManagerInterface::VideoProducerFactory  video_producer_factory = KinesisStreamManagerInterface::CreateDefaultVideoProducer 
)
overridevirtual

Initializes the video producer with the given callbacks.

Note
This function must be called if the KinesisStreamManager is to be used for video streams.
This function should only be called once.
Parameters
region
device_info_provider
client_callback_provider
stream_callback_provider
credential_provider
video_producer_factory
Returns
KinesisManagerStatus

Implements Aws::Kinesis::KinesisStreamManagerInterface.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::InitializeVideoProducer ( std::string  region,
KinesisStreamManagerInterface::VideoProducerFactory  video_producer_factory = KinesisStreamManagerInterface::CreateDefaultVideoProducer 
)
overridevirtual

Initializes the video producer using the default callbacks provided as part of the Kinesis Manager package.

Parameters
region
video_producer_factory
Returns
KinesisManagerStatus

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 216 of file kinesis_stream_manager.cpp.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::InitializeVideoStream ( std::unique_ptr< com::amazonaws::kinesis::video::StreamDefinition >  stream_definition)
overridevirtual

Initializes a video stream using the given stream definition.

Note
The video producer must have been initialized before any calls to this function are made.
If a stream by the same name already exists in AWS Kinesis, it will be used without creating a new one.
Parameters
stream_definition
Returns
KinesisManagerStatus

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 238 of file kinesis_stream_manager.cpp.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::KinesisVideoStreamerSetup ( )
inlineoverridevirtual

This function orchestrates the universal setup of a video streaming application.

See also
common.h for details about the input format for the stream definition.
Parameters
parameter_reader
subscription_installerresponsible for subscribing to a media source and setting up callbacks that would convert/transmit the data to AWS Kinesis.
stream_definition_provider
Returns
KinesisManagerStatus returning KINESIS_MANAGER_STATUS_SUCCESS if at least one stream was successfully bootstrapped.

Reimplemented from Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 272 of file kinesis_stream_manager.h.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::KinesisVideoStreamSetup ( const uint16_t  stream_idx,
const PBYTE  codec_private_data,
const uint32_t  codec_private_data_size,
std::string *  stream_name 
)
inlineoverridevirtual

This function orchestrates the setup of a single video stream and is called by KinesisVideoStreamerSetup.

Parameters
stream_idx
codec_private_data
codec_private_data_size
stream_nameIf not null, the stream name will be stored in this location.
Returns
KinesisManagerStatus

Reimplemented from Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 277 of file kinesis_stream_manager.h.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::ProcessCodecPrivateDataForStream ( const std::string &  stream_name,
std::vector< uint8_t >  codec_private_data 
)
overridevirtual

This function should be called whenever the codec data (sequence and picture parameter sets) have changed for the stream. Typically this would happen if encoder settings (such as fps or resolution) were changed.

Parameters
stream_name
codec_private_data
Returns
KINESIS_MANAGER_STATUS_SUCCESS if the stream was updated successfully or if no update was necessary.

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 324 of file kinesis_stream_manager.cpp.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::PutFrame ( std::string  stream_name,
Frame &  frame 
) const
overridevirtual

Transmits a single video frame into AWS Kinesis.

Note
Both the video producer and the given stream must have been initialized before any calls to this function are made.
Parameters
stream_name
frame
Returns
KinesisManagerStatus

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 279 of file kinesis_stream_manager.cpp.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::PutMetadata ( std::string  stream_name,
const std::string &  name,
const std::string &  value 
) const
overridevirtual

Sends metadata to AWS Kinesis to be prepended to the next video fragment of the stream.

Note
Both the video producer and the given stream must have been initialized before any calls to this function are made.
Parameters
stream_name
namethe metadata name
valuethe metadata value
Returns
KinesisManagerStatus

Implements Aws::Kinesis::KinesisStreamManagerInterface.

Definition at line 295 of file kinesis_stream_manager.cpp.

KinesisManagerStatus Aws::Kinesis::KinesisStreamManager::UpdateShardIterator ( const std::string &  stream_name)
private

Updates RekognitionStreamInfo::shard_iterator by calling Kinesis' ListShards and GetShardIterator APIs.

Parameters
stream_name
Returns
KinesisManagerStatus

Definition at line 368 of file kinesis_stream_manager.cpp.

Member Data Documentation

std::unique_ptr<KinesisClient> Aws::Kinesis::KinesisStreamManager::kinesis_client_
private

Definition at line 313 of file kinesis_stream_manager.h.

std::map<std::string, RekognitionStreamInfo> Aws::Kinesis::KinesisStreamManager::rekognition_config_
private

Definition at line 321 of file kinesis_stream_manager.h.

std::unique_ptr<KinesisVideoProducerInterface> Aws::Kinesis::KinesisStreamManager::video_producer_
private

Definition at line 312 of file kinesis_stream_manager.h.

std::map<std::string, std::shared_ptr<KinesisVideoStreamInterface> > Aws::Kinesis::KinesisStreamManager::video_streams_
private

Definition at line 310 of file kinesis_stream_manager.h.

std::map<std::string, std::vector<uint8_t> > Aws::Kinesis::KinesisStreamManager::video_streams_codec_data_
private

Definition at line 311 of file kinesis_stream_manager.h.


The documentation for this class was generated from the following files:


kinesis_manager
Author(s): AWS RoboMaker
autogenerated on Thu Mar 4 2021 03:28:41