Step 1 of gstreamer plugin

Source: Internet
Author: User
Tags gstreamer

The gstreamer plug-in already has a good time, so it's hard to tell you how to prepare a plug-in, the plug-in writer's guide of gstreamer should be unable to understand how to call gstreamer to do things, and the resources found on the Internet, in addition, most components are in the integration layer (that is, the pipeline player), and for the development layer (that is, the element in the pipeline) how can I create a token for the transfer. The WMV plug-in I plan to write a notebook when I come up with a paragraph. It can be regarded as a communication, or I can help myself re-confirm that my mind is correct.

In this case, I would like to take the MP3 case as an example. There are many advantages in using a format that is more common than others and widely used as an example, and there is no image at all, this eliminates synchronization issues and does not affect CPU/bandwidth (because the bitrate of video is much higher than that of audio ); second, the hacker case has been crawled, and the data formats across multiple different data types are as follows, the better thing is that players that can share photos with each other also crawl the ground (the degree of being trampled accidentally... When taking advantage of the MRT, the attacker has only one player), which is easy to use when capturing images or performing photos.

Gstreamer provides a command line pipeline creation tool: GST-launch. It is convenient and inconvenient to play a multi-media player manually or manually. The ease is that a command can be called to start broadcasting cases, eliminating the need for slow and slide-mouse operations on the graphic interface; it is inconvenient because it has no other navigation command than play, unlike mplayer, it also provides hotkey Quick Response (quick response is very important for watching movie !!). As for the pipeline, it grows like this

The structure of the arrow and the square element is called pipeline, and each element refers to the processing of a certain part of the data, which is regarded as element. This is similar to the graph of DirectShow. People with DirectShow basics should know about gstreamer better than me.

In summary, the instructions for automatically creating a pipeline are as follows:

GST-launch playbin uri = file: // path/to/filepath

The manual creation can be as simple as this:

GST-launch filesrc location =/path/to/filepath! Mad! Alsasink

Specifically, mad is the main topic in which gstreamer will run the runtime to load the element, that is, the next issue that will go deep into loading. If your system lacks the MP3 plug-in that you need to understand the functions required by mongomp3 or gstreamer, the playback will fail. There are a lot of MP3 writing methods for source, so we use mad (MPEG audio decoder ). For Ubuntu, it is easy to install the necessary functions:

Sudo apt-Get install libmad0 gstreamer0.10-plugins-uugly

 

 

In this way, you can listen to the MP3 audio. Other necessary elements, such as audio Renderer, are usually set to secure. After learning about these tools, we can start the gstreamer plug-in that uses mad as the learning process.

First of all, we 'd better use GST-inspect to look at some information about the mad plug-in, which will be used more or less by the program later.

GST-inspect mad

We will see some descriptions of this plug-in, the capabilities of the pad template, and so on. The gstreamer file clearly lists the properties for capabilities.
In this case, we will not talk much about the description and meaning of the application.

GST-launch and GST-inspect are two important tools when developing plug-ins. After learning these tools, we can start to develop our own MP3 gstreamer plug-ins. Gstreamer has installed a plug-in template on the website, so we can start with this template.

git clone git://anongit.freedesktop.org/gstreamer/gst-template.git 

Next, you will find a GST-template resource in the job category, and then go to the GST-plugin/src pipeline.

../Tools/make_element mp3dec

This tool uses mp3dec to generate a gstreamer plugin template. These two tasks are performed in section 3.1 and 3.2 of the gstreamer plugin writer's guide.

Next, we want to "immediately" see that our plugin was found by GST-inspect. What should we do?

First, modify the GST-plugin/src/makefile. AM to compile our program and use the text generator to convert the string "stststplugin" to "ststmp3dec. Then, just like in the case where we usually open the source file in the production environment, we use autotool to generate makefile, and then parse the line GST-plugin/autogen. Sh. Next, go to make under GST-plugin/src, and we will see libststmp3dec. So under GST-plugin/src/. libs/. This is our gstreamer plug-in. You can use

Ststst_plugin_path =/path/to/GST-template/GST-plugin/src/. libs/GST-inspect mp3dec

Let's look at this plug-in's response, just as we used to write mad, and we found a lot of information in mad, we cannot see the new plug-in mp3dec, which is the feature we need to add.

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.