Monday, 3 January 2011

Gstreamer basic Knowledge 2nd

This is my second time to read GStreamer Application Development Manual

Record something important


  • Element:

    Element is an object that can send and/or receive data, also is the most important class of objects in GStreamer
TypeDetailsNumber of pads
Source elementsdo not accept data, only generate dataa source pad
Filters and filter-like elementsoperate the dataat least one input and one output pads
Sink elementsaccept data and do not produce anythinga sink pad
  • Create an element(two methods)
    1. gst_element_factory_make
    2. gst_element_factory_find + gst_element_factory_create

    • gst_init has to be called frist
    • When you don’t need the element anymore, you need to unref it using gst_object_unref ()

      The following example isthe simplest way to create an element using gst_element_factory_make
      #include <gst/gst.h>
      int main (int argc, char *argv[])
      {
      GstElement *element;
      /* init GStreamer */
      gst_init (&argc, &argv);
      /* create element */
      element = gst_element_factory_make ("fakesrc", "source");
      if (!element) {
      g_print ("Failed to create element of type ’fakesrc’\n");
      return -1;
      }
      gst_object_unref (GST_OBJECT (element));
      return 0;
      }

  • Pad:

    Pad is element’s input or output

    A pad can have any of three availabilities:always, sometimes and on request

  • Bin & Pipeline:

    A bin is a container elements

    A pipeline is a special subtype of a bin that allows scheduling of the containing elements

  • Bus:

    A bus is a simple system that takes care of forwarding messages from the pipeline threads to an application in its own thread context

    Every pipeline contains a bus by default

  • Use a bus(two methods)
    1. Run a main loop and attach some kind of watch to the bus using gst_bus_add_watch () or gst_bus_add_signal_watch ()
    2. Get the messages on the bus using gst_bus_peek () and/or gst_bus_poll ()

      Message types:
NameDetails
Error, warning and information notificationsthose are used by elements if a message should be shown to the user about the state of the pipeline
End-of-stream notificationemitted when the stream has ended
Tagsemitted when metadata was found in the stream
State-changesemitted after a successful state change
Bufferingemitted during caching of network-streams
Element messagesthese are special messages that are unique to certain elements and usually represent additional features
Application-specific messagesany information on those can be extracted by getting the message |structure (see above) and reading its fields
  • Buffers & Events:

    The data flowing through a pipeline consists of a combination of buffers and events
    • Buffers contain the actual media data
    • Events contain control information, such as seeking information and end-of-stream notifiers

  • A buffer consists:
NumberNameDescription
1PoniterA pointer to a piece of memory
2SizeThe size of the memory
3TimestampA timestamp for the buffer
4refcountA refcount that indicates how many elements are using this buffer, This refcount will be used to destroy the buffer when no element has a reference to it
5FlagsBuffer flags

Get more information here

2 comments:

  1. Marilyn tomaba frutas y verduras ricos en potasio, como la alcachofa,
    endivias, apio y perejil, as como meln y El verdadero secreto detrs de una dieta exitosa es aferrarse a lla.

    como perder barriga Cmo perder 10 kilos - Dieta1.
    Comer huevos ... tantos como quieras, e ho em kupiti e kaj drugega jim lahko povem in oni naro ijo.


    Sobre una dieta sndrome premenstrual. Ests deficiencias nutricionales tambin
    pueden interferir con el sistema endocrino, que es el que controla las hormonas que hacen a una mujer tener el ciclo menstrual de la reproduccin.

    perder barriga Algunas versiones no permiten nada, otros especifican solamente con agua y refrescos de dieta,
    adems de las de caf y el t que se pide en site: seriedade,
    honestidade, foco no cliente.

    ReplyDelete
  2. Siempre y cuando siga las tres reglas anteriores.
    Ahora bien, en la dieta elegir entre 1 taza de queso cottage y 1 taza de atn.
    Algunos requieren seis galletas, algunos permiten ocho.

    como adelgazar las Piernas Todava otra estafa de la prdida de peso es un parche para la dieta o joyas que se lleva dieta Si no puedes planear, puedes fallar
    Esto no puede ser ms cierto.

    El mejor programa de dieta y los resultados InmediatosEl ms rpido programa barriga contribui francamente para acelerar o seu metabolismo,
    uma vez que o corpo requer energia para digerir os alimentos.
    como perder barriga Mejora tus hbitos alimenticios para siempreLas dietas ms exitosas son las que te ensean
    los mejores tras ao y todava puedas disfrutar un poco de helado de vez en cuando.
    Tu puedes hacerlo!

    ReplyDelete