~ubuntu-branches/ubuntu/precise/tumbler/precise

« back to all changes in this revision

Viewing changes to plugins/ffmpeg-thumbnailer/ffmpeg-thumbnailer-plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2010-11-07 16:34:58 UTC
  • Revision ID: james.westby@ubuntu.com-20101107163458-skwfq34vnuavipne
Tags: upstream-0.1.4
ImportĀ upstreamĀ versionĀ 0.1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* vi:set et ai sw=2 sts=2 ts=2: */
 
2
/*-
 
3
 * Copyright (c) 2009 Jannis Pohlmann <jannis@xfce.org>
 
4
 * Copyright (c) 2010 Lionel Le Folgoc <mrpouit@ubuntu.com>
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU Library General Public
 
8
 * License as published by the Free Software Foundation; either
 
9
 * version 2 of the License, or (at your option) any later version.
 
10
 *
 
11
 * This library is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 
14
 * GNU Library General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Library General 
 
17
 * Public License along with this library; if not, write to the 
 
18
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
19
 * Boston, MA 02110-1301, USA.
 
20
 */
 
21
 
 
22
#ifdef HAVE_CONFIG_H
 
23
#include <config.h>
 
24
#endif
 
25
 
 
26
#include <glib.h>
 
27
#include <glib/gi18n.h>
 
28
#include <glib-object.h>
 
29
 
 
30
#include <tumbler/tumbler.h>
 
31
 
 
32
#include <ffmpeg-thumbnailer/ffmpeg-thumbnailer-provider.h>
 
33
#include <ffmpeg-thumbnailer/ffmpeg-thumbnailer.h>
 
34
 
 
35
 
 
36
 
 
37
G_MODULE_EXPORT void tumbler_plugin_initialize (TumblerProviderPlugin *plugin);
 
38
G_MODULE_EXPORT void tumbler_plugin_shutdown   (void);
 
39
G_MODULE_EXPORT void tumbler_plugin_get_types  (const GType          **types,
 
40
                                                gint                  *n_types);
 
41
 
 
42
 
 
43
 
 
44
static GType type_list[1];
 
45
 
 
46
 
 
47
 
 
48
void
 
49
tumbler_plugin_initialize (TumblerProviderPlugin *plugin)
 
50
{
 
51
  const gchar *mismatch;
 
52
 
 
53
  /* verify that the tumbler versions are compatible */
 
54
  mismatch = tumbler_check_version (TUMBLER_MAJOR_VERSION, TUMBLER_MINOR_VERSION,
 
55
                                    TUMBLER_MICRO_VERSION);
 
56
  if (G_UNLIKELY (mismatch != NULL))
 
57
    {
 
58
      g_warning (_("Version mismatch: %s"), mismatch);
 
59
      return;
 
60
    }
 
61
 
 
62
#ifdef DEBUG
 
63
  g_message (_("Initializing the Tumbler ffmpeg video thumbnailer plugin"));
 
64
#endif
 
65
 
 
66
  /* register the types provided by this plugin */
 
67
  ffmpeg_thumbnailer_register (plugin);
 
68
  ffmpeg_thumbnailer_provider_register (plugin);
 
69
 
 
70
  /* set up the plugin provider type list */
 
71
  type_list[0] = TYPE_FFMPEG_THUMBNAILER_PROVIDER;
 
72
}
 
73
 
 
74
 
 
75
 
 
76
void
 
77
tumbler_plugin_shutdown (void)
 
78
{
 
79
#ifdef DEBUG
 
80
  g_message (_("Shutting down the Tumbler ffmpeg video thumbnailer plugin"));
 
81
#endif
 
82
}
 
83
 
 
84
 
 
85
 
 
86
void
 
87
tumbler_plugin_get_types (const GType **types,
 
88
                          gint         *n_types)
 
89
{
 
90
  *types = type_list;
 
91
  *n_types = G_N_ELEMENTS (type_list);
 
92
}