2
* Copyright (C) 2012 Bastien Nocera <hadess@hadess.net>
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
* The Totem project hereby grant permission for non-gpl compatible GStreamer
20
* plugins to be used and distributed together with GStreamer and Totem. This
21
* permission are above and beyond the permissions granted by the GPL license
22
* Totem is covered by.
24
* Monday 7th February 2005: Christian Schaller: Add exception clause.
25
* See license_change file for details.
32
#include <glib-object.h>
34
#include "totem-plugin.h"
37
#define TOTEM_TYPE_APPLE_TRAILERS_PLUGIN (totem_apple_trailers_plugin_get_type ())
38
#define TOTEM_APPLE_TRAILERS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TOTEM_TYPE_APPLE_TRAILERS_PLUGIN, TotemAppleTrailersPlugin))
43
} TotemAppleTrailersPluginPrivate;
45
TOTEM_PLUGIN_REGISTER(TOTEM_TYPE_APPLE_TRAILERS_PLUGIN, TotemAppleTrailersPlugin, totem_apple_trailers_plugin)
48
get_user_agent_cb (TotemObject *totem,
51
if (g_str_has_prefix (mrl, "http://movies.apple.com") ||
52
g_str_has_prefix (mrl, "http://trailers.apple.com"))
53
return g_strdup ("Quicktime/7.2.0");
58
impl_activate (PeasActivatable *plugin)
60
TotemAppleTrailersPlugin *pi = TOTEM_APPLE_TRAILERS_PLUGIN (plugin);
62
pi->priv->totem = g_object_ref (g_object_get_data (G_OBJECT (plugin), "object"));
63
pi->priv->signal_id = g_signal_connect (G_OBJECT (pi->priv->totem), "get-user-agent",
64
G_CALLBACK (get_user_agent_cb), NULL);
68
impl_deactivate (PeasActivatable *plugin)
70
TotemAppleTrailersPlugin *pi = TOTEM_APPLE_TRAILERS_PLUGIN (plugin);
72
if (pi->priv->signal_id) {
73
g_signal_handler_disconnect (pi->priv->totem, pi->priv->signal_id);
74
pi->priv->signal_id = 0;
77
if (pi->priv->totem) {
78
g_object_unref (pi->priv->totem);
79
pi->priv->totem = NULL;