MillicastSDK 2.0.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
millicast::Source Class Referenceabstract

The Source base class. More...

#include <source.h>

Inheritance diagram for millicast::Source:
Inheritance graph
[legend]

Classes

struct  SourceInformation
 

Public Types

enum class  Type {
  DEVICE , MONITOR , APP , MIC ,
  NDI , DECKLINK , TVOS , CUSTOM
}
 The Source type. More...
 
template<typename T >
using SourcePtr = std::shared_ptr< T >
 
using Ptr = SourcePtr< Source >
 

Public Member Functions

template<typename T = Type>
type () const
 Get the video source's type.
 
MILLICAST_API int id () const
 Get the id of the source.
 
MILLICAST_API const std::string & name () const
 Get the name of the source.
 
MILLICAST_API const std::string & unique_id () const
 Get the source's unique_id.
 
MILLICAST_API void set_track_name (std::string track_name)
 Set the name of the track. The name of the track is the name used to identify the track in the SDP.
 
MILLICAST_API const std::string & track_name () const
 Get the name of the track. If you did not set one, it will be the default one.
 
virtual MILLICAST_API std::weak_ptr< Trackstart_capture ()=0
 Start a capture from this source, this will init and start the capture device and create the corresponding track.
 
virtual MILLICAST_API void stop_capture ()=0
 Stop a capture adn release the track and the underlying devices.
 
virtual MILLICAST_API bool is_capturing () const =0
 Tell is the source is currently capturing.
 
virtual MILLICAST_API ~Source ()=default
 

Protected Member Functions

 Source (const SourceInformation &information) noexcept
 

Friends

class AudioPlayback
 

Detailed Description

The Source base class.

Member Typedef Documentation

◆ Ptr

◆ SourcePtr

template<typename T >
using millicast::Source::SourcePtr = std::shared_ptr<T>

Member Enumeration Documentation

◆ Type

enum class millicast::Source::Type
strong

The Source type.

Enumerator
DEVICE 

Hardware sources, camera, playback devices, ...

MONITOR 

Fullscreen capture source

APP 

Application screen capture source

MIC 

Microphone devices source

NDI 

Ndi sources (input and output)

DECKLINK 

DeckLink devices sources (input and output)

TVOS 

tvOS devices sources (output only)

CUSTOM 

Provide your own audio/video data

Constructor & Destructor Documentation

◆ ~Source()

virtual MILLICAST_API millicast::Source::~Source ( )
virtualdefault

◆ Source()

millicast::Source::Source ( const SourceInformation information)
protectednoexcept

Member Function Documentation

◆ id()

MILLICAST_API int millicast::Source::id ( ) const

Get the id of the source.

Returns
The id of the source

◆ is_capturing()

virtual MILLICAST_API bool millicast::Source::is_capturing ( ) const
pure virtual

Tell is the source is currently capturing.

Returns
true is the source is capturing, false otherwise.

Implemented in millicast::CustomAudioSource, and millicast::CustomVideoSource.

◆ name()

MILLICAST_API const std::string & millicast::Source::name ( ) const

Get the name of the source.

Returns
The name of the source

◆ set_track_name()

MILLICAST_API void millicast::Source::set_track_name ( std::string  track_name)

Set the name of the track. The name of the track is the name used to identify the track in the SDP.

Parameters
track_nameName of the track

◆ start_capture()

virtual MILLICAST_API std::weak_ptr< Track > millicast::Source::start_capture ( )
pure virtual

Start a capture from this source, this will init and start the capture device and create the corresponding track.

Returns
The track corresponding to this source. The source's must keep the ownership of the track pointer, that is why the track is returned as a weak_ptr

Implemented in millicast::CustomAudioSource, and millicast::CustomVideoSource.

◆ stop_capture()

virtual MILLICAST_API void millicast::Source::stop_capture ( )
pure virtual

Stop a capture adn release the track and the underlying devices.

Remarks
Since a weak_ptr is returned when starting a capture, you will be able to test if the track has been released (if you store it somewhere) you won't have to deal with dangling pointer.

Implemented in millicast::CustomAudioSource, and millicast::CustomVideoSource.

◆ track_name()

MILLICAST_API const std::string & millicast::Source::track_name ( ) const

Get the name of the track. If you did not set one, it will be the default one.

Returns
The name of the track.

◆ type()

template<typename T = Type>
T millicast::Source::type ( ) const

Get the video source's type.

Template Parameters
TGet the source's type in the specified type. Supported value are std::string or Source::Type. The default is Source::Type

◆ unique_id()

MILLICAST_API const std::string & millicast::Source::unique_id ( ) const

Get the source's unique_id.

Returns
The unique id of the source

Friends And Related Symbol Documentation

◆ AudioPlayback

friend class AudioPlayback
friend

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