How to do it...

The FSL community BSP layer provides a fsl-image-multimedia target image that includes the gstreamer framework, including plugins that make use of the hardware acceleration features within the i.MX6 SoC. A fsl-image-multimedia-full image is also provided, which extends the supported gstreamer plugins. To build the fsl-image-multimedia image with framebuffer support, you need to remove the graphical distribution features by adding the following to your conf/local.conf file:

DISTRO_FEATURES_remove = "x11 directfb wayland vulkan" 

Alternatively, the FSL BSP community offers a fslc-framebuffer distribution as part of meta-freescale-distro with a reference configuration for framebuffer images. To use it, change your DISTRO in conf/local.conf to fslc-framebuffer.

You will need to build from scratch by removing both the tmp and sstate-cache directories when changing the DISTRO_FEATURES variable.

Build the image with the following:

$ cd /opt/yocto/fsl-community-bsp/
$ source setup-environment wandboard
$ bitbake fsl-image-multimedia

We are using the fsl-image-multimedia image as an example, but any image where the afore mentioned graphical distribution features are removed will build packages with framebuffer support for packages that support it. The resulting fsl-image-multimedia-wandboard.wic.gz image at tmp/deploy/images can be programmed into a microSD card and booted. The default Wandboard device tree defines an mxcfb1 node, as follows:

       mxcfb1: fb@0 { 
                compatible = "fsl,mxc_sdc_fb"; 
                disp_dev = "hdmi"; 
                interface_pix_fmt = "RGB24"; 
                mode_str ="1920x1080M@60"; 
                default_bpp = <24>; 
                int_clk = <0>; 
                late_init = <0>; 
        }; 

So, connecting a 1920x1080 HDMI monitor should show a virtual Terminal with the Poky login prompt. We can then use the gstreamer command-line tool, gst-launch-1.0, to construct gstreamer pipelines. For example, to view a hardware-accelerated video over the framebuffer, you can download the Big Buck Bunny teaser full HD video file and play it over the framebuffer using the gstreamer framework's gst-launch-1.0 command-line tool, as follows:

# cd /home/root
# wget
http://mirror.cessen.com/blender.org/peach/trailer/trailer_1080p.mov
# gst-launch-1.0 playbin uri=file:///home/root/trailer_1080p.mov

The playbin gstreamer plugin will automatically create a pipeline with the correct elements. In this case the video will use the h.264 video decoder plugin, imxvpu, which makes use of the hardware video processing unit inside the i.MX6 SoC to decode the h.264 video.

You can see a list of the available i.MX6-specific plugins by running the following:

# gst-inspect-1.0 | grep imx
imxpxp: imxpxpvideosink: Freescale PxP video sink
imxpxp: imxpxpvideotransform: Freescale PxP video transform
imxvpu: imxvpudec: Freescale VPU video decoder
imxvpu: imxvpuenc_h263: Freescale VPU h.263 video encoder
imxvpu: imxvpuenc_h264: Freescale VPU h.264 video encoder
imxvpu: imxvpuenc_mpeg4: Freescale VPU MPEG-4 video encoder
imxvpu: imxvpuenc_mjpeg: Freescale VPU motion JPEG video encoder
imxg2d: imxg2dvideosink: Freescale G2D video sink
imxg2d: imxg2dvideotransform: Freescale G2D video transform
imxg2d: imxg2dcompositor: Freescale G2D video compositor
imxaudio: imxuniaudiodec: Freescale i.MX uniaudio decoder
imxaudio: imxmp3audioenc: Freescale i.MX MP3 encoder
imxeglvivsink: imxeglvivsink: Freescale EGL video sink
imxipu: imxipuvideotransform: Freescale IPU video transform
imxipu: imxipuvideosink: Freescale IPU video sink
imxipu: imxipucompositor: Freescale IPU video compositor
imxv4l2videosrc: imxv4l2videosrc: V4L2 CSI Video Source
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset