Gstreamer Application Development Manual (0.10.21.3)
Total Page:16
File Type:pdf, Size:1020Kb
GStreamer Application Development Manual (0.10.21.3) Wim Taymans Steve Baker Andy Wingo Ronald S. Bultje Stefan Kost GStreamer Application Development Manual (0.10.21.3) by Wim Taymans, Steve Baker, Andy Wingo, Ronald S. Bultje, and Stefan Kost This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/opl.shtml ( http://www.opencontent.org/opl.shtml)). Table of Contents Foreword.................................................................................................................................................. vii Introduction............................................................................................................................................ viii 1. Who should read this manual?................................................................................................... viii 2. Preliminary reading.................................................................................................................... viii 3. Structure of this manual ............................................................................................................. viii I. About GStreamer...................................................................................................................................x 1. What is GStreamer? .......................................................................................................................1 2. Design principles............................................................................................................................4 2.1. Clean and powerful............................................................................................................4 2.2. Object oriented ..................................................................................................................4 2.3. Extensible ..........................................................................................................................4 2.4. Allow binary-only plugins.................................................................................................4 2.5. High performance..............................................................................................................5 2.6. Clean core/plugins separation............................................................................................5 2.7. Provide a framework for codec experimentation...............................................................5 3. Foundations....................................................................................................................................6 3.1. Elements ............................................................................................................................6 3.2. Pads....................................................................................................................................6 3.3. Bins and pipelines..............................................................................................................7 II. Building an Application .......................................................................................................................8 4. Initializing GStreamer....................................................................................................................9 4.1. Simple initialization...........................................................................................................9 4.2. The GOption interface.....................................................................................................10 5. Elements.......................................................................................................................................12 5.1. What are elements?..........................................................................................................12 5.2. Creating a GstElement..................................................................................................14 5.3. Using an element as a GObject......................................................................................15 5.4. More about element factories ..........................................................................................16 5.5. Linking elements .............................................................................................................18 5.6. Element States .................................................................................................................19 6. Bins ..............................................................................................................................................21 6.1. What are bins...................................................................................................................21 6.2. Creating a bin ..................................................................................................................21 6.3. Custom bins.....................................................................................................................22 7. Bus ...............................................................................................................................................24 7.1. How to use a bus..............................................................................................................24 7.2. Message types..................................................................................................................27 8. Pads and capabilities ....................................................................................................................29 8.1. Pads..................................................................................................................................29 8.2. Capabilities of a pad ........................................................................................................32 8.3. What capabilities are used for .........................................................................................34 8.4. Ghost pads .......................................................................................................................37 9. Buffers and Events .......................................................................................................................39 9.1. Buffers .............................................................................................................................39 9.2. Events ..............................................................................................................................39 iii 10. Your first application..................................................................................................................41 10.1. Hello world....................................................................................................................41 10.2. Compiling and Running helloworld.c ...........................................................................44 10.3. Conclusion.....................................................................................................................45 III. Advanced GStreamer concepts........................................................................................................46 11. Position tracking and seeking ....................................................................................................47 11.1. Querying: getting the position or length of a stream.....................................................47 11.2. Events: seeking (and more) ...........................................................................................48 12. Metadata.....................................................................................................................................50 12.1. Metadata reading ...........................................................................................................50 12.2. Tag writing.....................................................................................................................50 13. Interfaces....................................................................................................................................51 13.1. The URI interface..........................................................................................................51 13.2. The Mixer interface .......................................................................................................51 13.3. The Tuner interface........................................................................................................51 13.4. The Color Balance interface..........................................................................................52 13.5. The Property Probe interface.........................................................................................52 13.6. The X Overlay interface ................................................................................................52 14. Clocks in GStreamer ..................................................................................................................54 14.1. Clock providers .............................................................................................................54 14.2. Clock slaves...................................................................................................................55 15. Dynamic Controllable Parameters