/usr/share/gtk-doc/html/libtracker-extract/libtracker-extract-How-to-use-libtracker-extract.html is in libtracker-extract-doc 0.16.2-1ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tracker Extract Library Reference Manual: How to use libtracker-extract</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Tracker Extract Library Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="ch02.html" title="Core API">
<link rel="next" href="libtracker-extract-TrackerExtractInfo.html" title="TrackerExtractInfo">
<meta name="generator" content="GTK-Doc V1.20 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#libtracker-extract-How-to-use-libtracker-extract.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#libtracker-extract-How-to-use-libtracker-extract.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ch02.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libtracker-extract-TrackerExtractInfo.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libtracker-extract-How-to-use-libtracker-extract"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libtracker-extract-How-to-use-libtracker-extract.top_of_page"></a>How to use libtracker-extract</span></h2>
<p>How to use libtracker-extract — The essentials by example</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody><tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libtracker-extract-How-to-use-libtracker-extract.html#tracker-extract-get-metadata" title="tracker_extract_get_metadata ()">tracker_extract_get_metadata</a> <span class="c_punctuation">()</span>
</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">
</pre>
</div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <libtracker-extract/tracker-extract.h>
</pre>
</div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.description"></a><h2>Description</h2>
<p>The libtracker-extract library is the foundation for Tracker
metadata extraction of embedded data in files.</p>
<p>Tracker comes with extractors written for the most common file
types (like MP3, JPEG, PNG, etc.), however, for more special cases,
3rd party applications may want to write their own plugin to
extract their own file formats. This documentation describes how to
do that.</p>
<div class="example">
<a name="id-1.3.3.2.7.4"></a><p class="title"><b>Example 1. Basic extractor example</b></p>
<div class="example-contents">
An example of how to write an extractor to retrieve PNG embedded
metadata.
<pre class="programlisting">
G_MODULE_EXPORT gboolean
tracker_extract_get_metadata (TrackerExtractInfo *info)
{
GFile *file;
TrackerSparqlBuilder *metadata;
gint height, width;
file = tracker_extract_info_get_file (info);
metadata = tracker_extract_info_get_metadata_builder (info);
/* Do data extraction. */
height = ...
width = ...
/* Insert data into TrackerSparqlBuilder object. */
tracker_sparql_builder_predicate (metadata, "a");
tracker_sparql_builder_object (metadata, "nfo:Image");
tracker_sparql_builder_object (metadata, "nmm:Photo");
tracker_sparql_builder_predicate (metadata, "nfo:width");
tracker_sparql_builder_object_int64 (metadata, width);
tracker_sparql_builder_predicate (metadata, "nfo:height");
tracker_sparql_builder_object_int64 (metadata, height);
/* Were we successful or not? */
return TRUE;
}
</pre>
</div>
</div>
<br class="example-break"><p>NOTE: This example has changed subtly since 0.10. For details see
<a class="link" href="libtracker-extract-How-to-use-libtracker-extract.html#tracker-extract-get-metadata" title="tracker_extract_get_metadata ()"><code class="function">tracker_extract_get_metadata()</code></a>.</p>
</div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="tracker-extract-get-metadata"></a><h3>tracker_extract_get_metadata ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
tracker_extract_get_metadata (<em class="parameter"><code><a class="link" href="libtracker-extract-TrackerExtractInfo.html#TrackerExtractInfo" title="TrackerExtractInfo"><span class="type">TrackerExtractInfo</span></a> *info</code></em>);</pre>
<p>This function must be provided by ALL extractors. This is merely
the declaration of the function which must be written by each
extractor.</p>
<p>This is checked by tracker-extract by looking up the symbols for
each started plugin and making sure this function exists.</p>
<p>The <em class="parameter"><code>info</code></em>
parameter contains required information for the
extraction and a location to store the results. The
<a class="link" href="libtracker-extract-TrackerExtractInfo.html#tracker-extract-info-get-metadata-builder" title="tracker_extract_info_get_metadata_builder ()"><code class="function">tracker_extract_info_get_metadata_builder()</code></a> function returns a
<span class="type">TrackerSparqlBuilder</span> constructed through
<code class="function">tracker_sparql_builder_new_embedded_insert()</code>. The subject
is already set to be the file URN, so implementations of this
function should just provide predicate/object(s) pairs. The
triples contained in this object at the end of the function will be
merged with further file information from miners.</p>
<p>Whenever any of the inserted triples rely on entities that
should also be provided by this extractor (for example, album
or artist information from a song), such insertions should be
added to the preupdate object returned by
<a class="link" href="libtracker-extract-TrackerExtractInfo.html#tracker-extract-info-get-preupdate-builder" title="tracker_extract_info_get_preupdate_builder ()"><code class="function">tracker_extract_info_get_preupdate_builder()</code></a>. This is a
<span class="type">TrackerSparqlBuilder</span> created through
<code class="function">tracker_sparql_builder_new_update()</code>.</p>
<p>NOTE: If upgrading from 0.10, this function replaces the old
function named <code class="function">tracker_extract_get_data()</code> and has a few subtle
differences. First, there is a return value for success and the
parameters are contained in <em class="parameter"><code>info</code></em>
instead of being passed
individually. Second, the extractor is passed the detected
MIME type of the file being extracted.</p>
<div class="refsect3">
<a name="id-1.3.3.2.8.2.9"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>info</p></td>
<td class="parameter_description"><p>a <a class="link" href="libtracker-extract-TrackerExtractInfo.html#TrackerExtractInfo" title="TrackerExtractInfo"><span class="type">TrackerExtractInfo</span></a> object</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.3.3.2.8.2.10"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the extraction succeeded, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
<p></p>
</div>
<p class="since">Since 0.12</p>
</div>
</div>
<div class="refsect1">
<a name="libtracker-extract-How-to-use-libtracker-extract.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>
|