\hypertarget{classagora_1_1media_1_1_i_video_frame_observer}{}\doxysection{agora\+::media\+::I\+Video\+Frame\+Observer Class Reference}
\label{classagora_1_1media_1_1_i_video_frame_observer}\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}


{\ttfamily \#include $<$Agora\+Media\+Base.\+h$>$}

\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65}{V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+DE}} \{ \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65ac0338fc908faa61cc99587c6381d5829}{P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY}}, 
\mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65ae90137a3e8b393f7f6b7ab8488d854a8}{P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE}}
 \}
\begin{DoxyCompactList}\small\item\em The process mode of the video frame\+: \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_ae60399181e83d7e93ad759b2ab549b97}\label{classagora_1_1media_1_1_i_video_frame_observer_ae60399181e83d7e93ad759b2ab549b97}} 
typedef \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{media\+::base\+::\+Video\+Frame}} {\bfseries Video\+Frame}
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_ace896f8111e36f690d0132a7a5c2c603}{on\+Capture\+Video\+Frame}} (agora\+::rtc\+::\+V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE source\+Type, \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&video\+Frame)=0
\begin{DoxyCompactList}\small\item\em Occurs each time the S\+DK receives a video frame captured by local devices. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aabbf70d93e52f748b9c03d90a73fe65e}{on\+Pre\+Encode\+Video\+Frame}} (agora\+::rtc\+::\+V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE source\+Type, \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&video\+Frame)=0
\begin{DoxyCompactList}\small\item\em Occurs each time the S\+DK receives a video frame before encoding. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_a0b207e2905a273073f5b4592fa579136}{on\+Media\+Player\+Video\+Frame}} (\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&video\+Frame, int media\+Player\+Id)=0
\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_a55a50434efe819a3dcb74ffd0799b847}{on\+Render\+Video\+Frame}} (const char $\ast$channel\+Id, rtc\+::uid\+\_\+t remote\+Uid, \mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&video\+Frame)=0
\begin{DoxyCompactList}\small\item\em Occurs each time the S\+DK receives a video frame sent by the remote user. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_ad4c50b6e2052a1b656fdca43439c55cd}\label{classagora_1_1media_1_1_i_video_frame_observer_ad4c50b6e2052a1b656fdca43439c55cd}} 
virtual bool {\bfseries on\+Transcoded\+Video\+Frame} (\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&video\+Frame)=0
\item 
virtual \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65}{V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+DE}} \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_af147400f7477416724546852894bb7da}{get\+Video\+Frame\+Process\+Mode}} ()
\begin{DoxyCompactList}\small\item\em Occurs each time the S\+DK receives a video frame and prompts you to set the process mode of the video frame. \end{DoxyCompactList}\item 
virtual base\+::\+V\+I\+D\+E\+O\+\_\+\+P\+I\+X\+E\+L\+\_\+\+F\+O\+R\+M\+AT \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_abce7f145af45f90bfd8c9b0211c875db}{get\+Video\+Format\+Preference}} ()
\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_afd5bb439a9951a83f08d8c0a81468dcb}{get\+Rotation\+Applied}} ()
\begin{DoxyCompactList}\small\item\em Occurs each time the S\+DK receives a video frame, and prompts you whether to rotate the captured video. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_afc5cce81bf1c008e9335a0423ca45991}{get\+Mirror\+Applied}} ()
\begin{DoxyCompactList}\small\item\em Occurs each time the S\+DK receives a video frame and prompts you whether or not to mirror the captured video. \end{DoxyCompactList}\item 
virtual uint32\+\_\+t \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_ad4c174389264630ffb1b2d24c6030013}{get\+Observed\+Frame\+Position}} ()
\begin{DoxyCompactList}\small\item\em Sets the frame position for the video observer. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_a2d6db5dbead74855002812bac087c9e2}{is\+External}} ()
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer}{I\+Video\+Frame\+Observer}} class. 

\doxysubsection{Member Enumeration Documentation}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65}\label{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!VIDEO\_FRAME\_PROCESS\_MODE@{VIDEO\_FRAME\_PROCESS\_MODE}}
\index{VIDEO\_FRAME\_PROCESS\_MODE@{VIDEO\_FRAME\_PROCESS\_MODE}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{VIDEO\_FRAME\_PROCESS\_MODE}{VIDEO\_FRAME\_PROCESS\_MODE}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65}{agora\+::media\+::\+I\+Video\+Frame\+Observer\+::\+V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+DE}}}



