Added status of the documents
[platform/upstream/gstreamer.git] / docs / random / omega / type-properties
1 OUTDATED
2 --------
3
4
5 A type properties system might look like following:
6
7
8 1) Type definition includes the properties and their ranges:
9
10 audio/mp3
11         layer:          1 - 3
12         bitrate:        8 - 320
13
14 audio/raw
15         format:         bitfield (using asound.h definitions)
16         depth:          8 - 32
17         rate:           4000 - 96000
18         channels:       1 - n
19         interleave:     boolean
20
21 video/raw
22         format:         32-bit FOURCC
23         bpp:            1 - 32
24         width:          1 - n
25         height:         1 - n
26         framerate:      32-bit float
27
28 etc.
29
30
31 2) An element can specify what subtypes it can deal with by creating a list of property tables:
32
33 mpg123: audio/mp3
34         layer:          1 - 3
35         bitrate:        8 - 320
36
37 osssink:
38         format:         S8, S16, etc.
39         depth:          8 - 16
40         rate:           8000 - 48000
41         channels:       1 - 2
42         interleave:     true
43
44 And you could list several of these, so for instance if the card only supports 8-bit at up to 22KHz in
45 mono, you can remove S8 from the above list and add a second entry:
46
47 osssink:
48         format:         S8
49         depth:          8
50         rate:           8000 - 22050
51         channels:       1
52         interleave:     false (irrelevant)
53
54 The obvious problem with these examples is that the rate isn't really 8000 - 48000, it's 8000, 11025,
55 16000, 22050, 44100, and 48000.  However, we may be able to leave these to pad connect time.
56
57
58
59
60
61 struct _type_definition {
62   char *mime_type;
63
64   ....
65
66   GData *properties;
67 }
68
69 gst_type_add_property_int(_type *type,gchar *propname,int min,int max) {
70   struct _type_prop_int prop_int;
71   GQuark quark = g_quark_from_string(propname);
72
73   prop_int->id = quark;
74   prop_int->min = min;
75   prop_int->max = max;
76   g_datalist_id_set_data(type->properties,quark,&prop_int);
77 }