Reader small image

You're reading from  Using Yocto Project with BeagleBone Black

Product typeBook
Published inJun 2015
Reading LevelIntermediate
Publisher
ISBN-139781785289736
Edition1st Edition
Languages
Right arrow
Authors (2):
Irfan Sadiq
Irfan Sadiq
author image
Irfan Sadiq

H M Irfan Sadiq was a Linux enthusiast as a graduate student. He started his career as an embedded system development engineer and has been working as an H.264 Decoder developer and optimizer for the VLIW architecture. He got an opportunity to work on multiple multimedia frameworks that are open source as well as proprietary. He tried to work in a start-up in the entirely different domain of web development. He has been working on OpenEmbedded and Yocto Project technologies since he joined Mentor Graphics as the technical lead back in 2010. He has been working on derivative technologies of Yocto Project and OpenEmbedded for quite some time now, spanning more than 4 years. He has also been working on various hardware platforms based on the ARM, PPC, and x86 architecture. The diverse nature of subsequent BSPs has challenges in the context of QA. One of the challenges was to keep the QA packages in one place in such a way that they could be applied to all different product/platform combinations. He addressed this by creating a Yocto Project-based layer for which he is a maintainer as well as a gatekeeper.
Read more about Irfan Sadiq

View More author details
Right arrow

Chapter 4. Adding Multimedia to Your Board

In the previous chapter, we created a helloworld recipe and learned the basic elements of a BitBake recipe related to it. In this chapter, we will study a more complex set of recipes related to multimedia. We won't create a recipe of our own. Instead, we will examine a player called gaku, that is already available. Fortunately, this is all set in the image we built in our first chapter, core-image-sato. We will see how this is enabled for this specific image type and how we can enable such a package in any other image. While doing this, we will cover the advanced elements of BitBake recipes.

In this chapter, we will cover the following topics:

  • Introducing gaku

  • Recipe of gaku

  • GStreamer recipes short trip

  • Action time

Introducing gaku


Gaku is a simple music player to play music. It uses GTK+ as the user interface library and GStreamer as a multimedia framework. Since we are building core-image-sato from Chapter 1, Welcome to Yocto Project and BeagleBone Black, we already have this added to our image, and we don't have to do anything extra to enable it. Here, we will use a top-to-bottom approach to learn how this is enabled, and what packages it depends on.

Hence, we will start analyzing the player recipe and from there, we will dig its dependencies and have a look at the required recipes. We will look at GStreamer recipes as well. Meanwhile, we will encounter different BitBake elements and syntax-specific discussions.

In summary, in the case of core-image-sato, multimedia is enabled by adding gaku to image dependencies using the package group packagegroup-core-x11-sato.bb. This package, in turn, causes the rest of the dependencies to be fulfilled and built with it. This package is found at meta/recipes...

The recipe for gaku


The recipe for gaku can be found at meta/recipes-sato/gaku/gaku_git.bb. We have already discussed most of the elements. We will discuss only those that we haven't already discussed, or that need some more explanation. We will discuss the contents of the recipe, as well as the other options similar to the ones used, and not used, in the content.

Package control variables

In this section, we will discuss the variables that are used to control a package. Three of the variables belonging to this type are found in our recipe; the rest are not. We will discuss those as well.

Build dependencies (DEPENDS)

We already informed you that gaku uses GTK+ for UI and GStreamer as a multimedia framework. It sets its dependency on these, as follows:

DEPENDS = "gtk+ gstreamer libowl-av"

libowl-av is a widget library that provides widgets for video and audio playback, thus easing the creation of multimedia applications. Moreover, these widgets are integrated with GStreamer.

Note

Talking in terms...

GStreamer recipes' short trip


This section is not intended for a full walkthrough of GStreamer, its recipes, and other information required to grasp multimedia application development using GStreamer. Instead, we intend to have a look at different recipes, find BitBake elements in them, and discuss those elements. If we observe the order as we encountered in the gaku recipe, first of all, we set GStreamer in DEPENDS. Here are the main recipes for GStreamer:

  • gstreamer_0.10.36.bb

  • gst-plugins-base_0.10.36.bb

  • gst-meta-base_0.10.bb

  • gst-plugins-package.inc

  • gst-plugins.inc

These can be found under meta/recipes-multimedia/gstreamer/. We don't have the luxury of enough pages to go into the details of each of these, and the relationships of each with the other. Hence, we will discuss the common constructs found in these files.

Types of variable assignments

Having a look at this recipe, we encounter " ?= ", " += ", and "??=". We recommend that you read this chapter for details. We will discuss them...

Action time


Now, we have developed an understanding of the underlying details. We have built images that contain a video player, that is, gaku and GStreamer, to support this player as a multimedia framework. We have enabled a minimal set of plugins for our use. Having all this, we are ready to see how this actually works. Perform the following steps to see this in action.

  1. Connect your board with the HDMI display. I have used my Samsung 32'' LED TV for this purpose.

  2. To connect the TV to the board, I used a micro HDMI-to-HDMI cable.

  3. Copy some .ogg video file. You can convert some existing video file. You can download video files from http://techslides.com/sample-webm-ogg-and-mp4-video-files-for-html5.

  4. Copy your downloaded video file to the board, directly onto a card, or using SSH, if you have connected the board to a network.

  5. Launch gaku from UI.

  6. I attached a USB mouse to use the UI.

  7. Use the + button to browse to the directory containing the sample.ogg file.

  8. Choose your copied video file (in my...

Summary


In this chapter, we studied more advanced recipe elements using gaku, a player based on GStreamer. We visited its recipe, as well as common elements from gstreamer recipes. We discussed these:

  • How dependencies are specified and how multiple recipes are kept to provide the same package

  • Some more about source fetching

  • Various techniques to inherit functionalities

  • Variable assignment types and conditional assignments

In next chapter, we will be studying Layers, a mechanism to keep all of our recipes together.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Using Yocto Project with BeagleBone Black
Published in: Jun 2015Publisher: ISBN-13: 9781785289736
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Irfan Sadiq

H M Irfan Sadiq was a Linux enthusiast as a graduate student. He started his career as an embedded system development engineer and has been working as an H.264 Decoder developer and optimizer for the VLIW architecture. He got an opportunity to work on multiple multimedia frameworks that are open source as well as proprietary. He tried to work in a start-up in the entirely different domain of web development. He has been working on OpenEmbedded and Yocto Project technologies since he joined Mentor Graphics as the technical lead back in 2010. He has been working on derivative technologies of Yocto Project and OpenEmbedded for quite some time now, spanning more than 4 years. He has also been working on various hardware platforms based on the ARM, PPC, and x86 architecture. The diverse nature of subsequent BSPs has challenges in the context of QA. One of the challenges was to keep the QA packages in one place in such a way that they could be applied to all different product/platform combinations. He addressed this by creating a Yocto Project-based layer for which he is a maintainer as well as a gatekeeper.
Read more about Irfan Sadiq