nx_cloud_storage_sdk  1.0
Cloud Storage SDK
Public Member Functions | Static Public Member Functions | List of all members
nx::sdk::cloud_storage::IStreamWriter Class Referenceabstract

#include <i_stream_writer.h>

Inheritance diagram for nx::sdk::cloud_storage::IStreamWriter:
nx::sdk::Interface< IStreamWriter > nx::sdk::IRefCountable nx::sdk::RefCountable< nx::sdk::cloud_storage::IStreamWriter > nx::vms_server_plugins::cloud_storage::sample::StreamWriter nx::vms_server_plugins::cloud_storage::stub::StreamWriter

Public Member Functions

virtual ErrorCode putData (const IMediaDataPacket *packet)=0
 
virtual ErrorCode close (int64_t durationMs)=0
 
virtual int size () const =0
 
- Public Member Functions inherited from nx::sdk::Interface< IStreamWriter >
virtual IRefCountablequeryInterface (const InterfaceId *id)
 
Ptr< RefCountablequeryInterface ()
 
Ptr< const RefCountablequeryInterface () const
 
- Public Member Functions inherited from nx::sdk::IRefCountable
virtual ~IRefCountable ()=default
 
template<class RefCountable >
Ptr< RefCountablequeryInterface ()
 
template<class RefCountable >
Ptr< const RefCountablequeryInterface () const
 
virtual int addRef () const =0
 
virtual int releaseRef () const =0
 
int refCountThreadUnsafe () const
 

Static Public Member Functions

static auto interfaceId ()
 
- Static Public Member Functions inherited from nx::sdk::IRefCountable
static auto interfaceId ()
 

Additional Inherited Members

- Protected Member Functions inherited from nx::sdk::Interface< IStreamWriter >
virtual IRefCountablequeryInterface (const IRefCountable::InterfaceId *id) override
 
IRefCountablequeryInterfaceSupportingDeprecatedId (const IRefCountable::InterfaceId *id, const Uuid &deprecatedInterfaceId)
 
- Static Protected Member Functions inherited from nx::sdk::IRefCountable
template<int len>
static constexpr const InterfaceIdmakeId (const char(&charArray)[len])
 
template<class TemplateInstance , class TemplateArg , int len>
static const InterfaceIdmakeIdForTemplate (const char(&baseIdCharArray)[len])
 
- Static Protected Attributes inherited from nx::sdk::IRefCountable
template<typename RefCountable >
static constexpr bool hasAlternativeInterfaceId = HasAlternativeInterfaceId<RefCountable>::value
 

Detailed Description

Stream writer abstraction. Stream is a sequence of media data packets, which more or less represent continuous chunk of media and metadata for the given period of time. When Mediaserver is finished with the current stream ~IStreamWriter() will be called. Implementation might do some finalization at this point. Server will create a StreamWriter object for each chunk of media data. So the media stream, being continuous is still cut on the small chunks of data each of which has its timestamp and duration. Each of those chunks are recorded using Stream Writer and subsequently requested back using a corresponding StreamReader object.

Member Function Documentation

◆ close()

virtual ErrorCode nx::sdk::cloud_storage::IStreamWriter::close ( int64_t  durationMs)
pure virtual

This function will be called just before destruction of the StreamWriter object and no other calls (except destructor) will follow.

Implemented in nx::vms_server_plugins::cloud_storage::stub::StreamWriter, and nx::vms_server_plugins::cloud_storage::sample::StreamWriter.

◆ putData()

virtual ErrorCode nx::sdk::cloud_storage::IStreamWriter::putData ( const IMediaDataPacket packet)
pure virtual

Write a data packet. Implementation is discouraged to buffer packets. Instead, it should block until the data is completely processed.

packet->channelNumber() corresponds to ICodecInfo::channelNumber() i.e. if packet->type() == dptVideo && packet->channelNumber() == 1, then CodecInfo with mediaType == AVMEDIA_TYPE_VIDEO && channelNumber == 1 can be used to process this packet.

If packet->type() == dptAudio && packet->channelNumber() == 0, then CodecInfo with mediaType == AVMEDIA_TYPE_AUDIO && channelNumber == 0 can be used to process this packet.

If packet->type() == dptData && packet->channelNumber() == 0, then CodecInfo with mediaType == AVMEDIA_TYPE_DATA && channelNumber == 0 can be used to process this packet.

Implemented in nx::vms_server_plugins::cloud_storage::stub::StreamWriter, and nx::vms_server_plugins::cloud_storage::sample::StreamWriter.

◆ size()

virtual int nx::sdk::cloud_storage::IStreamWriter::size ( ) const
pure virtual

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