The process mode of the video frame\+: 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{PROCESS\_MODE\_READ\_ONLY@{PROCESS\_MODE\_READ\_ONLY}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!PROCESS\_MODE\_READ\_ONLY@{PROCESS\_MODE\_READ\_ONLY}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65ac0338fc908faa61cc99587c6381d5829}\label{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65ac0338fc908faa61cc99587c6381d5829}} 
P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY&Read-\/only mode. In this mode, you do not modify the video frame. The video frame observer is a renderer. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{PROCESS\_MODE\_READ\_WRITE@{PROCESS\_MODE\_READ\_WRITE}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!PROCESS\_MODE\_READ\_WRITE@{PROCESS\_MODE\_READ\_WRITE}}}\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65ae90137a3e8b393f7f6b7ab8488d854a8}\label{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65ae90137a3e8b393f7f6b7ab8488d854a8}} 
P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE&Read and write mode. In this mode, you modify the video frame. The video frame observer is a video filter. \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_ace896f8111e36f690d0132a7a5c2c603}\label{classagora_1_1media_1_1_i_video_frame_observer_ace896f8111e36f690d0132a7a5c2c603}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!onCaptureVideoFrame@{onCaptureVideoFrame}}
\index{onCaptureVideoFrame@{onCaptureVideoFrame}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{onCaptureVideoFrame()}{onCaptureVideoFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::on\+Capture\+Video\+Frame (\begin{DoxyParamCaption}\item[{agora\+::rtc\+::\+V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE}]{source\+Type,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&}]{video\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Occurs each time the S\+DK receives a video frame captured by local devices. 

You can get raw video data collected by the local device through this callback and preprocess it as needed. Once the preprocessing is complete, you can directly modify {\ttfamily video\+Frame} in this callback, and set the return value to {\ttfamily true} to send the modified video data to the S\+DK. If you need to send the preprocessed data to the S\+DK, you need to call {\ttfamily get\+Video\+Frame\+Process\+Mode} first to set the video processing mode to read and write mode ( P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE ). Applicable scenarios\+: -\/ Preprocess the locally collected video data before it is processed by the S\+DK. For example, get video data through this callback and process it with filters, watermarks, cropping, rotation, etc.
\begin{DoxyItemize}
\item Get information about the locally collected video data before it is processed by the S\+DK. For example, the original width, height, frame rate of the video frame, etc. Call timing\+: After the successful registration of the video data observer, each time the S\+DK captures a video frame.
\end{DoxyItemize}

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item If the video data type you get is R\+G\+BA, the S\+DK does not support processing the data of the alpha channel.
\item It is recommended that you ensure the modified parameters in {\ttfamily video\+Frame} are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display. The default video format that you get from this callback is Y\+U\+V420. If you need other formats, you can set the expected data format in the get\+Video\+Format\+Preference callback.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em source\+Type} & Video source types, including cameras, screens, or media player. See {\ttfamily V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE}. \\
\hline
{\em video\+Frame} & The video frame. See {\ttfamily Video\+Frame}.Note\+: The default value of the video frame data format obtained through this callback is as follows\+:
\begin{DoxyItemize}
\item Android\+: I420 or R\+GB (G\+L\+E\+S20.\+G\+L\+\_\+\+T\+E\+X\+T\+U\+R\+E\+\_\+2D)
\item i\+OS\+: I420 or C\+V\+Pixel\+Buffer\+Ref
\item mac\+OS\+: I420 or C\+V\+Pixel\+Buffer\+Ref
\item Windows\+: Y\+U\+V420
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY}\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Reserved for future use.
\item {\ttfamily false}\+: Reserved for future use.
\end{DoxyItemize}
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE}\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Sets the S\+DK to receive the video frame.
\item {\ttfamily false}\+: Sets the S\+DK to discard the video frame. 
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_aabbf70d93e52f748b9c03d90a73fe65e}\label{classagora_1_1media_1_1_i_video_frame_observer_aabbf70d93e52f748b9c03d90a73fe65e}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!onPreEncodeVideoFrame@{onPreEncodeVideoFrame}}
\index{onPreEncodeVideoFrame@{onPreEncodeVideoFrame}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{onPreEncodeVideoFrame()}{onPreEncodeVideoFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::on\+Pre\+Encode\+Video\+Frame (\begin{DoxyParamCaption}\item[{agora\+::rtc\+::\+V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE}]{source\+Type,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&}]{video\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Occurs each time the S\+DK receives a video frame before encoding. 

After you successfully register the video frame observer, the S\+DK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios. After processing, you can send the processed video data back to the S\+DK in this callback.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item If you need to send the preprocessed data to the S\+DK, you need to call {\ttfamily get\+Video\+Frame\+Process\+Mode} first to set the video processing mode to read and write mode ( P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE ).
\item To get the video data captured from the second screen before encoding, you need to set {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+R\+E\+\_\+\+E\+N\+C\+O\+D\+ER} (1 $<$$<$ 2) as a frame position through {\ttfamily get\+Observed\+Frame\+Position}.
\item The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
\item It is recommended that you ensure the modified parameters in {\ttfamily video\+Frame} are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em source\+Type} & The type of the video source. See {\ttfamily V\+I\+D\+E\+O\+\_\+\+S\+O\+U\+R\+C\+E\+\_\+\+T\+Y\+PE}. \\
\hline
{\em video\+Frame} & The video frame. See {\ttfamily Video\+Frame}.Note\+: The default value of the video frame data format obtained through this callback is as follows\+:
\begin{DoxyItemize}
\item Android\+: I420 or R\+GB (G\+L\+E\+S20.\+G\+L\+\_\+\+T\+E\+X\+T\+U\+R\+E\+\_\+2D)
\item i\+OS\+: I420 or C\+V\+Pixel\+Buffer\+Ref
\item mac\+OS\+: I420 or C\+V\+Pixel\+Buffer\+Ref
\item Windows\+: Y\+U\+V420
\end{DoxyItemize}\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY}\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Reserved for future use.
\item {\ttfamily false}\+: Reserved for future use.
\end{DoxyItemize}
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE}\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Sets the S\+DK to receive the video frame.
\item {\ttfamily false}\+: Sets the S\+DK to discard the video frame. 
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_a0b207e2905a273073f5b4592fa579136}\label{classagora_1_1media_1_1_i_video_frame_observer_a0b207e2905a273073f5b4592fa579136}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!onMediaPlayerVideoFrame@{onMediaPlayerVideoFrame}}
\index{onMediaPlayerVideoFrame@{onMediaPlayerVideoFrame}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{onMediaPlayerVideoFrame()}{onMediaPlayerVideoFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::on\+Media\+Player\+Video\+Frame (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&}]{video\+Frame,  }\item[{int}]{media\+Player\+Id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Occurs each time the S\+DK receives a video frame decoded by the Media\+Player.

After you successfully register the video frame observer, the S\+DK triggers this callback each time a video frame is decoded. In this callback, you can get the video data decoded by the Media\+Player. You can then pre-\/process the data according to your scenarios.

After pre-\/processing, you can send the processed video data back to the S\+DK by setting the {\ttfamily video\+Frame} parameter in this callback.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item This callback will not be affected by the return values of \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_af147400f7477416724546852894bb7da}{get\+Video\+Frame\+Process\+Mode}}, \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_afd5bb439a9951a83f08d8c0a81468dcb}{get\+Rotation\+Applied}}, \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_afc5cce81bf1c008e9335a0423ca45991}{get\+Mirror\+Applied}}, \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_ad4c174389264630ffb1b2d24c6030013}{get\+Observed\+Frame\+Position}}.
\item On Android, this callback is not affected by the return value of \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_abce7f145af45f90bfd8c9b0211c875db}{get\+Video\+Format\+Preference}}
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em video\+Frame} & A pointer to the video frame\+: Video\+Frame \\
\hline
{\em media\+Player\+Id} & ID of the media\+Player. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Determines whether to ignore the current video frame if the pre-\/processing fails\+:
\begin{DoxyItemize}
\item true\+: Do not ignore.
\item false\+: Ignore, in which case this method does not sent the current video frame to the S\+DK. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_a55a50434efe819a3dcb74ffd0799b847}\label{classagora_1_1media_1_1_i_video_frame_observer_a55a50434efe819a3dcb74ffd0799b847}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!onRenderVideoFrame@{onRenderVideoFrame}}
\index{onRenderVideoFrame@{onRenderVideoFrame}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{onRenderVideoFrame()}{onRenderVideoFrame()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::on\+Render\+Video\+Frame (\begin{DoxyParamCaption}\item[{const char $\ast$}]{channel\+Id,  }\item[{rtc\+::uid\+\_\+t}]{remote\+Uid,  }\item[{\mbox{\hyperlink{structagora_1_1media_1_1base_1_1_video_frame}{Video\+Frame}} \&}]{video\+Frame }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Occurs each time the S\+DK receives a video frame sent by the remote user. 

After you successfully register the video frame observer, the S\+DK triggers this callback each time it receives a video frame. In this callback, you can get the video data sent from the remote end before rendering, and then process it according to the particular scenarios. The default video format that you get from this callback is Y\+U\+V420. If you need other formats, you can set the expected data format in the {\ttfamily get\+Video\+Format\+Preference} callback.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item If you need to send the preprocessed data to the S\+DK, you need to call {\ttfamily get\+Video\+Frame\+Process\+Mode} first to set the video processing mode to read and write mode ( P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE ).
\item If the video data type you get is R\+G\+BA, the S\+DK does not support processing the data of the alpha channel.
\item It is recommended that you ensure the modified parameters in {\ttfamily video\+Frame} are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display.
\end{DoxyItemize}
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em remote\+Uid} & The user ID of the remote user who sends the current video frame. \\
\hline
{\em video\+Frame} & The video frame. See {\ttfamily Video\+Frame}.Note\+: The default value of the video frame data format obtained through this callback is as follows\+:
\begin{DoxyItemize}
\item Android\+: I420 or R\+GB (G\+L\+E\+S20.\+G\+L\+\_\+\+T\+E\+X\+T\+U\+R\+E\+\_\+2D)
\item i\+OS\+: I420 or C\+V\+Pixel\+Buffer\+Ref
\item mac\+OS\+: I420 or C\+V\+Pixel\+Buffer\+Ref
\item Windows\+: Y\+U\+V420 
\end{DoxyItemize}\\
\hline
{\em channel\+Id} & The channel ID.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+O\+N\+LY}\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Reserved for future use.
\item {\ttfamily false}\+: Reserved for future use.
\end{DoxyItemize}
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE}\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Sets the S\+DK to receive the video frame.
\item {\ttfamily false}\+: Sets the S\+DK to discard the video frame. 
\end{DoxyItemize}
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_af147400f7477416724546852894bb7da}\label{classagora_1_1media_1_1_i_video_frame_observer_af147400f7477416724546852894bb7da}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!getVideoFrameProcessMode@{getVideoFrameProcessMode}}
\index{getVideoFrameProcessMode@{getVideoFrameProcessMode}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{getVideoFrameProcessMode()}{getVideoFrameProcessMode()}}
{\footnotesize\ttfamily virtual \mbox{\hyperlink{classagora_1_1media_1_1_i_video_frame_observer_aa0a690ef35d3813937a396d39ef74e65}{V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+DE}} agora\+::media\+::\+I\+Video\+Frame\+Observer\+::get\+Video\+Frame\+Process\+Mode (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Occurs each time the S\+DK receives a video frame and prompts you to set the process mode of the video frame. 

After you successfully register the video frame observer, the S\+DK triggers this callback each time it receives a video frame. You need to set your preferred process mode in the return value of this callback.

\begin{DoxyReturn}{Returns}
See {\ttfamily V\+I\+D\+E\+O\+\_\+\+F\+R\+A\+M\+E\+\_\+\+P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+DE}. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_abce7f145af45f90bfd8c9b0211c875db}\label{classagora_1_1media_1_1_i_video_frame_observer_abce7f145af45f90bfd8c9b0211c875db}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!getVideoFormatPreference@{getVideoFormatPreference}}
\index{getVideoFormatPreference@{getVideoFormatPreference}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{getVideoFormatPreference()}{getVideoFormatPreference()}}
{\footnotesize\ttfamily virtual base\+::\+V\+I\+D\+E\+O\+\_\+\+P\+I\+X\+E\+L\+\_\+\+F\+O\+R\+M\+AT agora\+::media\+::\+I\+Video\+Frame\+Observer\+::get\+Video\+Format\+Preference (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Sets the format of the raw video data output by the S\+DK.

If you want to get raw video data in a color encoding format other than Y\+UV 420, register this callback when calling {\ttfamily register\+Video\+Frame\+Observer}. After you successfully register the video frame observer, the S\+DK triggers this callback each time it receives a video frame. You need to set your preferred video data in the return value of this callback.

\begin{DoxyNote}{Note}
If you want the video captured by the sender to be the original format, set the original video data format to V\+I\+D\+E\+O\+\_\+\+P\+I\+X\+E\+L\+\_\+\+D\+E\+F\+A\+U\+LT in the return value. On different platforms, the original video pixel format is also different, for the actual video pixel format, see {\ttfamily Video\+Frame}.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Sets the video format. See V\+I\+D\+E\+O\+\_\+\+P\+I\+X\+E\+L\+\_\+\+F\+O\+R\+M\+AT. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_afd5bb439a9951a83f08d8c0a81468dcb}\label{classagora_1_1media_1_1_i_video_frame_observer_afd5bb439a9951a83f08d8c0a81468dcb}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!getRotationApplied@{getRotationApplied}}
\index{getRotationApplied@{getRotationApplied}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{getRotationApplied()}{getRotationApplied()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::get\+Rotation\+Applied (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Occurs each time the S\+DK receives a video frame, and prompts you whether to rotate the captured video. 

If you want to rotate the captured video according to the {\ttfamily rotation} member in the {\ttfamily Video\+Frame} class, ensure that you register this callback when calling {\ttfamily register\+Video\+Frame\+Observer}. After you successfully register the video frame observer, the S\+DK triggers this callback each time it receives a video frame. You need to set whether to rotate the video frame in the return value of this callback.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item On the Android platform, the supported video data formats for this callback are\+: I420, R\+G\+BA, and Texture.
\item On the Windows platform, the supported video data formats for this callback are\+: I420, R\+G\+BA, and Texture\+Buffer.
\item On the i\+OS platform, the supported video data formats for this callback are\+: I420, R\+G\+BA, and C\+V\+Pixel\+Buffer.
\item On the mac\+OS platform, the supported video data formats for this callback are\+: I420 and R\+G\+BA.
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Sets whether to rotate the captured video\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Rotate the captured video.
\item {\ttfamily false}\+: (Default) Do not rotate the captured video. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_afc5cce81bf1c008e9335a0423ca45991}\label{classagora_1_1media_1_1_i_video_frame_observer_afc5cce81bf1c008e9335a0423ca45991}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!getMirrorApplied@{getMirrorApplied}}
\index{getMirrorApplied@{getMirrorApplied}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{getMirrorApplied()}{getMirrorApplied()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::get\+Mirror\+Applied (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Occurs each time the S\+DK receives a video frame and prompts you whether or not to mirror the captured video. 

If the video data you want to obtain is a mirror image of the original video, you need to register this callback when calling {\ttfamily register\+Video\+Frame\+Observer}. After you successfully register the video frame observer, the S\+DK triggers this callback each time it receives a video frame. You need to set whether or not to mirror the video frame in the return value of this callback.

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item On the Android platform, the supported video data formats for this callback are\+: I420, R\+G\+BA, and Texture.
\item On the Windows platform, the supported video data formats for this callback are\+: I420, R\+G\+BA, and Texture\+Buffer.
\item On the i\+OS platform, the supported video data formats for this callback are\+: I420, R\+G\+BA, and C\+V\+Pixel\+Buffer.
\item On the mac\+OS platform, the supported video data formats for this callback are\+: I420 and R\+G\+BA.
\item Both this method and the {\ttfamily set\+Video\+Encoder\+Configuration} method support setting the mirroring effect. Agora recommends that you only choose one method to set it up. Using both methods at the same time causes the mirroring effect to overlap, and the mirroring settings fail.
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Sets whether or not to mirror the captured video\+:
\begin{DoxyItemize}
\item {\ttfamily true}\+: Mirror the captured video.
\item {\ttfamily false}\+: (Default) Do not mirror the captured video. 
\end{DoxyItemize}
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_ad4c174389264630ffb1b2d24c6030013}\label{classagora_1_1media_1_1_i_video_frame_observer_ad4c174389264630ffb1b2d24c6030013}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!getObservedFramePosition@{getObservedFramePosition}}
\index{getObservedFramePosition@{getObservedFramePosition}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{getObservedFramePosition()}{getObservedFramePosition()}}
{\footnotesize\ttfamily virtual uint32\+\_\+t agora\+::media\+::\+I\+Video\+Frame\+Observer\+::get\+Observed\+Frame\+Position (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Sets the frame position for the video observer. 

After successfully registering the video data observer, the S\+DK uses this callback to determine whether to trigger {\ttfamily on\+Capture\+Video\+Frame}, {\ttfamily on\+Render\+Video\+Frame} and {\ttfamily on\+Pre\+Encode\+Video\+Frame} callback at each specific video frame processing position, so that you can observe the locally collected video data, the video data sent by the remote end, and the video data before encoding. You can set one or more positions you need to observe by modifying the return value according to your scenario\+:
\begin{DoxyItemize}
\item {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+O\+S\+T\+\_\+\+C\+A\+P\+T\+U\+R\+ER} (1 $<$$<$ 0)\+: The position after capturing the video data, which corresponds to the {\ttfamily on\+Capture\+Video\+Frame} callback.
\item {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+R\+E\+\_\+\+R\+E\+N\+D\+E\+R\+ER} (1 $<$$<$ 1)\+: The position of the received remote video data before rendering, which corresponds to the {\ttfamily on\+Render\+Video\+Frame} callback.
\item {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+R\+E\+\_\+\+E\+N\+C\+O\+D\+ER} (1 $<$$<$ 2)\+: The position before encoding the video data, which corresponds to the {\ttfamily on\+Pre\+Encode\+Video\+Frame} callback.
\end{DoxyItemize}

\begin{DoxyNote}{Note}

\begin{DoxyItemize}
\item Use \textquotesingle{}$\vert$\textquotesingle{} (the OR operator) to observe multiple frame positions.
\item This callback observes {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+O\+S\+T\+\_\+\+C\+A\+P\+T\+U\+R\+ER} (1 $<$$<$ 0) and {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+R\+E\+\_\+\+R\+E\+N\+D\+E\+R\+ER} (1 $<$$<$ 1) by default.
\item To conserve system resources, you can reduce the number of frame positions that you want to observe.
\item When the video processing mode is {\ttfamily P\+R\+O\+C\+E\+S\+S\+\_\+\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D\+\_\+\+W\+R\+I\+TE} and the observation position is set to {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+R\+E\+\_\+\+E\+N\+C\+O\+D\+ER} $\vert$ {\ttfamily P\+O\+S\+I\+T\+I\+O\+N\+\_\+\+P\+O\+S\+T\+\_\+\+C\+A\+P\+T\+U\+R\+ER}, the {\ttfamily get\+Mirror\+Applied} does not take effect; you need to modify the video processing mode or the position of the observer.
\end{DoxyItemize}
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
A bit mask that controls the frame position of the video observer. See {\ttfamily V\+I\+D\+E\+O\+\_\+\+M\+O\+D\+U\+L\+E\+\_\+\+P\+O\+S\+I\+T\+I\+ON}. 
\end{DoxyReturn}
\mbox{\Hypertarget{classagora_1_1media_1_1_i_video_frame_observer_a2d6db5dbead74855002812bac087c9e2}\label{classagora_1_1media_1_1_i_video_frame_observer_a2d6db5dbead74855002812bac087c9e2}} 
\index{agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}!isExternal@{isExternal}}
\index{isExternal@{isExternal}!agora::media::IVideoFrameObserver@{agora::media::IVideoFrameObserver}}
\doxysubsubsection{\texorpdfstring{isExternal()}{isExternal()}}
{\footnotesize\ttfamily virtual bool agora\+::media\+::\+I\+Video\+Frame\+Observer\+::is\+External (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}

Indicate if the observer is for internal use. Note\+: Never override this function \begin{DoxyReturn}{Returns}

\begin{DoxyItemize}
\item true\+: the observer is for external use
\item false\+: the observer is for internal use 
\end{DoxyItemize}
\end{DoxyReturn}
