
{"id":11319,"date":"2024-08-01T09:34:00","date_gmt":"2024-08-01T09:34:00","guid":{"rendered":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/vendor_porting_guide\/westeros-sink-soc_module\/"},"modified":"2025-03-25T05:18:37","modified_gmt":"2025-03-25T05:18:37","slug":"westeros-sink-soc_module","status":"publish","type":"page","link":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/","title":{"rendered":"Westeros-sink-soc Module"},"content":{"rendered":"<div class=\"contentLayout2\">\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n<p>The Westeros Sink Soc module is a component of the Westeros project that is designed to work with various soc platforms. It provides a mechanism for rendering and displaying multimedia content on the target device. It<span> is responsible for interacting with the display hardware on the SoC platform, using the Direct Rendering Manager (DRM) module to access the graphics and multimedia resources. It provides a mechanism for displaying graphical content and video streams and also handles audio output through the audio subsystem on the target device.<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n<\/div>\n<\/div>\n<\/div>\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n\n\n<h2 class=\"wp-block-heading wp-main-header\">Public API&#8217;s Exposed<\/h2>\n\n\n<div class=\"table-wrap\">\n\n\n<table class=\"relative-table wrapped confluenceTable\"><colgroup class=\"\"><col class=\"\" style=\"width: 3.49436%;\"><col class=\"\" style=\"width: 39.405%;\"><col class=\"\" style=\"width: 9.34862%;\"><col class=\"\" style=\"width: 18.2606%;\"><col class=\"\" style=\"width: 29.5351%;\"><\/colgroup><tbody class=\"\"><tr class=\"\"><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Sl.<br>no.<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\"><p>API<\/p><\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Return Type<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Parameters<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Description<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">1<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_class_init<\/td><td colspan=\"1\" class=\"confluenceTd\">void<\/td><td colspan=\"1\" class=\"confluenceTd\">GstWesterosSinkClass *<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>It is a class initialization function that initializes the class structure and takes a pointer to the GstWesterosSinkClass structure as a parameter.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">2<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_init<\/td><td colspan=\"1\" class=\"confluenceTd\">gboolean<\/td><td colspan=\"1\" class=\"confluenceTd\">&nbsp;GstWesterosSink *<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>This function takes a pointer to the GstWesterosSink<\/span><span> object as a parameter, which represents the instance of the GstWesterosSink<\/span><span> that is being initialized. During initialization, the function sets up the hardware-specific state of the GstWesterosSink&nbsp;object,&nbsp;by setting up the underlying hardware resources needed for playback.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">3<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_term<\/td><td colspan=\"1\" class=\"confluenceTd\">void<\/td><td colspan=\"1\" class=\"confluenceTd\">GstWesterosSink *<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>It is responsible for cleaning up the hardware-specific state of the GstWesterosSink <\/span><span>object and freeing any resources that were allocated during the initialization process.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">4<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_set_property<\/td><td colspan=\"1\" class=\"confluenceTd\">void<\/td><td colspan=\"1\" class=\"confluenceTd\">GObject *<br>guint prop_id<br>const Gvalue *<br>GParamSpec *<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>It is a callback function that is called when a property of a GstWesterosSink<\/span><span> object is being set. It takes four parameters: a pointer to the GObject, an unsigned integer that represents the ID of the property that is being set, a pointer to a Gvalue that represents the new value of the property, and&nbsp;a pointer GParamSpec&nbsp;that represents the property specification.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">5<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_get_property<\/td><td colspan=\"1\" class=\"confluenceTd\">void<\/td><td colspan=\"1\" class=\"confluenceTd\">GObject *<br>guint prop_id<br>Gvalue *<br>GParamSpec *<\/td><td colspan=\"1\" class=\"confluenceTd\"><span> It is a callback function that is called when a property of a GstWesterosSink<\/span><span> object is being retrieved.&nbsp;<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">6<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_null_to_ready<\/td><td colspan=\"1\" class=\"confluenceTd\">gboolean<\/td><td colspan=\"1\" class=\"confluenceTd\">GstWesterosSink *<br>gboolean *passToDefault&nbsp;<\/td><td colspan=\"1\" class=\"confluenceTd\">This function<span> is called when the GstWesterosSink<\/span><span>&nbsp;object transitions from the null<\/span><span> state to the ready<\/span><span>&nbsp;state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">7<\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_ready_to_paused<\/td><td colspan=\"1\" class=\"confluenceTd\">gboolean<\/td><td colspan=\"1\" class=\"confluenceTd\">GstWesterosSink *sink, <br>gboolean *passToDefault<\/td><td colspan=\"1\" class=\"confluenceTd\">This function <span>is called when the GstWesterosSink <\/span><span>object transitions from the ready<\/span><span> state to the paused<\/span><span>&nbsp;state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">8<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_paused_to_playing<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>gboolean *passToDefault<\/td><td class=\"confluenceTd\">This function is called when the GstWesterosSink <span>object is transitioning from the paused to the playing state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">9<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_playing_to_paused<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink,<br>gboolean *passToDefault<\/td><td class=\"confluenceTd\">This function is called when the GstWesterosSink<span> object is transitioning from the playing to the paused state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">10<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_paused_to_ready<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>gboolean *passToDefault<\/td><td class=\"confluenceTd\">This function is called when the GstWesterosSink<span> object is transitioning from the paused to the ready state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">11<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_ready_to_null<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>gboolean *passToDefault<\/td><td class=\"confluenceTd\">This function is called when the GstWesterosSink<span> object is transitioning from the ready to the null state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">12<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_registryHandleGlobal<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink,<br>struct wl_registry *registry, uint32_t id,<br>const char *interface,<br>uint32_t version)<\/td><td class=\"confluenceTd\"><span>The function takes several parameters: a pointer to the GstWesterosSink instance, a pointer to the Wayland registry object, an ID for the new global object, the name of the interface, and its version. This function is a callback that is called when the Wayland registry receives a new global object. <\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">13<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_registryHandleGlobalRemove<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink,<br>struct wl_registry *registry,<br>uint32_t name<\/td><td class=\"confluenceTd\"><span>This function takes in a pointer to GstWesterosSink <\/span><span>structure, a pointer to the Wayland registry object, and the ID of the removed object. It is a callback that gets called when a global object is removed from the Wayland registry.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">14<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_accept_caps<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>GstCaps *caps<\/td><td class=\"confluenceTd\"><span> This function takes two parameters: a pointer to the GstWesterosSink<\/span><span> instance and a pointer to the caps to be checked. It returns a boolean value indicating whether the caps are supported by the GstWesterosSink<\/span><span>.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">15<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_set_startPTS<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>gint64 pts&nbsp;<\/td><td class=\"confluenceTd\"><span>This function<\/span><span> sets the start presentation time stamp (PTS) for the media pipeline of the given GstWesterosSink <\/span><span>instance. <\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">16<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_render<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>GstBuffer *buffer<\/td><td class=\"confluenceTd\"><span>This <\/span><span>function is responsible for rendering the video frames to the display and it takes a pointer to the GstWesterosSink<\/span><span> object and a pointer to the GstBuffer<\/span><span>&nbsp;containing the video frame data as input.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">17<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_flush<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink<\/td><td class=\"confluenceTd\"><span>This function<\/span><span> is used to reset and flush the state of the Westeros sink element. It is typically called when the pipeline is being reset or when there is a need to discard all buffered frames and start fresh.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">18<\/td><td class=\"confluenceTd\">ean gst_westeros_sink_soc_start_video<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink<\/td><td class=\"confluenceTd\"><span>This function is used to start the video playback in the Westeros sink. It returns a boolean indicating whether the start operation was successful.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">19<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_eos_event<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink<\/td><td class=\"confluenceTd\"><span>This function handles an end-of-stream (eos) event for the Westeros sink element and takes a pointer to the GstWesterosSink object as a parameter.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">20<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_set_video_path<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink,<br>&nbsp;bool useGfxPath<\/td><td class=\"confluenceTd\"><span>The function <\/span><span>is used to set the video path for a given GstWesterosSink<\/span><span> object. It takes a boolean argument useGFXPath<\/span><span>&nbsp;which indicates whether to use the graphics path or not.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">21<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_update_video_position<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink<\/td><td class=\"confluenceTd\"><span>This function updates the position and <\/span>size of the video display in the window.<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">22<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_query<\/td><td class=\"confluenceTd\">gboolean<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>GstQuery *query<\/td><td class=\"confluenceTd\"><span>This function<\/span><span> is a callback function that is used by GStreamer to handle queries related to the GstWesterosSink<\/span><span> element and takes a pointer to the GstQuery.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">23<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_set_compositor_lock<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>bool lock<\/td><td class=\"confluenceTd\"><span>This function takes a pointer to the GstWesterosSink and lock parameter, to set the compositor lock state.<\/span><\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">24<\/td><td class=\"confluenceTd\">gst_westeros_sink_soc_set_speed<\/td><td class=\"confluenceTd\">void<\/td><td class=\"confluenceTd\">GstWesterosSink *sink, <br>const GValue *value<\/td><td class=\"confluenceTd\"><span>This function takes a pointer to the GstWesterosSink and a pointer to the GValue, to set the playback speed of a video to the specified value.<\/span><\/td><\/tr><\/tbody><\/table>\n\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n\n\n<h2 class=\"wp-block-heading wp-main-header\">Events exposed<\/h2>\n\n\n<div class=\"table-wrap\">\n\n\n<table class=\"relative-table wrapped confluenceTable\"><colgroup class=\"\"><col class=\"\" style=\"width: 2.94118%;\"><col class=\"\" style=\"width: 15.5178%;\"><col class=\"\" style=\"width: 12.5758%;\"><col class=\"\" style=\"width: 13.0905%;\"><col class=\"\" style=\"width: 16.8582%;\"><col class=\"\" style=\"width: 18.9009%;\"><col class=\"\" style=\"width: 20.1547%;\"><\/colgroup><tbody class=\"\"><tr class=\"\"><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\"><p>Sl.<\/p><p>no.<\/p><\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Signal<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\"><p>Event<\/p><\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Description<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Signal Emit Function Name<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Signal Emit Conditions<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">How to use this signal from the Application<\/td><\/tr><tr class=\"\"><td rowspan=\"3\" class=\"confluenceTd\">1<br><br><\/td><td rowspan=\"3\" class=\"confluenceTd\">SIGNAL_FIRSTFRAME<br><br><\/td><td rowspan=\"3\" class=\"confluenceTd\">first-video-frame-callback<br><br><\/td><td rowspan=\"3\" class=\"confluenceTd\"><span>The signal emitted by this API will be emitted when the first video frame is ready and available for processing.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_render<\/td><td rowspan=\"3\" class=\"confluenceTd\"><p>1. when gst_westeros_sink_soc_init() is called, the sink calls on the display function, with that to generate the first frame thread it checks if the sink is not NULL, the signal is called.<br>2. when the gst_westeros_sink_soc_start_video() is called, with the capture_start event, a no. of functions are called to check the condition and collect data related to buffer, plane and get frame-related data like frame rate, frame size, frame-width, frame height, under this condition: sink-&gt;soc.emitFirstFrameSignal is set to TRUE; signal is called.<\/p><\/td><td rowspan=\"3\" class=\"confluenceTd\">g_signal_connect (decoder_instance, &#8220;first-video-frame-callback&#8221;, G_CALLBACK(callback_fnc), Callback_fnc_data)<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_start_video<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_init<\/td><\/tr><tr class=\"\"><td rowspan=\"2\" class=\"confluenceTd\">2<\/td><td rowspan=\"2\" class=\"confluenceTd\">SIGNAL_UNDERFLOW<\/td><td rowspan=\"2\" class=\"confluenceTd\">buffer-underflow-callback<\/td><td rowspan=\"2\" class=\"confluenceTd\"><span>The signal emitted by this API will be emitted when there is a buffer underflow condition in the element. <\/span>A buffer underflow occurs when the element is unable to produce or process data quickly enough to keep up with the data flow rate, resulting in a depletion of the buffer. When it happens, this signal is<span>&nbsp;emitted.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_start_video<\/td><td rowspan=\"2\" class=\"confluenceTd\"><span>1. when the gst_westeros_sink_soc_start_video() is called, with the capture_start event, a no. of functions is called to check the condition and collect data related to buffer, plane and get frame-related data like frame rate, frame size, frame width, frame height, under this condition: sink-&gt;soc.emitUnderflowSignal is set to TRUE; signal is called.<\/span><\/td><td rowspan=\"2\" class=\"confluenceTd\">g_signal_connect (decoder_instance, &#8220;buffer-underflow-callback&#8221;, G_CALLBACK(callback_fnc), Callback_fnc_data)<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_render<\/td><\/tr><tr class=\"\"><td rowspan=\"3\" class=\"confluenceTd\">3<br><br><\/td><td rowspan=\"3\" class=\"confluenceTd\">SIGNAL_NEWTEXTURE<br><br><\/td><td rowspan=\"3\" class=\"confluenceTd\">new-video-texture-callback<br><br><\/td><td rowspan=\"3\" class=\"confluenceTd\"><span>The signal emitted by this API will be emitted when a new video texture is ready and available for processing. T<span>he callback function associated with this signal may need to parse and interpret the various arguments in order to properly process the new video texture data related to the video texture format, dimensions, and planes.<\/span><\/span><\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_start_video<\/td><td rowspan=\"3\" class=\"confluenceTd\"><p>1. This signal is emitted when a new texture is ready to be displayed by the video sink. Various parameters are passed based on whether the texture is multi-planar or not and sets the appropriate values for the file descriptor, length, stride, and pointer of each plane of the texture buffer.<br>2. It can also be emitted when westeros_sink_dispatch event comes into play and sink-&gt;soc.enableTextureSignal is called.<\/p><\/td><td rowspan=\"3\" class=\"confluenceTd\">g_signal_connect (decoder_instance, &#8220;new-video-texture-callback&#8221;, G_CALLBACK(callback_fnc), Callback_fnc_data)<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_render<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_init<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">4<\/td><td colspan=\"1\" class=\"confluenceTd\">SIGNAL_DECODEERROR<\/td><td colspan=\"1\" class=\"confluenceTd\">decode-error-callback<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>The signal emitted by this API will be emitted when there is a decoding error in the element. <span>A decoding error occurs when the element is unable to decode the input data stream properly, resulting in a failure to produce valid output data. When this happens, this signal<\/span><span>&nbsp;is emitted.<\/span><\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><br><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>1. This signal can be emitted under the conditions where if the video decoder captures any error related to video decoding status and any respective flag is set, this signal can be generated and to further handle the decode errors.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\">g_signal_connect (decoder_instance, &#8220;decode-error-callback&#8221;, G_CALLBACK(callback_fnc), Callback_fnc_data)<\/td><\/tr><tr class=\"\"><td rowspan=\"2\" class=\"confluenceTd\">5<\/td><td rowspan=\"2\" class=\"confluenceTd\">SIGNAL_TIMECODE<\/td><td rowspan=\"2\" class=\"confluenceTd\">timecode-callback<\/td><td rowspan=\"2\" class=\"confluenceTd\"><span>The signal emitted by this API will be emitted when a new timecode is available. It <span>is used to indicate the current timecode of the media being processed by the element which can be helpful in synchronizing multiple elements.<\/span><\/span><\/td><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_start_video<\/td><td rowspan=\"2\" class=\"confluenceTd\"><p>1. This signal can be emitted under the condition that if a set position from the frame currently is being presented by the video server<br>2. This signal can be emitted under another condition that if any video status message is received from the video server related to if timecode is present where the message may contain the presentation timestamp of frames being displayed, this information can help to process messages in video synchronisation or video client connection.<\/p><\/td><td rowspan=\"2\" class=\"confluenceTd\">g_signal_connect (decoder_instance, &#8220;timecode-callback&#8221;, G_CALLBACK(callback_fnc), Callback_fnc_data)<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">gst_westeros_sink_soc_render<\/td><\/tr><\/tbody><\/table>\n\n\n<\/div>\n<p><span>&nbsp;<\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n\n\n<h2 class=\"wp-block-heading wp-main-header\">V4L2 IOCTL for SOC Implementation<\/h2>\n\n\n<div class=\"table-wrap\">\n\n\n<table class=\"relative-table wrapped confluenceTable\"><colgroup class=\"\"><col class=\"\" style=\"width: 2.84321%;\"><col class=\"\" style=\"width: 11.1371%;\"><col class=\"\" style=\"width: 6.65968%;\"><col class=\"\" style=\"width: 41.5418%;\"><col class=\"\" style=\"width: 28.5666%;\"><col class=\"\" style=\"width: 9.26645%;\"><\/colgroup><tbody class=\"\"><tr class=\"\"><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\"><p>Sl.<\/p><p>no.<\/p><\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">IOCTL Call<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">About<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\"><p>Description<\/p><\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">Synopsis<\/td><td class=\"highlight-grey confluenceTd\" colspan=\"1\" data-highlight-colour=\"grey\">IOCTL Definition file<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">1<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>VIDIOC_QUERYCAP<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Query device capabilities<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>All V4L2 devices support the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_QUERYCAP<\/span><\/code><span><span>&nbsp;<\/span>ioctl. It is used to identify kernel devices compatible with this specification and to obtain information about driver and hardware capabilities. The ioctl takes a pointer to a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-querycap.html#v4l2-capability\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_capability<\/span><\/a><span><span>&nbsp;<\/span>which is filled by the driver. When the driver is not compatible with this specification the ioctl returns an<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>error code.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-querycap.html#_CPPv25ioctliiP15v4l2_capability\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-querycap.html#_CPPv25ioctliiP15v4l2_capability<\/a><\/td><td colspan=\"1\" class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">2<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>VIDIOC_ENUM_FMT<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Enumerate image formats<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>To enumerate image formats applications initialize the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>and<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">index<\/span><\/code><span><span>&nbsp;<\/span>field of struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-fmt.html#v4l2-fmtdesc\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_fmtdesc<\/span><\/a><span><span>&nbsp;<\/span>and call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-fmt.html#vidioc-enum-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_ENUM_FMT<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to this structure. Drivers fill the rest of the structure or return an<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>error code. All formats are enumerable by beginning at index zero and incrementing by one until<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>is returned.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-fmt.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-fmt.html<\/a><\/td><td colspan=\"1\" class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">3<\/td><td colspan=\"1\" class=\"confluenceTd\">VIDIOC_G_FMT<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Get the data format (typically image format) exchanged b\/w driver &amp; application.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>To query the current parameters applications set the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>field of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#v4l2-format\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_format<\/span><\/a><span><span>&nbsp;<\/span>to the respective buffer (stream) type. For example, video capture devices use<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_TYPE_VIDEO_CAPTURE<\/span><\/code><span><span>&nbsp;<\/span>or<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE<\/span><\/code><span>. When the application calls the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_FMT<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to this structure the driver fills the respective member of the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">fmt<\/span><\/code><span><span>&nbsp;<\/span>union. <\/span><span>When the requested buffer type is not supported drivers return an<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>error code.<\/span><\/td><td colspan=\"1\" class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html<\/a><\/td><td colspan=\"1\" class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">4<\/td><td class=\"confluenceTd\">VIDIOC_S_FMT<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Set the data format (typically image format) exchanged b\/w driver &amp; application<\/span><\/td><td class=\"confluenceTd\"><span>When the application calls the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_FMT<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to a<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#v4l2-format\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_format<\/span><\/a><span><span> <\/span>structure the driver checks and adjusts the parameters against hardware abilities. Drivers should not return an error code unless the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>field is invalid, this is a mechanism to fathom device capabilities and to approach parameters acceptable for both the application and driver. On success, the driver may program the hardware, allocate resources, and generally prepare for data exchange. Finally, the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_FMT<\/span><\/a><span><span>&nbsp;<\/span>ioctl returns the current format parameters as<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_FMT<\/span><\/a><span><span>&nbsp;<\/span>does.<span>&nbsp;<\/span><\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">5<\/td><td class=\"confluenceTd\">VIDIOC_REQBUFS<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Initiate Memory Mapping, User Pointer I\/O or DMA buffer I\/O<\/span><\/td><td class=\"confluenceTd\"><span>To allocate device buffers applications initialize all fields of the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#v4l2-requestbuffers\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_requestbuffers<\/span><\/a> <span>structure. They set the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>field to the respective stream or buffer type, the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code><span><span>&nbsp;<\/span>field to the desired number of buffers,<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">memory<\/span><\/code><span><span>&nbsp;<\/span>must be set to the requested I\/O method and the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">reserved<\/span><\/code><span><span>&nbsp;<\/span>array must be zeroed. When the ioctl is called with a pointer to this structure the driver will attempt to allocate the requested number of buffers and it stores the actual number allocated in the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code><span><span>&nbsp;<\/span>field.<span> <\/span><\/span>For example, video output requires at least two buffers, one displayed and one filled by the application. When the I\/O method is not supported the ioctl returns an<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span>&nbsp;<\/span><span>error code.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">6<\/td><td class=\"confluenceTd\">VIDIOC_QUERYBUF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Query the status of a buffer.<\/span><\/td><td class=\"confluenceTd\"><span>Applications set the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>field of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/buffer.html#v4l2-buffer\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_buffer<\/span><\/a><span><span>&nbsp;<\/span>to the same buffer type as was previously used with struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#v4l2-format\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_format<\/span><\/a><span><span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>and struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#v4l2-requestbuffers\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_requestbuffers<\/span><\/a><span><span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span>, and the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">index<\/span><\/code><span><span>&nbsp;<\/span>field. Valid index numbers range from zero to the number of buffers allocated with<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#vidioc-reqbufs\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_REQBUFS<\/span><\/a><span><span>&nbsp;<\/span>(struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#v4l2-requestbuffers\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_requestbuffers<\/span><\/a><span><span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code><span>) minus one. The<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">reserved<\/span><\/code><span><span>&nbsp;<\/span>and<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">reserved2<\/span><\/code><span><span>&nbsp;<\/span>fields must be set to 0.<span>&nbsp;<\/span><\/span><span>After calling<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-querybuf.html#vidioc-querybuf\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_QUERYBUF<\/span><\/a><span><span>&nbsp;<\/span>with a pointer to this structure drivers return an error code or fill the rest of the structure.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-querybuf.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-querybuf.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">7<\/td><td class=\"confluenceTd\">VIDIOC_G_FBUF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Get frame buffer overlay parameters.<\/span><\/td><td class=\"confluenceTd\"><span>To get the current parameters applications call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html#vidioc-g-fbuf\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_FBUF<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to a<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html#v4l2-framebuffer\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_framebuffer<\/span><\/a><span><span>&nbsp;<\/span>structure. The driver fills all fields of the structure or returns an EINVAL error code when overlays are not supported.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">8<\/td><td class=\"confluenceTd\">VIDIOC_S_FBUF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Set frame buffer overlay parameters.<\/span><\/td><td class=\"confluenceTd\"><p><span>To set the parameters for a<span>&nbsp;<\/span><\/span><em>Video Output Overlay<\/em><span>, applications must initialize the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">flags <\/span><\/code><span>field of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html#v4l2-framebuffer\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_framebuffer<\/span><\/a><span>. Since the framebuffer is implemented on the TV card all other parameters are determined by the driver. When an application calls <\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html#vidioc-g-fbuf\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_FBUF<\/span><\/a><span><span>&nbsp;<\/span>with a pointer to this structure, the driver prepares for the overlay and returns the framebuffer parameters as<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html#vidioc-g-fbuf\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_FBUF<\/span><\/a><span><span>&nbsp;<\/span>does, or it returns an error code.&nbsp;<\/span><\/p><p><span>To set the parameters for a<span>&nbsp;<\/span><em>non-destructive Video Overlay<\/em>, applications must initialize the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">flags<\/span><\/code><span>&nbsp;<\/span>field, the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">fmt<\/span><\/code><span>&nbsp;<\/span>substructure, and call<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html#vidioc-g-fbuf\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_FBUF<\/span><\/a>.<span>&nbsp;<\/span><\/span><\/p><p><span><span>For a&nbsp;<em>destructive Video Overlay<\/em>&nbsp;applications must additionally provide a&nbsp;<code class=\"docutils literal\"><span class=\"pre\">base<\/span><\/code>&nbsp;address.&nbsp;<\/span><\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fbuf.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">9<\/td><td class=\"confluenceTd\">VIDIOC_OVERLAY<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Start or stop video overlay<\/span><\/td><td class=\"confluenceTd\"><p>This ioctl is part of the<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/dev-overlay.html#overlay\" rel=\"nofollow\"><span class=\"std std-ref\">video overlay<\/span><\/a><span>&nbsp;<\/span>I\/O method. Applications call<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-overlay.html#vidioc-overlay\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_OVERLAY<\/span><\/a> to start or stop the overlay. It takes a pointer to an integer which must be set to zero by the application to stop overlay, to one to start. <span>Drivers do not support <\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-streamon.html#vidioc-streamon\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF<\/span><\/a> <span>or <\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-streamon.html#vidioc-streamon\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_STREAMOFF<\/span><\/a> <span>with <\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_TYPE_VIDEO_OVERLAY<\/span><\/code><span>.&nbsp;&nbsp;<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-overlay.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-overlay.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">10<\/td><td class=\"confluenceTd\">VIDIOC_QBUF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Exchange a buffer with the driver<\/span><\/td><td class=\"confluenceTd\"><p><span>Applications call the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_QBUF<\/span><\/code><span><span>&nbsp;<\/span>ioctl to enqueue an empty (capturing) or filled (output) buffer in the driver\u2019s incoming queue. The semantics depend on the selected I\/O method. <\/span><\/p><p><span>To enqueue a<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/mmap.html#mmap\" rel=\"nofollow\"><span class=\"std std-ref\">memory mapped<\/span><\/a><span>&nbsp;<\/span>buffer applications set the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">memory<\/span><\/code><span>&nbsp;<\/span>field to <code class=\"docutils literal\"><span class=\"pre\">V4L2_MEMORY_MMAP<\/span><\/code>. When<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_QBUF<\/span><\/code><span>&nbsp;<\/span>is called with a pointer to this structure the driver sets the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_FLAG_MAPPED<\/span><\/code><span>&nbsp;<\/span>and<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_FLAG_QUEUED<\/span><\/code><span>&nbsp;<\/span>flags and clears the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_FLAG_DONE<\/span><\/code><span>&nbsp;<\/span>flag in the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">flags<\/span><\/code><span>&nbsp;<\/span>field, or it returns an EINVAL error code.<\/span><\/p><p><span>To enqueue a<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/userp.html#userp\" rel=\"nofollow\"><span class=\"std std-ref\">user pointer<\/span><\/a><span>&nbsp;<\/span>buffer applications set the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">memory<\/span><\/code><span>&nbsp;<\/span>field to <code class=\"docutils literal\"><span class=\"pre\">V4L2_MEMORY_USERPTR<\/span><\/code>, the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">m.userptr<\/span><\/code><span>&nbsp;<\/span>field to the address of the buffer and <code class=\"docutils literal\"><span class=\"pre\">length<\/span><\/code><span>&nbsp;<\/span>to its size. <\/span><span>To enqueue a<\/span><span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/dmabuf.html#dmabuf\" rel=\"nofollow\"><span class=\"std std-ref\">DMABUF<\/span><\/a><span>&nbsp;<\/span><span>buffer applications set the<\/span><span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">memory<\/span><\/code><span>&nbsp;<\/span><span>field to <\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_MEMORY_DMABUF<\/span><\/code><span> &amp;<\/span><span> <\/span><code class=\"docutils literal\"><span class=\"pre\">m.fd<\/span><\/code><span>&nbsp;<\/span><span>field to file descriptor associated with a DMABUF buffer.<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-qbuf.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-qbuf.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">11<\/td><td class=\"confluenceTd\">VIDIOC_EXPBUF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Export a buffer as a DMABUF file descriptor<\/span><\/td><td class=\"confluenceTd\"><p><span>This ioctl is an extension to the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/mmap.html#mmap\" rel=\"nofollow\"><span class=\"std std-ref\">memory mapping<\/span><\/a><span><span>&nbsp;<\/span>I\/O method, hence it is available only for <\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_MEMORY_MMAP<\/span><\/code><span><span>&nbsp;<\/span>buffers.<span> To export a buffer, applications fill struct <span class=\"std std-ref\">v4l2_exportbuffer<\/span>. The <code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code> field is set to the same buffer type as was previously used with struct <a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#v4l2-requestbuffers\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_requestbuffers<\/span><\/a>&nbsp;<code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code>. Applications must also set the&nbsp;<code class=\"docutils literal\"><span class=\"pre\">index<\/span><\/code>&nbsp;field. Valid index numbers range from zero to the number of buffers allocated with&nbsp;<a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#vidioc-reqbufs\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_REQBUFS<\/span><\/a> (struct <a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#v4l2-requestbuffers\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_requestbuffers<\/span><\/a>&nbsp;<code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code>) minus one. Additional flags may be posted in the <code class=\"docutils literal\"><span class=\"pre\">flags<\/span><\/code>&nbsp;field. After calling&nbsp;<a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-expbuf.html#vidioc-expbuf\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_EXPBUF<\/span><\/a>&nbsp;the&nbsp;<code class=\"docutils literal\"><span class=\"pre\">fd<\/span><\/code>&nbsp;field will be set by a driver.&nbsp;<\/span><\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-expbuf.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-expbuf.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">12<\/td><td class=\"confluenceTd\">VIDIOC_DQBUF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Exchange a buffer with the driver<\/span><\/td><td class=\"confluenceTd\"><p><span>Applications call the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_DQBUF<\/span><\/code><span><span>&nbsp;<\/span>ioctl to dequeue a filled (capturing) or displayed (output) buffer from the driver\u2019s outgoing queue. They just set the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span>,<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">memory<\/span><\/code><span><span> <\/span>and <\/span><code class=\"docutils literal\"><span class=\"pre\">reserved<\/span><\/code><span><span>&nbsp;<\/span>fields of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/buffer.html#v4l2-buffer\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_buffer<\/span><\/a><span><span>&nbsp;<\/span>as above, when <\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_DQBUF<\/span><\/code><span><span>&nbsp;<\/span>is called with a pointer to this structure the driver fills the remaining fields or returns an error code. The driver may also set<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_BUF_FLAG_ERROR<\/span><\/code><span><span>&nbsp;<\/span>in the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">flags<\/span><\/code><span><span>&nbsp;<\/span>field. <\/span><span>By default, <\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_DQBUF<\/span><\/code><span>&nbsp;<\/span><span>blocks when no buffer is in the outgoing queue.&nbsp;<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-qbuf.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-qbuf.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">13<\/td><td class=\"confluenceTd\">VIDIOC_STREAMON<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Start streaming I\/O<\/span><\/td><td class=\"confluenceTd\"><p>This <span>ioctl start the capture or output process during streaming (<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/mmap.html#mmap\" rel=\"nofollow\"><span class=\"std std-ref\">memory mapping<\/span><\/a><span>,<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/userp.html#userp\" rel=\"nofollow\"><span class=\"std std-ref\">user pointer<\/span><\/a><span><span>&nbsp;<\/span>or<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/dmabuf.html#dmabuf\" rel=\"nofollow\"><span class=\"std std-ref\">DMABUF<\/span><\/a><span>) I\/O.<\/span><\/p><p>Capture hardware is disabled and no input buffers are filled (if there are any empty buffers in the incoming queue) until<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_STREAMON<\/span><\/code><span>&nbsp;<\/span>has been called. Output hardware is disabled and no video signal is produced until<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_STREAMON<\/span><\/code><span>&nbsp;<\/span>has been called. The ioctl will succeed when at least one output buffer is in the incoming queue. <span>Memory-to-memory devices will not start until<\/span><span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_STREAMON<\/span><\/code><span>&nbsp;<\/span><span>has been called for both the capture and output stream types.<\/span><\/p><p>If<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_STREAMON<\/span><\/code><span>&nbsp;<\/span>fails, then any already queued buffers will remain queued.<\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-streamon.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-streamon.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">14<\/td><td class=\"confluenceTd\">VIDIOC_STREAMOFF<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Stop streaming I\/O<\/span><\/td><td class=\"confluenceTd\"><span>The<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_STREAMOFF<\/span><\/code><span><span>&nbsp;<\/span>ioctl, apart from aborting or finishing any DMA in progress, unlocks any user pointer buffers locked in physical memory, and it removes all buffers from the incoming and outgoing queues. That means all images captured but not dequeued yet will be lost, likewise, all images enqueued for output but not transmitted yet. I\/O returns to the same state as after calling<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#vidioc-reqbufs\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_REQBUFS<\/span><\/a><span><span>&nbsp;<\/span>and can be restarted accordingly.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-streamon.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-streamon.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">15<\/td><td class=\"confluenceTd\">VIDIOC_G_PARM<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Get streaming parameters.<\/span><\/td><td class=\"confluenceTd\"><p>The current video standard determines a nominal number of frames per second. If less than this number of frames is to be captured or output, applications can request frame skipping or duplicating on the driver side. This is especially useful when using the<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/func-read.html#func-read\" rel=\"nofollow\"><span class=\"std std-ref\">read()<\/span><\/a> or<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/func-write.html#func-write\" rel=\"nofollow\"><span class=\"std std-ref\">write()<\/span><\/a>, which are not augmented by timestamps or sequence counters, and to avoid unnecessary data&nbsp;<span>copying. Further, get\/set can be used to determine the number of buffers used internally by a driver in read\/write mode. For implications see the section discussing the<\/span><span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/func-read.html#func-read\" rel=\"nofollow\"><span class=\"std std-ref\">read()<\/span><\/a><span>&nbsp;<\/span><span>function.<\/span><\/p><p><span>To get the streaming parameters applications call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html#vidioc-g-parm\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_PARM<\/span><\/a><span><span>&nbsp;<\/span>ioctl. It takes a pointer to a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html#v4l2-streamparm\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_streamparm<\/span><\/a><span><span>&nbsp;<\/span>which contains a union holding separate parameters for input and output devices.<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">16<\/td><td class=\"confluenceTd\">VIDIOC_S_PARM<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Set streaming parameters.<\/span><\/td><td class=\"confluenceTd\"><span>To set the streaming parameters applications call the<span> <a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html#vidioc-g-parm\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_PARM<\/span><\/a><\/span><\/span><span><span>&nbsp;<\/span>ioctl. It takes a pointer to a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html#v4l2-streamparm\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_streamparm<\/span><\/a><span><span>&nbsp;<\/span>which contains a union holding separate parameters for input and output devices.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-parm.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">17<\/td><td class=\"confluenceTd\">VIDIOC_G_STD<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Query the video standard of the current input<\/span><\/td><td class=\"confluenceTd\"><p><span>It takes a pointer to a<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-std-id\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_std_id<\/span><\/a><span><span>&nbsp;<\/span>type as an argument.<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html#vidioc-g-std\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_STD<\/span><\/a><span><span>&nbsp;<\/span>can return a single flag or a set of flags as in the struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-standard\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_standard<\/span><\/a><span><span>&nbsp;<\/span>field<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span>. The flags must be unambiguous such that they appear in only one enumerated<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-standard\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_standard<\/span><\/a><span><span>&nbsp;<\/span>structure.<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">18<\/td><td class=\"confluenceTd\">VIDIOC_S_STD<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Select the video standard of the current input.<\/span><\/td><td class=\"confluenceTd\"><p><span>It takes a pointer to a<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-std-id\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_std_id<\/span><\/a><span><span>&nbsp;<\/span>type as an argument.<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html#vidioc-g-std\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_STD<\/span><\/a><span><span>&nbsp;<\/span>can return a single flag or a set of flags as in the struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-standard\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_standard<\/span><\/a><span><span>&nbsp;<\/span>field<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span>. The flags must be unambiguous such that they appear in only one enumerated<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-standard\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_standard<\/span><\/a><span><span>&nbsp;<\/span>structure.<\/span><\/p><p><span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html#vidioc-g-std\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_STD<\/span><\/a><span>&nbsp;<\/span>accepts one or more flags, being a write-only ioctl it does not return the actual new standard as<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html#vidioc-g-std\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_STD<\/span><\/a><span>&nbsp;<\/span>does.<span>&nbsp;<\/span><\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-std.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">19<\/td><td class=\"confluenceTd\">VIDIOC_ENUMSTD<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Enumerate supported video standards<\/span><\/td><td class=\"confluenceTd\"><span>To query the attributes of a video standard, especially a custom (driver-defined) one, applications initialize the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">index<\/span><\/code><span><span>&nbsp;<\/span>field of struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#v4l2-standard\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_standard<\/span><\/a><span><span>&nbsp;<\/span>and call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html#vidioc-enumstd\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_ENUMSTD<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to this structure. Drivers fill the rest of the structure or return an<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>error code when the index is out of bounds. To enumerate all standards applications shall begin at index zero, incrementing by one until the driver returns<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span>. Drivers may enumerate a different set of standards after switching the video input or output.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enumstd.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">20<\/td><td class=\"confluenceTd\">VIDIOC_ENUMINPUT<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Enumerate video inputs<\/span><\/td><td class=\"confluenceTd\"><span>To query the attributes of a video input application initialize the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">index<\/span><\/code><span><span>&nbsp;<\/span>field of struct <\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enuminput.html#v4l2-input\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_input<\/span><\/a><span><span>&nbsp;<\/span>and call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enuminput.html#vidioc-enuminput\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_ENUMINPUT<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to this structure. Drivers fill the rest of the structure or return an<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>error code when the index is out of bounds. To enumerate all inputs applications shall begin at index zero, incrementing by one until the driver returns<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span>.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enuminput.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enuminput.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">21<\/td><td class=\"confluenceTd\">VIDIOC_G_CTRL<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Get the value of a control.<\/span><\/td><td class=\"confluenceTd\"><span>To get the current value of control applications initialize the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span><span>&nbsp;<\/span>field of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html#v4l2-control\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_control<\/span><\/a><span><span>&nbsp;<\/span>and call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html#vidioc-g-ctrl\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_G_CTRL<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to this structure. Works only with user controls.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">22<\/td><td class=\"confluenceTd\">VIDIOC_S_CTRL<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Set the value of a control.<\/span><\/td><td class=\"confluenceTd\"><span>To change the value of a control applications, initialize the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span><span>&nbsp;<\/span>and<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">value<\/span><\/code><span><span>&nbsp;<\/span>fields of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html#v4l2-control\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_control<\/span><\/a><span><span>&nbsp;<\/span>and call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html#vidioc-g-ctrl\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_CTRL<\/span><\/a><span><span>&nbsp;<\/span>ioctl.<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html#vidioc-g-ctrl\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_CTRL<\/span><\/a><span>&nbsp;<\/span>is a write-only ioctl, it does not return the actual new value. Works only with user controls.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-ctrl.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">23<\/td><td class=\"confluenceTd\">VIDIOC_QUERYCTRL<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Enumerate controls<\/span><\/td><td class=\"confluenceTd\"><span>To query the attributes of a control applications set the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span><span>&nbsp;<\/span>field of a struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-queryctrl.html#v4l2-queryctrl\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_queryctrl<\/span><\/a><span><span>&nbsp;<\/span>and call the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_QUERYCTRL<\/span><\/code><span><span>&nbsp;<\/span>ioctl with a pointer to this structure. The driver fills the rest of the structure or returns an<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span><span>&nbsp;<\/span>error code when the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span><span>&nbsp;<\/span>is invalid. It is possible to enumerate controls by calling<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">VIDIOC_QUERYCTRL<\/span><\/code><span>&nbsp;<\/span>with successive<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">id<\/span><\/code><span>&nbsp;<\/span>values starting from<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">V4L2_CID_BASE<\/span><\/code><span>&nbsp;<\/span>up to and exclusive <code class=\"docutils literal\"><span class=\"pre\">V4L2_CID_LASTP1<\/span><\/code>. Drivers may return<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">EINVAL<\/span><\/code><span>&nbsp;<\/span>if control in this range is not supported.<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-queryctrl.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-queryctrl.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">24<\/td><td class=\"confluenceTd\"><p>VIDIOC_ENUM_<\/p><p>FRAMESIZES<\/p><\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Enumerate frame sizes.<\/span><\/td><td class=\"confluenceTd\"><p>This ioctl allows applications to enumerate all frame sizes (i. e. width and height in pixels) that the device supports for the given pixel format. <span>The supported pixel formats can be obtained by using the<\/span><span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-fmt.html#vidioc-enum-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_ENUM_FMT<\/span><\/a><span>&nbsp;<\/span><span>function.<\/span><\/p><p>The return value and the content of the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">v4l2_frmsizeenum. type<\/span><\/code><span>&nbsp;<\/span>field depends on the type of frame size the device supports. <span>When the application calls the function with index zero, it must check the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>field to determine the type of frame size enumeration the device supports.<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-framesizes.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-enum-framesizes.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">25<\/td><td class=\"confluenceTd\">VIDIOC_TRY_FMT<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Try a data format.<\/span><\/td><td class=\"confluenceTd\"><p>The<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_TRY_FMT<\/span><\/a><span>&nbsp;<\/span>ioctl is equivalent to<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_FMT<\/span><\/a><span>&nbsp;<\/span>with 1 exception: it does not change the driver state. It can also be called at any time, never returning<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">EBUSY<\/span><\/code>. This function is provided to negotiate parameters, to learn about hardware limitations, without disabling I\/O or possibly time-consuming hardware preparations. Although strongly recommended drivers are not required to implement this ioctl. <span>The format as returned by <\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_TRY_FMT<\/span><\/a><span>&nbsp;<\/span><span>must be identical to what<\/span><span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html#vidioc-g-fmt\" rel=\"nofollow\"><span class=\"std std-ref\">VIDIOC_S_FMT<\/span><\/a><span>&nbsp;<\/span><span>returns for the same i\/p or o\/p.<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-fmt.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">26<\/td><td class=\"confluenceTd\">VIDIOC_CROPCAP<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Information about the video cropping and scaling abilities<\/span><\/td><td class=\"confluenceTd\"><p><span>Applications use this function to query the cropping limits, the pixel aspect of images and to calculate scale factors. They set the<span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span><span>&nbsp;<\/span>field of a v4l2_cropcap structure to the respective buffer (stream) type and call the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-cropcap.html#vidioc-cropcap\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_CROPCAP<\/span><\/a><span><span>&nbsp;<\/span>ioctl with a pointer to this structure. Drivers fill the rest of the structure. The results are constant except when switching the video standard. Remember this switch can occur implicit when switching the video input or output.<\/span><br>This ioctl must be implemented for video capture or output devices that support cropping and\/or scaling and\/or have non-square pixels and for overlay devices.<\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-cropcap.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-cropcap.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">27<\/td><td class=\"confluenceTd\">VIDIOC_CREATE_BUFS<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Create buffers for Memory Mapped or User Pointer or DMA Buffer I\/O<\/span><\/td><td class=\"confluenceTd\"><p><span>This can be used as an alternative or in addition to the<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-reqbufs.html#vidioc-reqbufs\" rel=\"nofollow\"><span class=\"std std-ref\">ioctl VIDIOC_REQBUFS<\/span><\/a><span><span>&nbsp;<\/span>ioctl, when tighter control over buffers is required. This ioctl can be called multiple times to create buffers of different sizes. To allocate the device buffers applications must initialize the relevant fields of the<span>&nbsp;<\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-create-bufs.html#v4l2-create-buffers\" rel=\"nofollow\"><span class=\"std std-ref\">struct v4l2_create_buffers<\/span><\/a><span>&nbsp;<\/span>structure. The<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code><span>&nbsp;<\/span>field must be set to the number of requested buffers, the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">memory<\/span><\/code><span>&nbsp;<\/span>field specifies the requested I\/O method and the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">reserved<\/span><\/code><span>&nbsp;<\/span>array must be zeroed. The<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">format<\/span><\/code><span>&nbsp;<\/span>field specifies the image format that the buffers must be able to handle.<\/span><\/p><p><span>When the ioctl is called with a pointer to this structure the driver will attempt to allocate up to the requested number of buffers and store the actual number allocated and the starting index in the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code><span>&nbsp;<\/span>and the<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">index<\/span><\/code><span>&nbsp;<\/span>fields respectively. On return<span>&nbsp;<\/span><code class=\"docutils literal\"><span class=\"pre\">count<\/span><\/code><span>&nbsp;<\/span>can be smaller than the number requested.<\/span><\/p><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-create-bufs.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-create-bufs.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><tr class=\"\"><td colspan=\"1\" class=\"confluenceTd\">28<\/td><td class=\"confluenceTd\">VIDIOC_G_SELECTION<\/td><td colspan=\"1\" class=\"confluenceTd\"><span>Get one of the selection rectangles.<\/span><\/td><td class=\"confluenceTd\"><span>To query the cropping (composing) rectangle set the struct<span>&nbsp;<\/span><\/span><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-selection.html#v4l2-selection\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_selection<\/span><\/a><span><span>&nbsp;<\/span><\/span><code class=\"docutils literal\"><span class=\"pre\">type<\/span><\/code><span> field to the respective buffer type. Do not use the multiplanar buffer types.&nbsp;The next step is setting the value of the struct&nbsp;<a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-selection.html#v4l2-selection\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_selection<\/span><\/a>&nbsp;<code class=\"docutils literal\"><span class=\"pre\">target<\/span><\/code>&nbsp;field to <code class=\"docutils literal\"><span class=\"pre\">V4L2_SEL_TGT_CROP<\/span><\/code>&nbsp;(<code class=\"docutils literal\"><span class=\"pre\">V4L2_SEL_TGT_COMPOSE<\/span><\/code>). The&nbsp;<code class=\"docutils literal\"><span class=\"pre\">flags<\/span><\/code>&nbsp;and&nbsp;<code class=\"docutils literal\"><span class=\"pre\">reserved<\/span><\/code>&nbsp;fields of struct&nbsp;<a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-selection.html#v4l2-selection\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_selection<\/span><\/a> are ignored, and they must be filled with zeros. The driver fills the rest of the structure or returns EINVAL error code if an incorrect buffer type or target was used. If cropping (composing) is not supported, then the active rectangle is not mutable, and it is always equal to the bounds rectangle. Finally, the struct&nbsp;<a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/dev-overlay.html#v4l2-rect\" rel=\"nofollow\"><span class=\"std std-ref\">v4l2_rect<\/span><\/a>&nbsp;rectangle is filled with the current cropping (composing) coordinates.&nbsp;<\/span><\/td><td class=\"confluenceTd\"><a class=\"rdk-inside-table\" href=\"https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-selection.html\" rel=\"nofollow\">https:\/\/www.kernel.org\/doc\/html\/v4.8\/media\/uapi\/v4l\/vidioc-g-selection.html<\/a><\/td><td class=\"confluenceTd\">linux\/videodev2.h<\/td><\/tr><\/tbody><\/table>\n\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n\n\n<h2 class=\"wp-block-heading wp-main-header\">V4L2 IOCTL Code flow<\/h2>\n\n\n<div class=\"conf-macro output-block\" data-hasbody=\"false\" data-macro-name=\"drawio\">\n<div class=\"drawio-macro\" data-macroid=\"aef0a5dc-bfbe-49ea-8546-9a0301cad7dc\" data-buildnum=\"9012\" id=\"drawio-macro-content-aef0a5dc-bfbe-49ea-8546-9a0301cad7dc\"><\/div>\n<div id=\"drawio-macro-data-aef0a5dc-bfbe-49ea-8546-9a0301cad7dc\"><img decoding=\"async\" src=\"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png\" alt=\"V4L2CodeFlow\" title=\"V4L2CodeFlow\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"columnLayout single\" data-layout=\"single\">\n<div class=\"cell normal\" data-type=\"normal\">\n<div class=\"innerCell\">\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>The Westeros Sink Soc module is a component of the Westeros project that is designed [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"parent":11168,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-11319","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Westeros-sink-soc Module - RDK Documentation Portal | Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Westeros-sink-soc Module - RDK Documentation Portal | Documentation\" \/>\n<meta property=\"og:description\" content=\"The Westeros Sink Soc module is a component of the Westeros project that is designed [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/\" \/>\n<meta property=\"og:site_name\" content=\"RDK Documentation Portal | Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-25T05:18:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/\",\"name\":\"Westeros-sink-soc Module - RDK Documentation Portal | Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png\",\"datePublished\":\"2024-08-01T09:34:00+00:00\",\"dateModified\":\"2025-03-25T05:18:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#primaryimage\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png\",\"contentUrl\":\"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png\",\"width\":701,\"height\":571},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"RDK Entertainment\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"RDK6\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"RDK6 Vendor Porting Guide\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Westeros-sink-soc Module\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/\",\"name\":\"RDK Documentation Portal | Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Westeros-sink-soc Module - RDK Documentation Portal | Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/","og_locale":"en_US","og_type":"article","og_title":"Westeros-sink-soc Module - RDK Documentation Portal | Documentation","og_description":"The Westeros Sink Soc module is a component of the Westeros project that is designed [&hellip;]","og_url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/","og_site_name":"RDK Documentation Portal | Documentation","article_modified_time":"2025-03-25T05:18:37+00:00","og_image":[{"url":"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/","url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/","name":"Westeros-sink-soc Module - RDK Documentation Portal | Documentation","isPartOf":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website"},"primaryImageOfPage":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#primaryimage"},"image":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#primaryimage"},"thumbnailUrl":"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png","datePublished":"2024-08-01T09:34:00+00:00","dateModified":"2025-03-25T05:18:37+00:00","breadcrumb":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#primaryimage","url":"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png","contentUrl":"https:\/\/developer.rdkcentral.com\/documentation\/wp-content\/uploads\/sites\/16\/2024\/08\/V4L2CodeFlow.png","width":701,"height":571},{"@type":"BreadcrumbList","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/westeros-sink-soc_module\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":3,"name":"RDK Entertainment","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/"},{"@type":"ListItem","position":4,"name":"RDK6","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/"},{"@type":"ListItem","position":5,"name":"RDK6 Vendor Porting Guide","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/rdk6\/vendor_porting_guide\/"},{"@type":"ListItem","position":6,"name":"Westeros-sink-soc Module"}]},{"@type":"WebSite","@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website","url":"https:\/\/developer.rdkcentral.com\/documentation\/","name":"RDK Documentation Portal | Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/11319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/comments?post=11319"}],"version-history":[{"count":2,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/11319\/revisions"}],"predecessor-version":[{"id":11323,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/11319\/revisions\/11323"}],"up":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/11168"}],"wp:attachment":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/media?parent=11319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}