/usr/include/grilo-0.1/grl-media-source.h is in libgrilo-0.1-dev 0.1.18-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 | /*
* Copyright (C) 2010, 2011 Igalia S.L.
*
* Contact: Iago Toral Quiroga <itoral@igalia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#if !defined (_GRILO_H_INSIDE_) && !defined (GRILO_COMPILATION)
#error "Only <grilo.h> can be included directly."
#endif
#ifndef _GRL_MEDIA_SOURCE_H_
#define _GRL_MEDIA_SOURCE_H_
#include <grl-media-plugin.h>
#include <grl-metadata-source.h>
#include <grl-data.h>
#include <grl-media-box.h>
#include <grl-definitions.h>
#include <glib.h>
#include <glib-object.h>
/* Macros */
#define GRL_TYPE_MEDIA_SOURCE \
(grl_media_source_get_type ())
#define GRL_MEDIA_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
GRL_TYPE_MEDIA_SOURCE, \
GrlMediaSource))
#define GRL_IS_MEDIA_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
GRL_TYPE_MEDIA_SOURCE))
#define GRL_MEDIA_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \
GRL_TYPE_MEDIA_SOURCE, \
GrlMediaSourceClass))
#define GRL_IS_MEDIA_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), \
GRL_TYPE_MEDIA_SOURCE))
#define GRL_MEDIA_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
GRL_TYPE_MEDIA_SOURCE, \
GrlMediaSourceClass))
/**
* GrlMediaSourceChangeType:
* @GRL_CONTENT_CHANGED: content has changed. It is used when any property of
* #GrlMedia has changed, or in case of #GrlMediaBox, if several children have
* been added and removed.
* @GRL_CONTENT_ADDED: new content has been added.
* @GRL_CONTENT_REMOVED: content has been removed
*
* Specifies which kind of change has happened in the plugin
*/
typedef enum {
GRL_CONTENT_CHANGED,
GRL_CONTENT_ADDED,
GRL_CONTENT_REMOVED,
} GrlMediaSourceChangeType;
/* GrlMediaSource object */
typedef struct _GrlMediaSource GrlMediaSource;
typedef struct _GrlMediaSourcePrivate GrlMediaSourcePrivate;
struct _GrlMediaSource {
GrlMetadataSource parent;
/*< private >*/
GrlMediaSourcePrivate *priv;
gpointer _grl_reserved[GRL_PADDING];
};
/* Callbacks for GrlMediaSource class */
/**
* GrlMediaSourceResultCb:
* @source: a media source
* @operation_id: operation identifier
* @media: (transfer full): a data transfer object
* @remaining: the number of remaining #GrlMedia to process, or
* GRL_SOURCE_REMAINING_UNKNOWN if it is unknown
* @user_data: user data passed to the used method
* @error: (type uint): possible #GError generated at processing
*
* Prototype for the callback passed to the media sources' methods
*/
typedef void (*GrlMediaSourceResultCb) (GrlMediaSource *source,
guint operation_id,
GrlMedia *media,
guint remaining,
gpointer user_data,
const GError *error);
/**
* GrlMediaSourceMetadataCb:
* @source: a media source
* @operation_id: operation identifier
* @media: (transfer full): a data transfer object
* @user_data: user data passed to grl_media_source_metadata()
* @error: (type uint): possible #GError generated at processing
*
* Prototype for the callback passed to grl_media_source_metadata()
*/
typedef void (*GrlMediaSourceMetadataCb) (GrlMediaSource *source,
guint operation_id,
GrlMedia *media,
gpointer user_data,
const GError *error);
/**
* GrlMediaSourceStoreCb:
* @source: a media source
* @parent: The #GrlMediaBox who parents the @media
* @media: (transfer full): a data transfer object
* @user_data: user data passed to grl_media_source_store()
* @error: (type uint): possible #GError generated at processing
*
* Prototype for the callback passed to grl_media_source_store()
*/
typedef void (*GrlMediaSourceStoreCb) (GrlMediaSource *source,
GrlMediaBox *parent,
GrlMedia *media,
gpointer user_data,
const GError *error);
/**
* GrlMediaSourceRemoveCb:
* @source: a media source
* @media: (transfer full): a data transfer object
* @user_data: user data passed to grl_media_source_remove()
* @error: (type uint): possible #GError generated at processing
*
* Prototype for the callback passed to grl_media_source_remove()
*/
typedef void (*GrlMediaSourceRemoveCb) (GrlMediaSource *source,
GrlMedia *media,
gpointer user_data,
const GError *error);
/* Types for MediaSourceClass */
/**
* GrlMediaSourceBrowseSpec:
* @source: a media source
* @browse_id: operation identifier
* @container: a container of data transfer objects
* @keys: the #GList of #GrlKeyID<!-- -->s to request
* @skip: the number if elements to skip in the browse operation
* @count: the number of elements to retrieve in the browse operation
* @flags: the resolution mode
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* browse vmethod.
*/
typedef struct {
GrlMediaSource *source;
guint browse_id;
GrlMedia *container;
GList *keys;
guint skip;
guint count;
GrlMetadataResolutionFlags flags;
GrlMediaSourceResultCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING];
} GrlMediaSourceBrowseSpec;
/**
* GrlMediaSourceSearchSpec:
* @source: a media source
* @search_id: operation identifier
* @text: the text to search
* @keys: the #GList of #GrlKeyID<!-- -->s to request
* @skip: the number if elements to skip in the browse operation
* @count: the number of elements to retrieve in the browse operation
* @flags: the resolution mode
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* search vmethod.
*/
typedef struct {
GrlMediaSource *source;
guint search_id;
gchar *text;
GList *keys;
guint skip;
guint count;
GrlMetadataResolutionFlags flags;
GrlMediaSourceResultCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING];
} GrlMediaSourceSearchSpec;
/**
* GrlMediaSourceQuerySpec:
* @source: a media source
* @query_id: operation identifier
* @query: the query to process
* @keys: the #GList of #GrlKeyID<!-- -->s to request
* @skip: the number if elements to skip in the browse operation
* @count: the number of elements to retrieve in the browse operation
* @flags: the resolution mode
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* query vmethod.
*/
typedef struct {
GrlMediaSource *source;
guint query_id;
gchar *query;
GList *keys;
guint skip;
guint count;
GrlMetadataResolutionFlags flags;
GrlMediaSourceResultCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING];
} GrlMediaSourceQuerySpec;
/**
* GrlMediaSourceMetadataSpec:
* @source: a media source
* @metadata_id: operation identifier
* @media: a data transfer object
* @keys: the #GList of #GrlKeyID<!-- -->s to request
* @flags: the resolution mode
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* metadata vmethod.
*/
typedef struct {
GrlMediaSource *source;
guint metadata_id;
GrlMedia *media;
GList *keys;
GrlMetadataResolutionFlags flags;
GrlMediaSourceMetadataCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING];
} GrlMediaSourceMetadataSpec;
/**
* GrlMediaSourceStoreSpec:
* @source: a media source
* @parent: a parent to store the data transfer objects
* @media: a data transfer object
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* store vmethod.
*/
typedef struct {
GrlMediaSource *source;
GrlMediaBox *parent;
GrlMedia *media;
GrlMediaSourceStoreCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING];
} GrlMediaSourceStoreSpec;
/**
* GrlMediaSourceRemoveSpec:
* @source: a media source
* @media_id: media identifier to remove
* @media: a data transfer object
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* store vmethod.
*/
typedef struct {
GrlMediaSource *source;
gchar *media_id;
GrlMedia *media;
GrlMediaSourceRemoveCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING];
} GrlMediaSourceRemoveSpec;
/**
* GrlMediaSourceMediaFromUriSpec:
* @source: a media source
* @media_from_uri_id: operation identifier
* @uri: A URI that can be used to identify a media resource
* @keys: Metadata keys to resolve
* @flags: Operation flags
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
* Data transport structure used internally by the plugins which support
* media_from_uri vmethod.
*/
typedef struct {
GrlMediaSource *source;
guint media_from_uri_id;
gchar *uri;
GList *keys;
GrlMetadataResolutionFlags flags;
GrlMediaSourceMetadataCb callback;
gpointer user_data;
/*< private >*/
gpointer _grl_reserved[GRL_PADDING - 1];
} GrlMediaSourceMediaFromUriSpec;
/* GrlMediaSource class */
typedef struct _GrlMediaSourceClass GrlMediaSourceClass;
/**
* GrlMediaSourceClass:
* @parent_class: the parent class structure
* @browse: browse through a list of media
* @search: search for media
* @query: query for a specific media
* @cancel: cancel the current operation
* @metadata: request for specific metadata
* @store: store a media in a container
* @remove: remove a media from a container
* @test_media_from_uri: tests if this source can create #GrlMedia
* instances from a given URI.
* @media_from_uri: Creates a #GrlMedia instance representing the media
* exposed by a certain URI.
* @notify_change_start: start emitting signals about changes in content
* @notify_change_stop: stop emitting signals about changes in content
*
* Grilo MediaSource class. Override the vmethods to implement the
* source functionality.
*/
struct _GrlMediaSourceClass {
GrlMetadataSourceClass parent_class;
void (*browse) (GrlMediaSource *source, GrlMediaSourceBrowseSpec *bs);
void (*search) (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss);
void (*query) (GrlMediaSource *source, GrlMediaSourceQuerySpec *qs);
void (*cancel) (GrlMediaSource *source, guint operation_id);
void (*metadata) (GrlMediaSource *source, GrlMediaSourceMetadataSpec *ms);
void (*store) (GrlMediaSource *source, GrlMediaSourceStoreSpec *ss);
void (*remove) (GrlMediaSource *source, GrlMediaSourceRemoveSpec *ss);
gboolean (*test_media_from_uri) (GrlMediaSource *source,
const gchar *uri);
void (*media_from_uri) (GrlMediaSource *source,
GrlMediaSourceMediaFromUriSpec *mfss);
gboolean (*notify_change_start) (GrlMediaSource *source,
GError **error);
gboolean (*notify_change_stop) (GrlMediaSource *source,
GError **error);
/*< private >*/
gpointer _grl_reserved[GRL_PADDING - 1];
};
G_BEGIN_DECLS
GType grl_media_source_get_type (void);
guint grl_media_source_browse (GrlMediaSource *source,
GrlMedia *container,
const GList *keys,
guint skip,
guint count,
GrlMetadataResolutionFlags flags,
GrlMediaSourceResultCb callback,
gpointer user_data);
GList *grl_media_source_browse_sync (GrlMediaSource *source,
GrlMedia *container,
const GList *keys,
guint skip,
guint count,
GrlMetadataResolutionFlags flags,
GError **error);
guint grl_media_source_search (GrlMediaSource *source,
const gchar *text,
const GList *keys,
guint skip,
guint count,
GrlMetadataResolutionFlags flags,
GrlMediaSourceResultCb callback,
gpointer user_data);
GList *grl_media_source_search_sync (GrlMediaSource *source,
const gchar *text,
const GList *keys,
guint skip,
guint count,
GrlMetadataResolutionFlags flags,
GError **error);
guint grl_media_source_query (GrlMediaSource *source,
const gchar *query,
const GList *keys,
guint skip,
guint count,
GrlMetadataResolutionFlags flags,
GrlMediaSourceResultCb callback,
gpointer user_data);
GList *grl_media_source_query_sync (GrlMediaSource *source,
const gchar *query,
const GList *keys,
guint skip,
guint count,
GrlMetadataResolutionFlags flags,
GError **error);
guint grl_media_source_metadata (GrlMediaSource *source,
GrlMedia *media,
const GList *keys,
GrlMetadataResolutionFlags flags,
GrlMediaSourceMetadataCb callback,
gpointer user_data);
GrlMedia *grl_media_source_metadata_sync (GrlMediaSource *source,
GrlMedia *media,
const GList *keys,
GrlMetadataResolutionFlags flags,
GError **error);
void grl_media_source_store (GrlMediaSource *source,
GrlMediaBox *parent,
GrlMedia *media,
GrlMediaSourceStoreCb callback,
gpointer user_data);
void grl_media_source_store_sync (GrlMediaSource *source,
GrlMediaBox *parent,
GrlMedia *media,
GError **error);
void grl_media_source_remove (GrlMediaSource *source,
GrlMedia *media,
GrlMediaSourceRemoveCb callback,
gpointer user_data);
void grl_media_source_remove_sync (GrlMediaSource *source,
GrlMedia *media,
GError **error);
G_GNUC_DEPRECATED void grl_media_source_cancel (GrlMediaSource *source, guint operation_id);
G_GNUC_DEPRECATED void grl_media_source_set_operation_data (GrlMediaSource *source,
guint operation_id,
gpointer data);
G_GNUC_DEPRECATED gpointer grl_media_source_get_operation_data (GrlMediaSource *source,
guint operation_id);
void grl_media_source_set_auto_split_threshold (GrlMediaSource *source,
guint threshold);
guint grl_media_source_get_auto_split_threshold (GrlMediaSource *source);
gboolean grl_media_source_test_media_from_uri (GrlMediaSource *source,
const gchar *uri);
guint grl_media_source_get_media_from_uri (GrlMediaSource *source,
const gchar *uri,
const GList *keys,
GrlMetadataResolutionFlags flags,
GrlMediaSourceMetadataCb callback,
gpointer user_data);
GrlMedia *grl_media_source_get_media_from_uri_sync (GrlMediaSource *source,
const gchar *uri,
const GList *keys,
GrlMetadataResolutionFlags flags,
GError **error);
gboolean grl_media_source_notify_change_start (GrlMediaSource *source,
GError **error);
gboolean grl_media_source_notify_change_stop (GrlMediaSource *source,
GError **error);
void grl_media_source_notify_change_list (GrlMediaSource *source,
GPtrArray *changed_medias,
GrlMediaSourceChangeType change_type,
gboolean location_unknown);
void grl_media_source_notify_change (GrlMediaSource *source,
GrlMedia *media,
GrlMediaSourceChangeType change_type,
gboolean location_unknown);
G_END_DECLS
#endif /* _GRL_MEDIA_SOURCE_H_ */
|