S5pv210 nv12 to RGB (fimc1 implements hard decoding of data in LCD display)

Source: Internet
Author: User

Recently, hard decoding of 210 has been used to implement the h264-> nv12t decoding process, but the data displayed on FB is RGB. Therefore, decoding to nv12 cannot be directly displayed on the LCD, there is a nv12t-> RGB conversion process. The s3c-pp Device on 6410 converts color space and enables hardware scaling that supports video data. However, the post processor device is not found in Datasheet of s5pv210. In the past, 210 was more advanced. It had three cam controllers. Although it is called cam, it is not only used for camera devices. For example, fimc1 is used as the video output. The following is an article by Boyou, which describes how fimc operates when used for video output:

Overlay is the name that android often sees. It can be understood as video superposition, or overlay as video output.

Video output is closely related to video superposition. Generally, the output video background is the system UI Layer, while video output is superimposed on the UI Layer.

Video output and system UI generally use an independent video memory area. The system UI is displayed through framebuffer, while video output can be implemented in the driver layer in two ways: 1. framebuffer method, 2. the output device Implementation Method of v4l2 is closely related to the platform, and even some platform implementation methods, such as Freescale imx51, the application layer can achieve video output through/dev/fb2, and set/dev/video16 through output to achieve video output. Which of the following is the work of overlayhal.

The Samsung s5pv210 platform uses the output device to output videos. The device node/dev/video1 (corresponding to the fimc1 Controller) does not have to use the fimc1 controller. fimc0 fimc2 can also be used to output videos, the specific fimc used for video output is determined by the implementation of overlayhal.

See the device/Samsung/proprietary/liboverlay/v4l2_utilc.c file.

Int v4l2_overlay_open (int id ){

Log_function_name

Return open ("/dev/video1", o_rdwr );

}

The node of the hardcode overlay device is/dev/video1.

The superposition of the primary display area and the Overlay display area is achieved through hardware. As for the hierarchical relationship between the primary FB and overlay, the blending mode is generally implemented by the driver layer; of course, the application layer can control the hierarchy, the position of the stack layer, the size rotation and transparency.


Android video output System Structure

Android video output systems include: Driver layer (output driver, framebuffer driver), overlayhal, overlay server surfaceflinger, and local framework

The overlay video output system structure is as follows:

The node of the hardcode overlay device is/dev/video1.

The superposition of the primary display area and the Overlay display area is achieved through hardware. As for the hierarchical relationship between the primary FB and overlay, the blending mode is generally implemented by the driver layer; of course, the application layer can control the hierarchy, the position of the stack layer, the size rotation and transparency.


Android video output System Structure

Android video output systems include: Driver layer (output driver, framebuffer driver), overlayhal, overlay server surfaceflinger, and local framework

The overlay video output system structure is as follows:

The node of the hardcode overlay device is/dev/video1.

The superposition of the primary display area and the Overlay display area is achieved through hardware. As for the hierarchical relationship between the primary FB and overlay, the blending mode is generally implemented by the driver layer; of course, the application layer can control the hierarchy, the position of the stack layer, the size rotation and transparency.


Android video output System Structure

Android video output systems include: Driver layer (output driver, framebuffer driver), overlayhal, overlay server surfaceflinger, and local framework

The overlay video output system structure is as follows:

1. Overlay driver layer: framebuffer driver, v4l2 output driver

2. overlayhal: Hardware/libhardware/include/hardware/overlay. H, and Samsung s5pv210 overlayhal are implemented under the device/Samsung/proprietary/liboverlay/directory.

3. The layerbuffer In the overlay server surfaceflinger: surfaceflinger is used on camera preview/video playback. layerbuffer provides two implementation methods: POST buffer and overlay.
4. Overlay local framework code:

Header file path: Frameworks/base/inlcude/UI

Source File Path: Frameworks/base/libs/UI

The overlay system framework is part of the library libui. So. The provided methods are used by the camera viewfinder and the render of video output. For details about how to call the Samsung platform viewfinder, seeDevice/Samsung/proprietary/libcamera/seccamerahwinterface. cpp,For more information about video output render, seeSamsung/proprietary/libstagefrighthw/sechardwarerenderer. cpp. You must call the overlay system in these two files.

Overlay driver layer

S5pv210 overlay involves the output driver and framebuffer driver in the driver layer.

The output driver is actually a special form driven by the fimc controller. fimc is an image processing unit on the s5pv210 platform. The input of the fimc controller can be camera sensor or MEM, and the output can be mem.

If the input is camera sensor, fimc is fimc_capture. If the input is MEM, fimc is fimc_ouput.

When fimc is used for overlay, the workflow is as follows:

1. Set the fimc input to camera preview or video decoding output data address.

2. Set the output address of fimc to the mem_base of framebuffer.

3. Start the fimc controller for rotation, scaling, and color space conversion. The fimc controller stores the processing results to the output address.

4. After fimc completes the conversion, it returns to the video player at the application layer. In this case, the video player calls pan_display of framebuffer. pan_display updates the content of framebuffer to mem_base.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.