/usr/share/gtk-doc/html/libmediaart/libmediaart-MediaArtProcess.html is in libmediaart-doc 1.9.4-1.
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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Extraction: libmediaart Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="libmediaart Library Reference Manual">
<link rel="up" href="ch02.html" title="Reference">
<link rel="prev" href="ch02.html" title="Reference">
<link rel="next" href="libmediaart-Cache.html" title="Cache">
<meta name="generator" content="GTK-Doc V1.25 (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="5"><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="#libmediaart-MediaArtProcess.description" class="shortcut">Description</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="libmediaart-Cache.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libmediaart-MediaArtProcess"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libmediaart-MediaArtProcess.top_of_page"></a>Extraction</span></h2>
<p>Extraction — Extraction of music and movie art.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libmediaart-MediaArtProcess.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">GQuark</span>
</td>
<td class="function_name">
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-error-quark" title="media_art_error_quark ()">media_art_error_quark</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GType</span>
</td>
<td class="function_name">
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-get-type" title="media_art_process_get_type ()">media_art_process_get_type</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess"><span class="returnvalue">MediaArtProcess</span></a> *
</td>
<td class="function_name">
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-new" title="media_art_process_new ()">media_art_process_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-uri" title="media_art_process_uri ()">media_art_process_uri</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-file" title="media_art_process_file ()">media_art_process_file</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-buffer" title="media_art_process_buffer ()">media_art_process_buffer</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libmediaart-MediaArtProcess.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtType" title="enum MediaArtType">MediaArtType</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtError" title="enum MediaArtError">MediaArtError</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcessFlags" title="enum MediaArtProcessFlags">MediaArtProcessFlags</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess">MediaArtProcess</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcessClass" title="struct MediaArtProcessClass">MediaArtProcessClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libmediaart-MediaArtProcess.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <libmediaart/mediaart.h>
</pre>
</div>
<div class="refsect1">
<a name="libmediaart-MediaArtProcess.description"></a><h2>Description</h2>
<p>The libmediaart library supports taking image data that you have extracted
from a media file and saving it into the media art cache, so that future
applications can display the media art without having to extract the image
again. This is done using the <a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-file" title="media_art_process_file ()"><code class="function">media_art_process_file()</code></a> or
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-buffer" title="media_art_process_buffer ()"><code class="function">media_art_process_buffer()</code></a> functions.</p>
<p>Extracting new media art from a file needs to be done by your application.
Usually, when an application loads a media file any embedded images will be
made available as a side effect. For example, if you are using GStreamer any
images will be returned through the <span class="type">GstTagList</span> interface as <code class="literal">GST_TAG_IMAGE</code>
tags.</p>
<p>The media art cache requires that all images are saved as 'application/jpeg'
files. Embedded images can be in several formats, and
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-file" title="media_art_process_file ()"><code class="function">media_art_process_file()</code></a> and <a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-buffer" title="media_art_process_buffer ()"><code class="function">media_art_process_buffer()</code></a> functions will
convert the supplied image data into the correct format if
necessary. There are multiple backends that can be used for this,
and you can choose which is used at build time using the library's
'configure' script.</p>
<p>If there is no embedded media art in a file,
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-file" title="media_art_process_file ()"><code class="function">media_art_process_file()</code></a> and <a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-buffer" title="media_art_process_buffer ()"><code class="function">media_art_process_buffer()</code></a> functions will
look in the directory that contains the media file for likely media
art using a simple heuristic.</p>
</div>
<div class="refsect1">
<a name="libmediaart-MediaArtProcess.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="media-art-error-quark"></a><h3>media_art_error_quark ()</h3>
<pre class="programlisting"><span class="returnvalue">GQuark</span>
media_art_error_quark (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="refsect3">
<a name="media-art-error-quark.returns"></a><h4>Returns</h4>
<p> the <span class="type">GQuark</span> used to identify media art errors in
GError structures.</p>
</div>
<p class="since">Since: 0.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="media-art-process-get-type"></a><h3>media_art_process_get_type ()</h3>
<pre class="programlisting"><span class="returnvalue">GType</span>
media_art_process_get_type (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
</div>
<hr>
<div class="refsect2">
<a name="media-art-process-new"></a><h3>media_art_process_new ()</h3>
<pre class="programlisting"><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess"><span class="returnvalue">MediaArtProcess</span></a> *
media_art_process_new (<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Initialize a GObject for processing and extracting media art.</p>
<p>This function initializes cache hash tables, backend plugins,
and storage modules used for removable devices.</p>
<div class="refsect3">
<a name="media-art-process-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" 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>error</p></td>
<td class="parameter_description"><p>Pointer to potential GLib / MediaArt error, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="media-art-process-new.returns"></a><h4>Returns</h4>
<p> A new <a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess"><span class="type">MediaArtProcess</span></a> object on success or <code class="literal">NULL</code> if
<em class="parameter"><code>error</code></em>
is set. This object must be freed using <code class="function">g_object_unref()</code>.</p>
</div>
<p class="since">Since: 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="media-art-process-uri"></a><h3>media_art_process_uri ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
media_art_process_uri (<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess"><span class="type">MediaArtProcess</span></a> *process</code></em>,
<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtType" title="enum MediaArtType"><span class="type">MediaArtType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcessFlags" title="enum MediaArtProcessFlags"><span class="type">MediaArtProcessFlags</span></a> flags</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *uri</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *artist</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *title</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>This function calls <a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-file" title="media_art_process_file ()"><code class="function">media_art_process_file()</code></a>, but takes the <em class="parameter"><code>uri</code></em>
as
a string rather than a <span class="type">GFile</span> object. Either <em class="parameter"><code>artist</code></em>
OR <em class="parameter"><code>title</code></em>
can be
<code class="literal">NULL</code>, but they can not both be <code class="literal">NULL</code>.</p>
<div class="refsect3">
<a name="media-art-process-uri.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" 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>process</p></td>
<td class="parameter_description"><p>Media art process object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>The type of media that contained the image data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>How the media art is processed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>uri</p></td>
<td class="parameter_description"><p>URI of the media file that contained the data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>artist</p></td>
<td class="parameter_description"><p> The artist name <em class="parameter"><code>uri</code></em>
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>title</p></td>
<td class="parameter_description"><p> The title for <em class="parameter"><code>uri</code></em>
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p> optional <span class="type">GCancellable</span> object, <code class="literal">NULL</code> to
ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>Pointer to potential GLib / MediaArt error, or <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="media-art-process-uri.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>uri</code></em>
could be processed or <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em>
is set.</p>
</div>
<p class="since">Since: 0.5.0</p>
</div>
<hr>
<div class="refsect2">
<a name="media-art-process-file"></a><h3>media_art_process_file ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
media_art_process_file (<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess"><span class="type">MediaArtProcess</span></a> *process</code></em>,
<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtType" title="enum MediaArtType"><span class="type">MediaArtType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcessFlags" title="enum MediaArtProcessFlags"><span class="type">MediaArtProcessFlags</span></a> flags</code></em>,
<em class="parameter"><code><span class="type">GFile</span> *file</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *artist</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *title</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Process <em class="parameter"><code>file</code></em>
and check if media art exists and if it is up to date
with <em class="parameter"><code>artist</code></em>
and <em class="parameter"><code>title</code></em>
provided. Either <em class="parameter"><code>artist</code></em>
OR <em class="parameter"><code>title</code></em>
can be
<code class="literal">NULL</code>, but they can not both be <code class="literal">NULL</code>.</p>
<p>NOTE: This function MAY retrieve media art for
<em class="parameter"><code>artist</code></em>
and <em class="parameter"><code>title</code></em>
combinations. It is not guaranteed and depends
on download services available over DBus at the time.</p>
<p>In cases where download is unavailable, <a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-file" title="media_art_process_file ()"><code class="function">media_art_process_file()</code></a>
will only try to procure a cache for possible media art found in
directories surrounding the location of <em class="parameter"><code>file</code></em>
. If a buffer or
memory chunk needs to be saved to disk which has been retrieved
from an MP3 (for example), you should use
<a class="link" href="libmediaart-MediaArtProcess.html#media-art-process-buffer" title="media_art_process_buffer ()"><code class="function">media_art_process_buffer()</code></a>.</p>
<p>The modification time (mtime) of <em class="parameter"><code>file</code></em>
is checked against the
cached stored for <em class="parameter"><code>artist</code></em>
and <em class="parameter"><code>title</code></em>
. If the cache is old or
doesn't exist, it will be updated. What this actually does is
update the mtime of the cache (a symlink) on the disk.</p>
<p>If there is no actual media art stored locally (for example, it's
stored in a directory on a removable device), it is copied locally
(usually to an XDG cache directory).</p>
<p>If <em class="parameter"><code>file</code></em>
is on a removable filesystem, the media art file will be
saved in a cache on the removable file system rather than on the
host machine.</p>
<div class="refsect3">
<a name="media-art-process-file.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" 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>process</p></td>
<td class="parameter_description"><p>Media art process object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>The type of media</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>The options given for how to process the media art</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>File to be processed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>artist</p></td>
<td class="parameter_description"><p> The artist name <em class="parameter"><code>file</code></em>
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>title</p></td>
<td class="parameter_description"><p> The title for <em class="parameter"><code>file</code></em>
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p> optional <span class="type">GCancellable</span> object, <code class="literal">NULL</code> to
ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span> location to store the error occurring, or <code class="literal">NULL</code>
to ignore.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="media-art-process-file.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>file</code></em>
could be processed or <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em>
is set.</p>
</div>
<p class="since">Since: 0.3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="media-art-process-buffer"></a><h3>media_art_process_buffer ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
media_art_process_buffer (<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcess" title="struct MediaArtProcess"><span class="type">MediaArtProcess</span></a> *process</code></em>,
<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtType" title="enum MediaArtType"><span class="type">MediaArtType</span></a> type</code></em>,
<em class="parameter"><code><a class="link" href="libmediaart-MediaArtProcess.html#MediaArtProcessFlags" title="enum MediaArtProcessFlags"><span class="type">MediaArtProcessFlags</span></a> flags</code></em>,
<em class="parameter"><code><span class="type">GFile</span> *related_file</code></em>,
<em class="parameter"><code>const <span class="type">guchar</span> *buffer</code></em>,
<em class="parameter"><code><span class="type">gsize</span> len</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *mime</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *artist</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *title</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Processes a memory buffer represented by <em class="parameter"><code>buffer</code></em>
and <em class="parameter"><code>len</code></em>
. If you
have extracted any embedded media art and passed this in as
<em class="parameter"><code>buffer</code></em>
, the image data will be converted to the correct format and
saved in the media art cache.</p>
<p>Either <em class="parameter"><code>artist</code></em>
OR <em class="parameter"><code>title</code></em>
can be <code class="literal">NULL</code>, but they can not both be <code class="literal">NULL</code>.</p>
<p>If <em class="parameter"><code>file</code></em>
is on a removable filesystem, the media art file will be saved in a
cache on the removable file system rather than on the host machine.</p>
<div class="refsect3">
<a name="media-art-process-buffer.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" 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>process</p></td>
<td class="parameter_description"><p>Media art process object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>The type of media</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>The options given for how to process the media art</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>related_file</p></td>
<td class="parameter_description"><p>File related to the media art</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p> a buffer containing <em class="parameter"><code>file</code></em>
data, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=len][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>buffer</code></em>
, or 0</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>mime</p></td>
<td class="parameter_description"><p> MIME type of <em class="parameter"><code>buffer</code></em>
, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>artist</p></td>
<td class="parameter_description"><p> The artist name <em class="parameter"><code>file</code></em>
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>title</p></td>
<td class="parameter_description"><p> The title for <em class="parameter"><code>file</code></em>
or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p> optional <span class="type">GCancellable</span> object, <code class="literal">NULL</code> to
ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span> location to store the error occurring, or <code class="literal">NULL</code>
to ignore.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="media-art-process-buffer.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>file</code></em>
could be processed or <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em>
is set.</p>
</div>
<p class="since">Since: 0.5.0</p>
</div>
</div>
<div class="refsect1">
<a name="libmediaart-MediaArtProcess.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="MediaArtType"></a><h3>enum MediaArtType</h3>
<p>This type categorized the type of media art we're dealing with.</p>
<div class="refsect3">
<a name="MediaArtType.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-NONE:CAPS"></a>MEDIA_ART_NONE</p></td>
<td class="enum_member_description">
<p>No media art is available</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-ALBUM:CAPS"></a>MEDIA_ART_ALBUM</p></td>
<td class="enum_member_description">
<p>Media art is an album</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-VIDEO:CAPS"></a>MEDIA_ART_VIDEO</p></td>
<td class="enum_member_description">
<p>Media art is a movie or video</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="MediaArtError"></a><h3>enum MediaArtError</h3>
<p>Enumeration values used in errors returned by the
<a class="link" href="libmediaart-MediaArtProcess.html#MediaArtError" title="enum MediaArtError"><span class="type">MediaArtError</span></a> API.</p>
<div class="refsect3">
<a name="MediaArtError.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-ERROR-NO-STORAGE:CAPS"></a>MEDIA_ART_ERROR_NO_STORAGE</p></td>
<td class="enum_member_description">
<p>Storage information is unknown, we
have no knowledge about removable media.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-ERROR-NO-TITLE:CAPS"></a>MEDIA_ART_ERROR_NO_TITLE</p></td>
<td class="enum_member_description">
<p>Title is required, but was not provided,
or was empty.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-ERROR-SYMLINK-FAILED:CAPS"></a>MEDIA_ART_ERROR_SYMLINK_FAILED</p></td>
<td class="enum_member_description">
<p>A call to <code class="function">symlink()</code> failed
resulting in the incorrect storage of media art.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-ERROR-RENAME-FAILED:CAPS"></a>MEDIA_ART_ERROR_RENAME_FAILED</p></td>
<td class="enum_member_description">
<p>File could not be renamed.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-ERROR-NO-CACHE-DIR:CAPS"></a>MEDIA_ART_ERROR_NO_CACHE_DIR</p></td>
<td class="enum_member_description">
<p>This is given when the
XDG_CACHE_HOME directory could not be used to create the
'media-art' subdirectory used for caching media art. This is
usually an initiation error.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 0.2.0</p>
</div>
<hr>
<div class="refsect2">
<a name="MediaArtProcessFlags"></a><h3>enum MediaArtProcessFlags</h3>
<p>This type categorized the flags used when processing media art.</p>
<div class="refsect3">
<a name="MediaArtProcessFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-PROCESS-FLAGS-NONE:CAPS"></a>MEDIA_ART_PROCESS_FLAGS_NONE</p></td>
<td class="enum_member_description">
<p>Normal operation.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="MEDIA-ART-PROCESS-FLAGS-FORCE:CAPS"></a>MEDIA_ART_PROCESS_FLAGS_FORCE</p></td>
<td class="enum_member_description">
<p>Force media art to be re-saved to disk even if it already exists and the related file or URI has the same modified time (mtime).</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 0.3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="MediaArtProcess"></a><h3>struct MediaArtProcess</h3>
<pre class="programlisting">struct MediaArtProcess {
GObject parent;
};
</pre>
<p>A class implementation for processing and extracting media art.</p>
<div class="refsect3">
<a name="MediaArtProcess.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody><tr>
<td class="struct_member_name"><p><span class="type">GObject</span> <em class="structfield"><code><a name="MediaArtProcess.parent"></a>parent</code></em>;</p></td>
<td class="struct_member_description"><p>parent object</p></td>
<td class="struct_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="MediaArtProcessClass"></a><h3>struct MediaArtProcessClass</h3>
<pre class="programlisting">struct MediaArtProcessClass {
GObjectClass parent;
};
</pre>
<p>Prototype for the class.</p>
<div class="refsect3">
<a name="MediaArtProcessClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody><tr>
<td class="struct_member_name"><p><span class="type">GObjectClass</span> <em class="structfield"><code><a name="MediaArtProcessClass.parent"></a>parent</code></em>;</p></td>
<td class="struct_member_description"><p>parent object class</p></td>
<td class="struct_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
|