Android-cuttlefish cvd tool
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cuttlefish::ScreenConnector< ProcessedFrameType > Class Template Reference

#include <screen_connector.h>

Inheritance diagram for cuttlefish::ScreenConnector< ProcessedFrameType >:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::ScreenConnector< ProcessedFrameType >:
Collaboration graph
[legend]

Public Types

using FrameMultiplexer = ScreenConnectorInputMultiplexer< ProcessedFrameType >
 
using GenerateProcessedFrameCallback = std::function< void(std::uint32_t, std::uint32_t, std::uint32_t, std::uint32_t, std::uint32_t, std::uint8_t *, ProcessedFrameType &msg)>
 

Public Member Functions

 INJECT (ScreenConnector(WaylandScreenConnector &sc_android_src, HostModeCtrl &host_mode_ctrl))
 
virtual ~ScreenConnector ()=default
 
void SetCallback (GenerateProcessedFrameCallback &&frame_callback)
 
void InjectFrame (std::uint32_t display_number, std::uint32_t frame_w, std::uint32_t frame_h, std::uint32_t frame_fourcc_format, std::uint32_t frame_stride_bytes, std::uint8_t *frame_bytes)
 
bool IsCallbackSet () const override
 
void SetDisplayEventCallback (DisplayEventCallback event_callback)
 
ProcessedFrameType OnNextFrame ()
 
bool RenderConfirmationUi (std::uint32_t display_number, std::uint32_t frame_width, std::uint32_t frame_height, std::uint32_t frame_fourcc_format, std::uint32_t frame_stride_bytes, std::uint8_t *frame_bytes) override
 
- Public Member Functions inherited from cuttlefish::ScreenConnectorFrameRenderer
virtual bool RenderConfirmationUi (uint32_t display_number, uint32_t frame_width, uint32_t frame_height, uint32_t frame_fourcc_format, uint32_t frame_stride_bytes, uint8_t *frame_bytes)=0
 
virtual bool IsCallbackSet () const =0
 
virtual ~ScreenConnectorFrameRenderer ()=default
 

Protected Member Functions

 ScreenConnector ()=delete
 

Private Attributes

WaylandScreenConnectorsc_android_src_
 
HostModeCtrlhost_mode_ctrl_
 
unsigned long long int on_next_frame_cnt_
 
unsigned long long int render_confui_cnt_
 
FrameMultiplexer sc_frame_multiplexer_
 
GenerateProcessedFrameCallback callback_from_streamer_
 
std::mutex streamer_callback_mutex_
 
std::condition_variable streamer_callback_set_cv_
 

Member Typedef Documentation

◆ FrameMultiplexer

template<typename ProcessedFrameType >
using cuttlefish::ScreenConnector< ProcessedFrameType >::FrameMultiplexer = ScreenConnectorInputMultiplexer<ProcessedFrameType>

◆ GenerateProcessedFrameCallback

template<typename ProcessedFrameType >
using cuttlefish::ScreenConnector< ProcessedFrameType >::GenerateProcessedFrameCallback = std::function<void( std::uint32_t , std::uint32_t , std::uint32_t , std::uint32_t , std::uint32_t , std::uint8_t* , ProcessedFrameType& msg)>

This is the type of the callback function WebRTC is supposed to provide ScreenConnector with.

The callback function is how a raw bytes frame should be processed for WebRTC

Constructor & Destructor Documentation

◆ ~ScreenConnector()

template<typename ProcessedFrameType >
virtual cuttlefish::ScreenConnector< ProcessedFrameType >::~ScreenConnector ( )
virtualdefault

◆ ScreenConnector()

template<typename ProcessedFrameType >
cuttlefish::ScreenConnector< ProcessedFrameType >::ScreenConnector ( )
protecteddelete

Member Function Documentation

◆ INJECT()

template<typename ProcessedFrameType >
cuttlefish::ScreenConnector< ProcessedFrameType >::INJECT ( ScreenConnector< ProcessedFrameType >(WaylandScreenConnector< ProcessedFrameType > &sc_android_src, HostModeCtrl &host_mode_ctrl)  )
inline

◆ InjectFrame()

template<typename ProcessedFrameType >
void cuttlefish::ScreenConnector< ProcessedFrameType >::InjectFrame ( std::uint32_t  display_number,
std::uint32_t  frame_w,
std::uint32_t  frame_h,
std::uint32_t  frame_fourcc_format,
std::uint32_t  frame_stride_bytes,
std::uint8_t *  frame_bytes 
)
inline

◆ IsCallbackSet()

template<typename ProcessedFrameType >
bool cuttlefish::ScreenConnector< ProcessedFrameType >::IsCallbackSet ( ) const
inlineoverridevirtual

◆ OnNextFrame()

template<typename ProcessedFrameType >
ProcessedFrameType cuttlefish::ScreenConnector< ProcessedFrameType >::OnNextFrame ( )
inline

◆ RenderConfirmationUi()

template<typename ProcessedFrameType >
bool cuttlefish::ScreenConnector< ProcessedFrameType >::RenderConfirmationUi ( std::uint32_t  display_number,
std::uint32_t  frame_width,
std::uint32_t  frame_height,
std::uint32_t  frame_fourcc_format,
std::uint32_t  frame_stride_bytes,
std::uint8_t *  frame_bytes 
)
inlineoverride

ConfUi calls this when it has frames to render

This won't be called if not by Confirmation UI. This won't affect rendering Android guest frames if Confirmation UI HAL is not active.

◆ SetCallback()

template<typename ProcessedFrameType >
void cuttlefish::ScreenConnector< ProcessedFrameType >::SetCallback ( GenerateProcessedFrameCallback &&  frame_callback)
inline

set the callback function to be eventually used by Wayland-Based Connector

◆ SetDisplayEventCallback()

template<typename ProcessedFrameType >
void cuttlefish::ScreenConnector< ProcessedFrameType >::SetDisplayEventCallback ( DisplayEventCallback  event_callback)
inline

Member Data Documentation

◆ callback_from_streamer_

template<typename ProcessedFrameType >
GenerateProcessedFrameCallback cuttlefish::ScreenConnector< ProcessedFrameType >::callback_from_streamer_
private

◆ host_mode_ctrl_

template<typename ProcessedFrameType >
HostModeCtrl& cuttlefish::ScreenConnector< ProcessedFrameType >::host_mode_ctrl_
private

◆ on_next_frame_cnt_

template<typename ProcessedFrameType >
unsigned long long int cuttlefish::ScreenConnector< ProcessedFrameType >::on_next_frame_cnt_
private

◆ render_confui_cnt_

template<typename ProcessedFrameType >
unsigned long long int cuttlefish::ScreenConnector< ProcessedFrameType >::render_confui_cnt_
private

◆ sc_android_src_

template<typename ProcessedFrameType >
WaylandScreenConnector& cuttlefish::ScreenConnector< ProcessedFrameType >::sc_android_src_
private

◆ sc_frame_multiplexer_

template<typename ProcessedFrameType >
FrameMultiplexer cuttlefish::ScreenConnector< ProcessedFrameType >::sc_frame_multiplexer_
private

internally has conf ui & android queues.

multiplexting the two input queues, so the consumer gets one input at a time from the right queue

◆ streamer_callback_mutex_

template<typename ProcessedFrameType >
std::mutex cuttlefish::ScreenConnector< ProcessedFrameType >::streamer_callback_mutex_
private

◆ streamer_callback_set_cv_

template<typename ProcessedFrameType >
std::condition_variable cuttlefish::ScreenConnector< ProcessedFrameType >::streamer_callback_set_cv_
private

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