plugin-development: syntax highlighting in code snippets

Signed-off-by: Carlos Eduardo R. B. Fonseca <cadubentzen@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788029
This commit is contained in:
Carlos Eduardo R. B. Fonseca 2017-09-21 19:56:34 -03:00 committed by Nicolas Dufresne
parent 6fa607b01c
commit 14193ec3d7
3 changed files with 78 additions and 73 deletions

View file

@ -291,6 +291,7 @@ access:
The following example will show how a `_get_range The following example will show how a `_get_range
()`-function can be implemented in a source element: ()`-function can be implemented in a source element:
```c
#include "filter.h" #include "filter.h"
static GstFlowReturn static GstFlowReturn
gst_my_filter_get_range (GstPad * pad, gst_my_filter_get_range (GstPad * pad,
@ -329,6 +330,7 @@ The following example will show how a `_get_range
return GST_FLOW_OK; return GST_FLOW_OK;
} }
```
In practice, many elements that could theoretically do random access, In practice, many elements that could theoretically do random access,
may in practice often be activated in push-mode scheduling anyway, since may in practice often be activated in push-mode scheduling anyway, since

View file

@ -262,6 +262,7 @@ a new pad from this template using `gst_pad_new_from_static_template
()`, you will need to declare the pad template as a global variable. More on ()`, you will need to declare the pad template as a global variable. More on
this subject in [Specifying the pads][pads]. this subject in [Specifying the pads][pads].
```c
static GstStaticPadTemplate sink_factory = [..], static GstStaticPadTemplate sink_factory = [..],
src_factory = [..]; src_factory = [..];
@ -276,6 +277,7 @@ this subject in [Specifying the pads][pads].
gst_element_class_add_pad_template (element_class, gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory)); gst_static_pad_template_get (&sink_factory));
} }
```
The last argument in a template is its type or list of supported types. The last argument in a template is its type or list of supported types.
In this example, we use 'ANY', which means that this element will accept In this example, we use 'ANY', which means that this element will accept

View file

@ -77,6 +77,7 @@ from one state to another.
Do not g\_assert for unhandled state changes; this is taken care of by Do not g\_assert for unhandled state changes; this is taken care of by
the GstElement base class. the GstElement base class.
```c
static GstStateChangeReturn static GstStateChangeReturn
gst_my_filter_change_state (GstElement *element, GstStateChange transition); gst_my_filter_change_state (GstElement *element, GstStateChange transition);
@ -119,7 +120,7 @@ the GstElement base class.
return ret; return ret;
} }
```
Note that upwards (NULL=\>READY, READY=\>PAUSED, PAUSED=\>PLAYING) and Note that upwards (NULL=\>READY, READY=\>PAUSED, PAUSED=\>PLAYING) and
downwards (PLAYING=\>PAUSED, PAUSED=\>READY, READY=\>NULL) state changes downwards (PLAYING=\>PAUSED, PAUSED=\>READY, READY=\>NULL) state changes
are handled in two separate blocks with the downwards state change are handled in two separate blocks with the downwards state change