Commit 3353323b authored by Bastien Nocera's avatar Bastien Nocera

Remove the "Complex" (Real Media compatible) browser plugin

Because it was broken, and nobody in their right minds still
use Real stuff. Desperate people can probably use the HelixPlayer,
though it won't play anything interesting.
parent 99a02e3d
......@@ -195,66 +195,6 @@ libtotem_gmp_plugin_la_LDFLAGS = \
endif
# Totem Complex Plugin
if ENABLE_COMPLEX_PLUGIN
plugin_LTLIBRARIES += libtotem-complex-plugin.la
libtotem_complex_plugin_la_SOURCES = \
npapi.h \
npruntime.h \
npupp.h \
totemNPNGlue.cpp \
totemNPClass.cpp \
totemNPClass.h \
totemNPObject.cpp \
totemNPObject.h \
totemNPObjectWrapper.h \
totemNPVariantWrapper.h \
totemPluginGlue.cpp \
totemPlugin.cpp \
totemPlugin.h \
totemComplexPlugin.cpp \
totemComplexPlugin.h \
totem-plugin-viewer-constants.h
libtotem_complex_plugin_la_CPPFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/backend \
-I$(top_builddir)/src \
-I$(top_builddir)/src/backend \
-DXP_UNIX \
-DMOZ_X11 \
-DTOTEM_COMPLEX_PLUGIN \
-DTOTEM_PL_PARSER_MINI \
-D_REENTRANT \
-DDBUS_API_SUBJECT_TO_CHANGE \
-DSYSCONFDIR="\"$(sysconfdir)\"" \
-DLIBEXECDIR="\"$(libexecdir)\"" \
$(DISABLE_DEPRECATED) \
$(AM_CPPFLAGS)
libtotem_complex_plugin_la_CXXFLAGS = \
$(BROWSER_PLUGIN_CFLAGS) \
$(DBUS_CFLAGS) \
$(WARN_CXXFLAGS) \
$(PLUGIN_EXTRA_WARN_CXXFLAGS) \
$(AM_CXXFLAGS)
libtotem_complex_plugin_la_LIBADD = \
libtotembrowserplugin_helper.la \
$(DBUS_LIBS) \
$(BROWSER_PLUGIN_LIBS)
libtotem_complex_plugin_la_LDFLAGS = \
-avoid-version \
-export-symbols $(srcdir)/plugin.symbols \
-module \
$(AM_LDFLAGS)
endif
# Totem NarrowSpace Plugin
if ENABLE_NARROWSPACE_PLUGIN
......
......@@ -40,20 +40,6 @@ setting. Bear in mind that Firefox/Seamonkey might not re-read the plugin list
once it's been cached. You might have to remove the pluginreg.dat from the Mozilla
profile directory.
Special topics: Complex plugin
==============================
The complex plugin supports multiple plugins working together, see
[http://service.real.com/help/library/guides/realone/ProductionGuide/HTML/realpgd.htm?page=htmfiles/embed.htm].
To implement this, we maintain a list of totem complex plugins.
The plugins are partitioned into classes by their 'console' name; and a
random plugin (well, the first one instantiated) is chosen as representant.
This one owns the plugin viewer and all viewer interaction of the linked plugins
are done trough it. When this plugin is destroyed, we search for a new
representant, transfer the viewer ownership to it and update the representant
pointer in all of the classes' plugins.
Special topics: NarrowSpace plugin
==================================
......
......@@ -12,9 +12,3 @@ Plugin:
- invert DBUS-OpenStream/NPN_GetURL order: this is necessary so we can push the real stream URI
to the viewer (for use as base uri for redirects)
Complex plugin:
- write IDL file (nsIHXPlayer.idl available, but incompatible with totem's
licence exception; is the exception needed for the *plugin* itself?)
- implement the various 'controls' types in the viewer
- in the viewer, cope with the 'main' window being removed? (maybe reparent to a hidden window)
/*
* Copyright © 2007 Bastien Nocera <hadess@hadess.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#include "nsISupports.idl"
/* Documentation from
* http://service.real.com/help/library/guides/realonescripting/browse/htmfiles/embedmet.htm */
[scriptable, uuid(2f71a310-75d5-44f8-b6d2-60bd2976550b)]
interface totemIComplexPlayer: nsISupports
{
boolean CanPause ();
boolean CanPlay ();
boolean CanStop ();
void DoGotoURL (in AUTF8String url, in AUTF8String target);
boolean DoNextEntry ();
boolean DoPause ();
boolean DoPlay ();
boolean DoPrevEntry ();
boolean DoStop ();
AUTF8String GetAuthor ();
boolean GetAutoGoToURL ();
boolean GetAutoStart ();
ACString GetBackgroundColor ();
long GetBandwidthAverage ();
long GetBandwidthCurrent ();
long GetBufferingTimeElapsed ();
long GetBufferingTimeRemaining ();
boolean GetCanSeek ();
boolean GetCenter ();
long GetClipHeight ();
long GetClipWidth ();
long GetConnectionBandwidth ();
AUTF8String GetConsole ();
boolean GetConsoleEvents ();
AUTF8String GetControls ();
AUTF8String GetCopyright ();
long GetCurrentEntry ();
AUTF8String GetDRMInfo (in ACString identifier);
boolean GetDoubleSize ();
AUTF8String GetEntryAbstract (in long entry_index);
AUTF8String GetEntryAuthor (in long entry_index);
AUTF8String GetEntryCopyright (in long entry_index);
AUTF8String GetEntryTitle (in long entry_index);
boolean GetFullScreen ();
boolean GetImageStatus ();
AUTF8String GetLastErrorMoreInfoURL ();
long GetLastErrorRMACode ();
long GetLastErrorSeverity ();
long GetLastErrorUserCode ();
AUTF8String GetLastErrorUserString ();
AUTF8String GetLastMessage ();
AUTF8String GetLastStatus ();
long GetLength ();
boolean GetLiveState ();
boolean GetLoop ();
boolean GetMaintainAspect ();
boolean GetMute ();
long GetNumEntries ();
long GetNumLoop ();
long GetNumSources ();
boolean GetOriginalSize ();
long GetPacketsEarly ();
long GetPacketsLate ();
long GetPacketsMissing ();
long GetPacketsOutOfOrder ();
long GetPacketsReceived ();
long GetPacketsTotal ();
long GetPlayState ();
long GetPosition ();
boolean GetPreFetch ();
boolean GetShowAbout ();
boolean GetShowPreferences ();
boolean GetShowStatistics ();
boolean GetShuffle ();
AUTF8String GetSource ();
ACString GetSourceTransport (in long source_number);
boolean GetStereoState ();
AUTF8String GetTitle ();
ACString GetVersionInfo ();
long GetVolume ();
boolean GetWantErrors ();
boolean GetWantKeyboardEvents ();
boolean GetWantMouseEvents ();
boolean HasNextEntry ();
boolean HasPrevEntry ();
boolean SetAuthor (in AUTF8String new_author);
boolean SetAutoGoToURL (in boolean enable_start);
boolean SetAutoStart (in boolean auto_start);
boolean SetBackgroundColor (in ACString color);
boolean SetCanSeek (in boolean can_seek);
boolean SetCenter (in boolean value);
boolean SetConsole (in AUTF8String console);
boolean SetConsoleEvents (in boolean value);
boolean SetControls (in AUTF8String controls);
boolean SetCopyright (in AUTF8String copyright);
boolean SetDoubleSize ();
boolean SetFullScreen ();
boolean SetImageStatus (in boolean enabled);
boolean SetLoop (in boolean set);
boolean SetMaintainAspect (in boolean set);
boolean SetMute (in boolean mute);
boolean SetNumLoop (in long number_of_loops);
boolean SetOriginalSize ();
boolean SetPosition (in long position);
boolean SetPreFetch (in boolean set);
boolean SetShowAbout (in boolean set);
boolean SetShowPreferences (in boolean set);
boolean SetShowStatistics (in boolean set);
boolean SetShuffle (in boolean set);
boolean SetSource (in AUTF8String source);
boolean SetTitle (in AUTF8String title);
void SetVolume (in long volume);
boolean SetWantErrors (in boolean set);
boolean SetWantKeyboardEvents (in boolean set);
boolean SetWantMouseEvents (in boolean set);
/* Additional Helix/non-embedded player functions.
* Non-obsolete: http://service.real.com/help/library/guides/extend/htmfiles/appe_com.htm
* Documented at:
* http://service.real.com/help/library/guides/extend/htmfiles/appa_met.htm */
boolean GetEnableContextMenu ();
boolean GetEnableDoubleSize ();
boolean GetEnableFullScreen ();
boolean GetEnableOriginalSize ();
boolean GetIsPlus ();
boolean GetNoLogo ();
long GetPreferedLanguageID ();
long GetPreferredLanguageID ();
AUTF8String GetPreferedLanguageString ();
AUTF8String GetPreferredLanguageString ();
long GetUserCountryID ();
boolean SetEnableContextMenu (in boolean menu_on);
boolean SetEnableDoubleSize (in boolean enabled);
boolean SetEnableFullScreen (in boolean enabled);
boolean SetEnableOriginalSize (in boolean enabled);
boolean SetNoLogo (in boolean set);
/* Signals, documented at:
* http://service.real.com/help/library/guides/realonescripting/browse/htmfiles/embedcal.htm
*
* void OnAuthorChange (in AUTF8String author);
* void OnBuffering (in long flags, in long percent_complete);
* void OnClipClosed (void);
* void onClipClosed (void);
* void OnClipOpened (in AUTF8String short_clip_name, in AUTF8String url);
* void onClipOpened (in AUTF8String short_clip_name, in AUTF8String url);
* void OnContacting (in AUTF8String host_name);
* void OnCopyrightChange (in AUTF8String copyright);
* void OnErrorMessage (in short severity, in long rma_code, in long user_code, in AUTF8String user_string, in AUTF8String more_info_url, in AUTF8String error);
* void OnGotoURL (in AUTF8String url, in AUTF8String target);
* void onGotoURL (in AUTF8String url, in AUTF8String target);
* void OnKeyDown (in long key);
* void OnKeyPress (in long key);
* void OnKeyUp (in long key);
* void OnLButtonDown (in long button_flags, in long x_pos, in long y_pos);
* void OnLButtonUp (in long button_flags, in long x_pos, in long y_pos);
* void OnMouseMove (in long button_flags, in long x_pos, in long y_pos);
* void OnMuteChange (in boolean mute);
* void OnPlayStateChange (in long old_state, in long new_state);
* void OnPosLength (in long pos, in long len);
* void OnPositionChange (in long pos, in long len);
* void OnPostSeek (in long old_time, in long new_time);
* void OnPreFetchComplete ();
* void OnPreSeek (in long old_time, in long new_time);
* void OnPresentationClosed ();
* void OnPresentationOpened ();
* void OnRButtonDown (in long button_flags, in long x_pos, in long y_pos);
* void OnRButtonUp (in long button_flags, in long x_pos, in long y_pos);
* void OnShowStatus (in AUTF8String status_text);
* void onShowStatus (in AUTF8String status_text);
* void OnStateChange (in long old_state, in long new_state);
* void OnTitleChange (in AUTF8String title);
* void OnVolumeChange (in long new_volume);
*/
};
......@@ -76,7 +76,6 @@ char * totem_pl_parser_resolve_uri (GFile *base_gfile, const char *relative_uri)
typedef enum {
TOTEM_PLUGIN_TYPE_GMP,
TOTEM_PLUGIN_TYPE_COMPLEX,
TOTEM_PLUGIN_TYPE_NARROWSPACE,
TOTEM_PLUGIN_TYPE_MULLY,
TOTEM_PLUGIN_TYPE_CONE,
......@@ -1971,29 +1970,6 @@ totem_embedded_construct (TotemEmbedded *emb,
return TRUE;
}
static gboolean
totem_embedded_construct_placeholder (TotemEmbedded *emb,
GdkNativeWindow xid,
int width,
int height)
{
GtkWidget *window, *label;
if (xid == 0)
return TRUE;
window = gtk_plug_new (xid);
/* FIXME why? */
gtk_widget_realize (window);
label = gtk_label_new ("Not yet supported");
gtk_container_add (GTK_CONTAINER (window), label);
gtk_widget_show_all (window);
return TRUE;
}
static gboolean
totem_embedded_set_window (TotemEmbedded *embedded,
const char *controls,
......@@ -2004,22 +1980,13 @@ totem_embedded_set_window (TotemEmbedded *embedded,
{
g_print ("Viewer: SetWindow XID %u size %d:%d\n", window, width, height);
if (embedded->type == TOTEM_PLUGIN_TYPE_COMPLEX) {
/* FIXME!!! */
if (strcmp (controls, "All") != 0 &&
strcmp (controls, "ImageWindow") != 0) {
totem_embedded_construct_placeholder (embedded, (GdkNativeWindow) window, width, height);
return TRUE;
}
} else {
if (strcmp (controls, "All") != 0 &&
strcmp (controls, "ImageWindow") != 0) {
g_set_error (error,
TOTEM_EMBEDDED_ERROR_QUARK,
TOTEM_EMBEDDED_SETWINDOW_UNSUPPORTED_CONTROLS,
"Unsupported controls '%s'", controls);
return FALSE;
}
if (strcmp (controls, "All") != 0 &&
strcmp (controls, "ImageWindow") != 0) {
g_set_error (error,
TOTEM_EMBEDDED_ERROR_QUARK,
TOTEM_EMBEDDED_SETWINDOW_UNSUPPORTED_CONTROLS,
"Unsupported controls '%s'", controls);
return FALSE;
}
if (embedded->window != NULL) {
......@@ -2188,7 +2155,6 @@ parse_plugin_type (const gchar *option_name,
{
const char types[TOTEM_PLUGIN_TYPE_LAST][12] = {
"gmp",
"complex",
"narrowspace",
"mully",
"cone"
......
/* Totem Complex plugin
*
* Copyright © 2004 Bastien Nocera <hadess@hadess.net>
* Copyright © 2002 David A. Schleef <ds@schleef.org>
* Copyright © 2006, 2008 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#include <config.h>
#include <string.h>
#include <glib.h>
#include "npupp.h"
#include "totemPlugin.h"
#include "totemComplexPlugin.h"
#define TOTEM_COMPLEX_VERSION_BUILD "10.0"
static const char *methodNames[] = {
"CanPause",
"CanPlay",
"CanStop",
"DoGotoURL",
"DoNextEntry",
"DoPause",
"DoPlay",
"DoPrevEntry",
"DoStop",
"GetAuthor",
"GetAutoGoToURL",
"GetAutoStart",
"GetBackgroundColor",
"GetBandwidthAverage",
"GetBandwidthCurrent",
"GetBufferingTimeElapsed",
"GetBufferingTimeRemaining",
"GetCanSeek",
"GetCenter",
"GetClipHeight",
"GetClipWidth",
"GetConnectionBandwidth",
"GetConsole",
"GetConsoleEvents",
"GetControls",
"GetCopyright",
"GetCurrentEntry",
"GetDoubleSize",
"GetDRMInfo",
"GetEnableContextMenu",
"GetEnableDoubleSize",
"GetEnableFullScreen",
"GetEnableOriginalSize",
"GetEntryAbstract",
"GetEntryAuthor",
"GetEntryCopyright",
"GetEntryTitle",
"GetFullScreen",
"GetImageStatus",
"GetIsPlus",
"GetLastErrorMoreInfoURL",
"GetLastErrorRMACode",
"GetLastErrorSeverity",
"GetLastErrorUserCode",
"GetLastErrorUserString",
"GetLastMessage",
"GetLastStatus",
"GetLength",
"GetLiveState",
"GetLoop",
"GetMaintainAspect",
"GetMute",
"GetNoLogo",
"GetNumEntries",
"GetNumLoop",
"GetNumSources",
"GetOriginalSize",
"GetPacketsEarly",
"GetPacketsLate",
"GetPacketsMissing",
"GetPacketsOutOfOrder",
"GetPacketsReceived",
"GetPacketsTotal",
"GetPlayState",
"GetPosition",
"GetPreferedLanguageID",
"GetPreferedLanguageString",
"GetPreferredLanguageID",
"GetPreferredLanguageString",
"GetPreFetch",
"GetShowAbout",
"GetShowPreferences",
"GetShowStatistics",
"GetShuffle",
"GetSource",
"GetSourceTransport",
"GetStereoState",
"GetTitle",
"GetUserCountryID",
"GetVersionInfo",
"GetVolume",
"GetWantErrors",
"GetWantKeyboardEvents",
"GetWantMouseEvents",
"HasNextEntry",
"HasPrevEntry",
"SetAuthor",
"SetAutoGoToURL",
"SetAutoStart",
"SetBackgroundColor",
"SetCanSeek",
"SetCenter",
"SetConsole",
"SetConsoleEvents",
"SetControls",
"SetCopyright",
"SetDoubleSize",
"SetEnableContextMenu",
"SetEnableDoubleSize",
"SetEnableFullScreen",
"SetEnableOriginalSize",
"SetFullScreen",
"SetImageStatus",
"SetLoop",
"SetMaintainAspect",
"SetMute",
"SetNoLogo",
"SetNumLoop",
"SetOriginalSize",
"SetPosition",
"SetPreFetch",
"SetShowAbout",
"SetShowPreferences",
"SetShowStatistics",
"SetShuffle",
"SetSource",
"SetTitle",
"SetVolume",
"SetWantErrors",
"SetWantKeyboardEvents",
"SetWantMouseEvents"
};
TOTEM_IMPLEMENT_NPCLASS (totemComplexPlugin,
NULL, 0,
methodNames, G_N_ELEMENTS (methodNames),
NULL);
totemComplexPlugin::totemComplexPlugin (NPP aNPP)
: totemNPObject (aNPP)
{
TOTEM_LOG_CTOR ();
}
totemComplexPlugin::~totemComplexPlugin ()
{
TOTEM_LOG_DTOR ();
}
bool
totemComplexPlugin::InvokeByIndex (int aIndex,
const NPVariant *argv,
uint32_t argc,
NPVariant *_result)
{
TOTEM_LOG_INVOKE (aIndex, totemComplexPlugin);
switch (Methods (aIndex)) {
case eCanPause:
case eCanPlay:
case eCanStop:
case eDoGotoURL:
case eDoNextEntry:
case eDoPause:
case eDoPlay:
case eDoPrevEntry:
case eDoStop:
case eGetAuthor:
case eGetAutoGoToURL:
case eGetAutoStart:
case eGetBackgroundColor:
case eGetBandwidthAverage:
case eGetBandwidthCurrent:
case eGetBufferingTimeElapsed:
case eGetBufferingTimeRemaining:
case eGetCanSeek:
case eGetCenter:
case eGetClipHeight:
case eGetClipWidth:
case eGetConnectionBandwidth:
case eGetConsole:
case eGetConsoleEvents:
case eGetControls:
case eGetCopyright:
case eGetCurrentEntry:
case eGetDoubleSize:
case eGetDRMInfo:
case eGetEnableContextMenu:
case eGetEnableDoubleSize:
case eGetEnableFullScreen:
case eGetEnableOriginalSize:
case eGetEntryAbstract:
case eGetEntryAuthor:
case eGetEntryCopyright:
case eGetEntryTitle:
case eGetFullScreen:
case eGetImageStatus:
case eGetIsPlus:
case eGetLastErrorMoreInfoURL:
case eGetLastErrorRMACode:
case eGetLastErrorSeverity:
case eGetLastErrorUserCode:
case eGetLastErrorUserString:
case eGetLastMessage:
case eGetLastStatus:
case eGetLength:
case eGetLiveState:
case eGetLoop:
case eGetMaintainAspect:
case eGetMute:
case eGetNoLogo:
case eGetNumEntries:
case eGetNumLoop:
case eGetNumSources:
case eGetOriginalSize:
case eGetPacketsEarly:
case eGetPacketsLate:
case eGetPacketsMissing:
case eGetPacketsOutOfOrder:
case eGetPacketsReceived:
case eGetPacketsTotal:
case eGetPlayState:
case eGetPosition:
case eGetPreferedLanguageID:
case eGetPreferedLanguageString:
case eGetPreferredLanguageID:
case eGetPreferredLanguageString:
case eGetPreFetch:
case eGetShowAbout:
case eGetShowPreferences:
case eGetShowStatistics:
case eGetShuffle:
case eGetSource:
case eGetSourceTransport:
case eGetStereoState:
case eGetTitle:
case eGetUserCountryID:
TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
return BoolVariant (_result, true);
break;
case eGetVersionInfo:
return StringVariant (_result, TOTEM_COMPLEX_VERSION_BUILD);
case eGetVolume:
case eGetWantErrors:
case eGetWantKeyboardEvents:
case eGetWantMouseEvents:
case eHasNextEntry:
case eHasPrevEntry:
case eSetAuthor:
case eSetAutoGoToURL:
case eSetAutoStart:
case eSetBackgroundColor:
case eSetCanSeek:
case eSetCenter:
case eSetConsole:
case eSetConsoleEvents:
case eSetControls:
case eSetCopyright:
case eSetDoubleSize:
case eSetEnableContextMenu:
case eSetEnableDoubleSize:
case eSetEnableFullScreen:
case eSetEnableOriginalSize:
case eSetFullScreen:
case eSetImageStatus:
case eSetLoop:
case eSetMaintainAspect:
case eSetMute:
case eSetNoLogo:
case eSetNumLoop:
case eSetOriginalSize:
case eSetPosition:
case eSetPreFetch:
case eSetShowAbout:
case eSetShowPreferences:
case eSetShowStatistics:
case eSetShuffle:
case eSetSource:
case eSetTitle:
case eSetVolume:
case eSetWantErrors:
case eSetWantKeyboardEvents:
case eSetWantMouseEvents:
TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemComplexPlugin);
return BoolVariant (_result, true);
}
return false;
}
/* Totem Complex plugin
*
* Copyright © 2004 Bastien Nocera <hadess@hadess.net>
* Copyright © 2002 David A. Schleef <ds@schleef.org>
* Copyright © 2006, 2007, 2008 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef __TOTEM_COMPLEX_PLAYER_H__
#define __TOTEM_COMPLEX_PLAYER_H__