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

#include <source.h>

Inheritance diagram for millicast::CustomVideoSource:
Inheritance graph
[legend]
Collaboration diagram for millicast::CustomVideoSource:
Collaboration graph
[legend]

Classes

struct  Builder
 Builder struct to create a CustomVideoSource. More...
 

Public Types

using Ptr = Source::SourcePtr< CustomVideoSource >
 
- Public Types inherited from millicast::Source
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

MILLICAST_API std::weak_ptr< Trackstart_capture () override=0
 Start a capture from this source, this will init and start the capture device and create the corresponding track.
 
MILLICAST_API bool is_capturing () const override=0
 Tell is the source is currently capturing.
 
MILLICAST_API void stop_capture () override=0
 Stop a capture adn release the track and the underlying devices.
 
virtual MILLICAST_API void on_video_frame (const millicast::VideoFrame &frame)=0
 Feed external audio frames to the source.
 
- Public Member Functions inherited from millicast::Source
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
 
- Protected Member Functions inherited from millicast::Source
 Source (const SourceInformation &information) noexcept
 

Member Typedef Documentation

◆ Ptr

Member Function Documentation

◆ is_capturing()

MILLICAST_API bool millicast::CustomVideoSource::is_capturing ( ) const
overridepure virtual

Tell is the source is currently capturing.

Returns
true is the source is capturing, false otherwise.

Implements millicast::Source.

◆ on_video_frame()

virtual MILLICAST_API void millicast::CustomVideoSource::on_video_frame ( const millicast::VideoFrame frame)
pure virtual

Feed external audio frames to the source.

Remarks
You need to invoke this at a required pace (where each frame is expected to be 10ms long).
Parameters
frameThe AudioFrame to feed

◆ Source()

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

◆ start_capture()

MILLICAST_API std::weak_ptr< Track > millicast::CustomVideoSource::start_capture ( )
overridepure 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

Implements millicast::Source.

◆ stop_capture()

MILLICAST_API void millicast::CustomVideoSource::stop_capture ( )
overridepure 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.

Implements millicast::Source.


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