本文整理汇总了C++中GRL_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ GRL_DEBUG函数的具体用法?C++ GRL_DEBUG怎么用?C++ GRL_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GRL_DEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: produce_from_recent_theme
static void
produce_from_recent_theme (RaitvOperation *op)
{
guint category_index;
gchar *start = NULL;
gchar *url = NULL;
GrlRaitvSource *source = GRL_RAITV_SOURCE (op->source);
category_index = get_theme_index_from_id (op->container_id);
GRL_DEBUG ("produce_from_recent_theme (container_id=%s, category_index=%d",op->container_id,category_index);
start = g_strdup_printf ("%u", op->offset+op->length);
op->category_info = &themes_dir[category_index];
url = g_strdup_printf (RAITV_VIDEO_RECENT, start, op->category_info->tags, op->category_info->excludeTags);
GRL_DEBUG ("Starting browse request for recent theme (%s)", url);
grl_net_wc_request_async (source->priv->wc,
url,
op->cancellable,
proxy_call_browse_grlnet_async_cb,
op);
g_free (url);
}
示例2: create_media_from_mount
static GrlMedia *
create_media_from_mount (GMount *mount)
{
char *id;
GrlMedia *media;
/* Is it an audio CD or a blank media */
if (ignore_mount (mount)) {
GRL_DEBUG ("%s: Ignoring mount %s", __FUNCTION__,
g_mount_get_name (mount));
g_object_unref (mount);
return NULL;
}
id = create_mount_id (mount);
if (id == NULL) {
GRL_DEBUG ("%s: Not adding mount %s as has no device path", __FUNCTION__,
g_mount_get_name (mount));
return NULL;
}
media = grl_media_video_new ();
grl_media_set_id (media, id);
g_free (id);
media_set_metadata (mount, media);
grl_media_set_mime (media, "x-special/device-block");
GRL_DEBUG ("%s: Adding mount %s (id: %s)", __FUNCTION__,
g_mount_get_name (mount), grl_media_get_id (media));
return media;
}
示例3: server_lost_cb
static void
server_lost_cb (GrlDleynaServersManager *serversmgr,
GrlDleynaServer *server,
gpointer *user_data)
{
GrlDleynaMediaDevice *device;
GrlSource *source;
GrlRegistry *registry;
const gchar* udn;
gchar *source_id;
GRL_DEBUG (G_STRFUNC);
device = grl_dleyna_server_get_media_device (server);
udn = grl_dleyna_media_device_get_udn (device);
GRL_DEBUG ("%s udn: %s ", G_STRFUNC, udn);
registry = grl_registry_get_default ();
source_id = grl_dleyna_source_build_id (udn);
GRL_DEBUG ("%s id: %s ", G_STRFUNC, source_id);
source = grl_registry_lookup_source (registry, source_id);
if (source != NULL) {
GError *error = NULL;
GRL_DEBUG ("%s unregistered %s", G_STRFUNC, source_id);
grl_registry_unregister_source (registry, source, &error);
if (error != NULL) {
GRL_WARNING ("Failed to unregister source %s: %s", udn, error->message);
g_error_free (error);
}
}
g_free (source_id);
}
示例4: server_found_cb
static void
server_found_cb (GrlDleynaServersManager *serversmgr,
GrlDleynaServer *server,
gpointer *user_data)
{
GrlPlugin *plugin = GRL_PLUGIN (user_data);
GrlDleynaMediaDevice *device;
GrlSource *source;
GrlRegistry *registry;
GError *error = NULL;
GRL_DEBUG (G_STRFUNC);
device = grl_dleyna_server_get_media_device (server);
GRL_DEBUG ("%s udn: %s ", G_STRFUNC, grl_dleyna_media_device_get_udn (device));
registry = grl_registry_get_default ();
source = GRL_SOURCE (grl_dleyna_source_new (server));
GRL_DEBUG ("%s id: %s ", G_STRFUNC, grl_source_get_id (source));
grl_registry_register_source (registry, plugin, GRL_SOURCE (source), &error);
if (error != NULL) {
GRL_WARNING ("Failed to register source for DLNA device %s: %s",
grl_dleyna_media_device_get_udn (device), error->message);
g_error_free (error);
}
}
示例5: tracker_evt_update_items_cb
static void
tracker_evt_update_items_cb (gpointer key,
gpointer value,
tracker_evt_update_t *evt)
{
guint id = GPOINTER_TO_INT (key);
gchar *str_id;
GrlTrackerSource *source = (GrlTrackerSource *) value;
GrlMedia *media;
GRL_DEBUG ("%s: evt=%p", __FUNCTION__, evt);
if (!source) {
g_assert ("\tnot in cache ???");
return;
}
if (!grl_tracker_source_can_notify (source)) {
GRL_DEBUG ("\tno notification for source %s...",
grl_source_get_name (GRL_SOURCE (source)));
return;
}
media = grl_media_new ();
str_id = g_strdup_printf ("%i", id);
grl_media_set_id (media, str_id);
g_free (str_id);
GRL_DEBUG ("\tNotify id=%u source=%s", id,
grl_source_get_name (GRL_SOURCE (source)));
grl_source_notify_change (GRL_SOURCE (source), media, evt->change_type, FALSE);
g_object_unref (media);
}
示例6: ignore_drive
static gboolean
ignore_drive (GDrive *drive)
{
GIcon *icon;
if (g_drive_can_eject (drive) == FALSE ||
g_drive_has_media (drive) == FALSE) {
GRL_DEBUG ("%s: Not adding %s as cannot eject or has no media", __FUNCTION__,
g_drive_get_name (drive));
return TRUE;
}
/* Hack to avoid USB devices showing up
* https://bugzilla.gnome.org/show_bug.cgi?id=679624 */
icon = g_drive_get_icon (drive);
if (icon && G_IS_THEMED_ICON (icon)) {
const gchar * const * names;
names = g_themed_icon_get_names (G_THEMED_ICON (icon));
if (names && names[0] && !g_str_has_prefix (names[0], "drive-optical")) {
g_object_unref (icon);
GRL_DEBUG ("%s: Not adding drive %s as is not optical drive", __FUNCTION__,
g_drive_get_name (drive));
return TRUE;
}
}
g_clear_object (&icon);
return FALSE;
}
示例7: grl_metadata_store_source_init
static void
grl_metadata_store_source_init (GrlMetadataStoreSource *source)
{
gint r;
gchar *path;
gchar *db_path;
gchar *sql_error = NULL;
source->priv = GRL_METADATA_STORE_GET_PRIVATE (source);
path = g_strconcat (g_get_user_data_dir (),
G_DIR_SEPARATOR_S, "grilo-plugins",
NULL);
if (!g_file_test (path, G_FILE_TEST_IS_DIR)) {
g_mkdir_with_parents (path, 0775);
}
GRL_DEBUG ("Opening database connection...");
db_path = g_strconcat (path, G_DIR_SEPARATOR_S, GRL_SQL_DB, NULL);
r = sqlite3_open (db_path, &source->priv->db);
g_free (path);
if (r) {
g_critical ("Failed to open database '%s': %s",
db_path, sqlite3_errmsg (source->priv->db));
sqlite3_close (source->priv->db);
g_free (db_path);
return;
}
g_free (db_path);
GRL_DEBUG (" OK");
GRL_DEBUG ("Checking database tables...");
r = sqlite3_exec (source->priv->db, GRL_SQL_CREATE_TABLE_STORE,
NULL, NULL, &sql_error);
if (r) {
if (sql_error) {
GRL_WARNING ("Failed to create database tables: %s", sql_error);
g_clear_pointer (&sql_error, sqlite3_free);
} else {
GRL_WARNING ("Failed to create database tables.");
}
sqlite3_close (source->priv->db);
return;
}
// For backwards compatibility, add newer columns if they don't exist
// in the old database.
sqlite3_exec (source->priv->db, GRL_SQL_ALTER_TABLE_ADD_FAVOURITE,
NULL, NULL, &sql_error);
sqlite3_exec (source->priv->db, GRL_SQL_ALTER_TABLE_ADD_TYPE_ID,
NULL, NULL, &sql_error);
GRL_DEBUG (" OK");
}
示例8: grl_magnatune_source_init
static void
grl_magnatune_source_init(GrlMagnatuneSource *source)
{
gint ret;
gchar *path;
gchar *db_path;
gchar *crc_path;
gchar *new_db_path;
gchar *new_crc_path;
GRL_DEBUG("magnatune_source_init");
source->priv = GRL_MAGNATUNE_GET_PRIVATE(source);
source->priv->db = NULL;
path = g_build_filename(g_get_user_data_dir(), "grilo-plugins", NULL);
db_path = g_build_filename(path, GRL_SQL_DB, NULL);
crc_path = g_build_filename(path, GRL_SQL_CRC, NULL);
new_db_path = g_build_filename(path, GRL_SQL_NEW_DB, NULL);
new_crc_path = g_build_filename(path, GRL_SQL_NEW_CRC, NULL);
if(!g_file_test(path, G_FILE_TEST_IS_DIR)) {
g_mkdir_with_parents(path, 0775);
}
if (g_file_test(db_path, G_FILE_TEST_EXISTS) == TRUE) {
if (g_file_test(new_db_path, G_FILE_TEST_EXISTS) == TRUE
&& g_rename(new_db_path, db_path) == 0) {
GRL_DEBUG("New database in use.");
}
if (g_file_test(new_crc_path, G_FILE_TEST_EXISTS) == TRUE
&& g_rename(new_crc_path, crc_path) == 0) {
GRL_DEBUG("New crc file in use.");
}
GRL_DEBUG("Opening database connection.");
ret = sqlite3_open(db_path, &source->priv->db);
if (ret != SQLITE_OK) {
GRL_WARNING("Failed to open database '%s': %s",
db_path,
sqlite3_errmsg(source->priv->db));
sqlite3_close(source->priv->db);
source->priv->db = NULL;
}
} else {
GRL_DEBUG("No database was found. Download when user interact.");
}
g_free(new_crc_path);
g_free(new_db_path);
g_free(crc_path);
g_free(db_path);
g_free(path);
}
示例9: on_configuration_ready
static void
on_configuration_ready (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
ResolveClosure *closure = (ResolveClosure *) user_data;
GrlTmdbRequest *request = GRL_TMDB_REQUEST (source);
GrlTmdbSource *self = closure->self;
GError *error = NULL;
GValue *value;
GRL_DEBUG ("Configuration request ready...");
if (!grl_tmdb_request_run_finish (GRL_TMDB_REQUEST (source),
result,
&error)) {
resolve_closure_callback (closure, error);
resolve_closure_free (closure);
/* Notify pending requests about failure */
while (!g_queue_is_empty (self->priv->pending_resolves)) {
ResolveClosure *pending_closure;
pending_closure = g_queue_pop_head (self->priv->pending_resolves);
resolve_closure_callback (pending_closure, error);
resolve_closure_free (pending_closure);
}
g_error_free (error);
return;
}
self->priv->configuration = g_object_ref (request);
remove_request (closure, request);
value = grl_tmdb_request_get (request, "$.images.base_url");
if (value != NULL) {
GRL_DEBUG ("Got TMDb configuration.");
self->priv->image_base_uri = soup_uri_new (g_value_get_string (value));
g_value_unset (value);
g_free (value);
}
g_queue_push_head (self->priv->pending_resolves, closure);
/* Flush queue. GrlNetWc will take care of throttling */
while (!g_queue_is_empty (self->priv->pending_resolves)) {
ResolveClosure *pending_closure;
pending_closure = g_queue_pop_head (self->priv->pending_resolves);
run_pending_requests (pending_closure, G_MAXINT);
}
}
示例10: grl_bookmarks_source_query
static void
grl_bookmarks_source_query (GrlSource *source,
GrlSourceQuerySpec *qs)
{
GRL_DEBUG ("grl_bookmarks_source_query");
GrlBookmarksSource *bookmarks_source;
OperationSpec *os;
GError *error = NULL;
bookmarks_source = GRL_BOOKMARKS_SOURCE (source);
if (!bookmarks_source->priv->adapter) {
GRL_WARNING ("Can't execute operation: no database connection.");
error = g_error_new_literal (GRL_CORE_ERROR,
GRL_CORE_ERROR_QUERY_FAILED,
_("No database connection"));
qs->callback (qs->source, qs->operation_id, NULL, 0, qs->user_data, error);
g_error_free (error);
}
os = g_slice_new0 (OperationSpec);
os->source = qs->source;
os->operation_id = qs->operation_id;
os->count = grl_operation_options_get_count (qs->options);
os->skip = grl_operation_options_get_skip (qs->options);
os->type_filter = grl_operation_options_get_type_filter (qs->options);
os->callback = qs->callback;
os->user_data = qs->user_data;
os->error_code = GRL_CORE_ERROR_SEARCH_FAILED;
produce_bookmarks_from_query (os, qs->query);
}
示例11: ignore_mount
static gboolean
ignore_mount (GMount *mount)
{
GFile *root;
GVolume *volume;
gboolean ret = TRUE;
root = g_mount_get_root (mount);
if (g_file_has_uri_scheme (root, "burn") != FALSE || g_file_has_uri_scheme (root, "cdda") != FALSE) {
/* We don't add Audio CDs, or blank media */
g_object_unref (root);
GRL_DEBUG ("%s: Not adding mount %s as is burn or cdda", __FUNCTION__,
g_mount_get_name (mount));
return TRUE;
}
g_object_unref (root);
volume = g_mount_get_volume (mount);
if (volume == NULL)
return ret;
ret = ignore_volume (volume);
g_object_unref (volume);
return ret;
}
示例12: produce_bookmarks_from_text
static void
produce_bookmarks_from_text (OperationSpec *os, const gchar *text)
{
GomFilter *like1, *like2, *likes, *type1, *filter;
GValue value = { 0, };
GRL_DEBUG ("produce_bookmarks_from_text");
/* WHERE (title LIKE '%text%' OR desc LIKE '%text%') AND type == BOOKMARKS_TYPE_STREAM */
like1 = substr_filter ("title", text);
like2 = substr_filter ("desc", text);
likes = gom_filter_new_or (like1, like2);
g_object_unref (like1);
g_object_unref (like2);
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, BOOKMARKS_TYPE_STREAM);
type1 = gom_filter_new_eq (BOOKMARKS_TYPE_RESOURCE, "type", &value);
g_value_unset (&value);
filter = gom_filter_new_and (likes, type1);
g_object_unref (likes);
g_object_unref (type1);
produce_bookmarks_from_filter (os, filter);
g_object_unref (filter);
}
示例13: grl_bookmarks_source_browse
static void
grl_bookmarks_source_browse (GrlSource *source,
GrlSourceBrowseSpec *bs)
{
GRL_DEBUG ("grl_bookmarks_source_browse");
OperationSpec *os;
GrlBookmarksSource *bookmarks_source;
GError *error = NULL;
bookmarks_source = GRL_BOOKMARKS_SOURCE (source);
if (!bookmarks_source->priv->adapter) {
GRL_WARNING ("Can't execute operation: no database connection.");
error = g_error_new_literal (GRL_CORE_ERROR,
GRL_CORE_ERROR_BROWSE_FAILED,
_("No database connection"));
bs->callback (bs->source, bs->operation_id, NULL, 0, bs->user_data, error);
g_error_free (error);
}
/* Configure browse operation */
os = g_slice_new0 (OperationSpec);
os->source = bs->source;
os->operation_id = bs->operation_id;
os->media_id = grl_media_get_id (bs->container);
os->count = grl_operation_options_get_count (bs->options);
os->skip = grl_operation_options_get_skip (bs->options);
os->type_filter = grl_operation_options_get_type_filter (bs->options);
os->callback = bs->callback;
os->user_data = bs->user_data;
os->error_code = GRL_CORE_ERROR_BROWSE_FAILED;
produce_bookmarks_from_category (os, os->media_id ? os->media_id : "0");
}
示例14: grl_dleyna_plugin_deinit
static void
grl_dleyna_plugin_deinit (GrlPlugin *plugin)
{
GRL_DEBUG (G_STRFUNC);
g_clear_object (&servers);
}
示例15: grl_dpap_source_new
static GrlDpapSource *
grl_dpap_source_new (DMAPMdnsBrowserService *service)
{
gchar *source_desc;
gchar *source_id;
GrlDpapSource *source;
GRL_DEBUG ("grl_dpap_source_new");
source_desc = g_strdup_printf (SOURCE_DESC_TEMPLATE, service->name);
source_id = g_strdup_printf (SOURCE_ID_TEMPLATE, service->name);
source = g_object_new (GRL_DPAP_SOURCE_TYPE,
"source-id", source_id,
"source-name", service->name,
"source-desc", source_desc,
"supported-media", GRL_SUPPORTED_MEDIA_IMAGE,
NULL);
source->priv->service = service;
g_free (source_desc);
g_free (source_id);
return source;
}