From: Alessio Treglia Date: Sat, 11 Feb 2012 18:13:29 +0000 (+0100) Subject: Imported Upstream version 0.4.5+svn3912~dfsg1 X-Git-Tag: archive/raspbian/1.0.1+dfsg1-4+rpi1~1^2~15^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=908a1aa4df007d7ab5c9e5b29e4bb1228f9ff738;p=gpac.git Imported Upstream version 0.4.5+svn3912~dfsg1 --- diff --git a/applications/hbbtvplayer/README.txt b/applications/hbbtvplayer/README.txt deleted file mode 100644 index c050ddb..0000000 --- a/applications/hbbtvplayer/README.txt +++ /dev/null @@ -1,15 +0,0 @@ -/*****************************************************************************/ - -Documentation summary - - 'doc/introduction.txt' to know the purpose of the project - - 'doc/projectmanangement.txt' to know the organisation of files and directories. - - 'doc/avancement.txt' to know the progress in the development of the project - -/*****************************************************************************/ - -1. Run getsources.sh (without sudo) to get the sources of gpac and/or webkit if necessary - -2. Run 'sudo ./install.sh' with the appropriate parameter (full, player, gpac, webkit or dependencies) diff --git a/applications/hbbtvplayer/REQUIREMENT b/applications/hbbtvplayer/REQUIREMENT deleted file mode 100644 index 328c4d0..0000000 --- a/applications/hbbtvplayer/REQUIREMENT +++ /dev/null @@ -1,10 +0,0 @@ - -install.sh script will work on the follwoing conditions of execution : - -linux ubuntu 11.04 environnement -graphic drivers supporting transparency -installed xulrunner with correct library path (that could be not the default case in old version of xulrunner) - -the execution of hbbtvplayer require a enought large screen to display several windows, including a main window able in 720p resolution (1280x720) - - diff --git a/applications/hbbtvplayer/doc/avancement.txt b/applications/hbbtvplayer/doc/avancement.txt deleted file mode 100644 index 0b196b9..0000000 --- a/applications/hbbtvplayer/doc/avancement.txt +++ /dev/null @@ -1,17 +0,0 @@ - -mardi 12 avril 2011, 09:09:57 (UTC+0200) - -- video on TVview : bug of displaying, video truncated - -jeudi 2 décembre 2010, 14:14:23 (UTC+0100) - -- adding Remote Control keys as buttons, simulating the RCU - -lundi 22 novembre 2010, 09:50:31 (UTC+0100) - -- construction du GTK global, liaison avec Webkit par le GTKWidget dedie... liaosion avec GPAC , en fenetre -- would be nice to find a way to do all in one window. - -jeudi 14 octobre 2010, 10:15:36 (UTC+0200) - -- création diff --git a/applications/hbbtvplayer/doc/introduction.txt b/applications/hbbtvplayer/doc/introduction.txt deleted file mode 100644 index a9953ac..0000000 --- a/applications/hbbtvplayer/doc/introduction.txt +++ /dev/null @@ -1,5 +0,0 @@ - -HbbTV Player - -the goal is to get a HbbTVTerminal emulation on a PC and be able to play HbbTV applications, that could be include in a Stream. -The player will receveive input of HbbtvApplication entry files, or TS-stream featuring HBBTV. diff --git a/applications/hbbtvplayer/doc/projectmanagement.txt b/applications/hbbtvplayer/doc/projectmanagement.txt deleted file mode 100644 index a94288d..0000000 --- a/applications/hbbtvplayer/doc/projectmanagement.txt +++ /dev/null @@ -1,16 +0,0 @@ - -the project include 2 sub-project : - -- hbbtvterminal : a terminal able to play Video/Audio, an RCU emulation, and display a webbrowser linking to the hbbtvbrowserplugin (see below) - -- hbbtvbrowserplugin : a NPAPI plugin able to play HbbtvApps in a webbrowser . - - -CODEBLOCKS : - -for the use of codeblocks , you can find a workspace in /projectmanager/codeblocks/hbbtvplayer/ - -each project contains a projectmanager directory, including a codeblocks specification projects : - -/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/hbbtvterminal.cbp -/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.cbp diff --git a/applications/hbbtvplayer/getsources.sh b/applications/hbbtvplayer/getsources.sh deleted file mode 100644 index b8a7447..0000000 --- a/applications/hbbtvplayer/getsources.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -e - -WEBKIT=0 -GPAC=0 - -if [ -z $1 ] ; then - echo "\nDO NOT USE sudo FOR THIS SCRIPT" - echo "\nUsage: You must choose options :" - echo "\n\033[31m full - build the whole package (gpac+webkit+hbbtvplayer) Recommended for computer without gpac \033[0m" - echo "\n\033[33m webkit - download Webkit sources and install it\033[0m" - echo "\n\033[33m gpac - download gpac sources and install it\033[0m" - exit 1 -fi - -for i in $* ; do - if [ "$i" = "full" ] ; then - echo -e "\033[31m Usage: $0 Full Building : Activated \033[0m" - WEBKIT=1 - GPAC=1 - fi - - if [ "$i" = "webkit" ] ; then - echo -e "\033[33m Usage: $0 Webkit Building : Activated \033[0m" - WEBKIT=1 - fi - - if [ "$i" = "gpac" ] ; then - echo -e "\033[33m Usage: $0 gpac Building : Activated \033[0m" - WEBKIT=1 - fi -done - -if [ $GPAC -eq 1 ] ; then - svn checkout https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac gpac -fi - -if [ $WEBKIT -eq 1 ] ; then - svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit --depth files -r 97300 # 98458 ? - svn checkout http://svn.webkit.org/repository/webkit/trunk/Source WebKit/Source -r 97300 - svn checkout http://svn.webkit.org/repository/webkit/trunk/Tools WebKit/Tools -r 97300 - svn checkout http://svn.webkit.org/repository/webkit/trunk/WebKitLibraries WebKit/WebKitLibraries -r 97300 -fi - - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/README b/applications/hbbtvplayer/hbbtvbrowserplugin/README deleted file mode 100644 index d3b8d3f..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/README +++ /dev/null @@ -1,14 +0,0 @@ -****************************************** -HBBTVBROWSERPLUGIN v0.01 - -To build : - - make - -To install : - - sudo make install - -******************************************* - - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/autogen.sh b/applications/hbbtvplayer/hbbtvbrowserplugin/autogen.sh deleted file mode 100644 index 124f59c..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/autogen.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh - -autoreconf --install -v - -./configure diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/configure.ac b/applications/hbbtvplayer/hbbtvbrowserplugin/configure.ac deleted file mode 100644 index ff93781..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/configure.ac +++ /dev/null @@ -1,19 +0,0 @@ - - -AC_INIT([hbbtvbrowserplugin], [0.1.0], [stanislas.selle@telecom-paristech.fr]) - -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIR([m4]) - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AM_INIT_AUTOMAKE([foreign -Wall -Werror]) -AC_PROG_CC -AC_PROG_LIBTOOL - -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28.0]) -PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.20.1]) -AC_SUBST([PLUGINDIR], [/usr/lib/mozilla/plugins]) -LT_INIT -AC_CONFIG_FILES([makefile src/makefile hbbtvbrowserplugin.pc]) -AC_OUTPUT diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/doc/hbbtvBrowserPlugin-NPAPI-20111108.pptx b/applications/hbbtvplayer/hbbtvbrowserplugin/doc/hbbtvBrowserPlugin-NPAPI-20111108.pptx deleted file mode 100644 index 90203fa..0000000 Binary files a/applications/hbbtvplayer/hbbtvbrowserplugin/doc/hbbtvBrowserPlugin-NPAPI-20111108.pptx and /dev/null differ diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/doc/listeOIPFProfile.xlsx b/applications/hbbtvplayer/hbbtvbrowserplugin/doc/listeOIPFProfile.xlsx deleted file mode 100644 index b5302b4..0000000 Binary files a/applications/hbbtvplayer/hbbtvbrowserplugin/doc/listeOIPFProfile.xlsx and /dev/null differ diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/hbbtvbrowserplugin.pc.in b/applications/hbbtvplayer/hbbtvbrowserplugin/hbbtvbrowserplugin.pc.in deleted file mode 100644 index d67b557..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/hbbtvbrowserplugin.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -plugindir=/usr/lib/mozilla/plugins/ - -Name: hbbtvbrowserplugin -Description: The Hbbtv BrowserPlugin (NPAPI) -Version:@PACKAGE_VERSION@ -Cflags: -I${includedir}/hbbtvbrowserplugin -Libs: -L${libdir} -L${plugindir} -lhbbtvbrowserplugin - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/hbbtvbrowserplugin.vcproj b/applications/hbbtvplayer/hbbtvbrowserplugin/hbbtvbrowserplugin.vcproj deleted file mode 100644 index c54579b..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/hbbtvbrowserplugin.vcproj +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/makefile.am b/applications/hbbtvplayer/hbbtvbrowserplugin/makefile.am deleted file mode 100644 index 585a151..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -SUBDIRS = src - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = hbbtvbrowserplugin.pc - - - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/makefile.old b/applications/hbbtvplayer/hbbtvbrowserplugin/makefile.old deleted file mode 100644 index cea09b8..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/makefile.old +++ /dev/null @@ -1,110 +0,0 @@ -############################################################################### -#### -#### MAKEFILE -#### -#### Copyright Telecom Paristech 2011 -#### -#### Author : Stanislas Selle -#### -############################################################################### - -############################################################################### -## Files and Path - -PLUGINDIR = /usr/lib/mozilla/plugins -INSTALL_INCLUDEDIR = /usr/local/include/hbbtvbrowserplugin -INSTALL_LIBDIR = /usr/local/lib -INSTALL_PKGDIR = /usr/lib/pkgconfig - -PKGFILE = hbbtvbrowserplugin.pc - -MAINTARGET = bin/libhbbtvbrowserplugin.so - -SRCDIR = src -HEADERSDIR = src - -OBJ = obj/hbbtvbrowserplugin.o\ - obj/oipfapplicationmanager.o\ - obj/applicationclass.o\ - obj/applicationprivatedataclass.o\ - obj/oipfconfiguration.o\ - obj/configurationclass.o\ - obj/oipfdownloadmanager.o\ - obj/oipfdownloadtrigger.o\ - obj/downloadclass.o\ - obj/downloadcollectionclass.o\ - obj/drmcontrolinfocollectionclass.o\ - obj/drmcontrolinformationclass.o\ - obj/videobroadcast.o\ - obj/keysetclass.o - -EXPORTHEADERS = hbbtvbrowserpluginapi.h - -#TESTURL = file:///home/selle/ressources/HbbTVapps/TPT/app1/index.html -TESTURL = http://aquila.enst.fr:8080/subwebsite/hbbtvtest/test0003/index.php -TESTLOG = /tmp/test-err.txt -############################################################################### -## Programs - -COMPILER = cc -DELETER = rm -f -BROWSERTEST = firefox - - -############################################################################### -## Options, Flags and LinkS - -CFLAGS = -Wall -DXP_UNIX=1 -DMOZ_X11=1 -fPIC -g - -INCLUDEFLAGS = -Isrc -LIBRARYFLAGS = - -FROMPKG = libxul - -PKGFLAGS = `pkg-config --cflags $(FROMPKG) ` -PKGLIBS = `pkg-config --libs $(FROMPKG) ` - -INCLUDEFLAGS += $(PKGFLAGS) -LIBRARYFLAGS += $(PKGLIBS) - -############################################################################### -## Rules - -all : $(MAINTARGET) - -$(MAINTARGET) : $(OBJ) - @echo "====> Compiling $(MAINTARGET)" - $(COMPILER) $(CFLAGS) $(LIBRARYFLAGS) -shared $(OBJ) -o $(MAINTARGET) - -obj/%.o: $(SRCDIR)/%.c $(HEADERSDIR)/%.h - @echo "====> Compiling $< " - $(COMPILER) $(CFLAGS) -c $< $(INCLUDEFLAGS) -o $@ - -test : all - $(BROWSERTEST) $(TESTURL) 2> $(TESTLOG); cat $(TESTLOG) - -install : all - @echo "====> Installing" - cp $(MAINTARGET) $(PLUGINDIR) - @if test -d $(INSTALL_INCLUDEDIR);\ - then echo " ===> $(INSTALL_INCLUDEDIR) existing already" ; \ - else mkdir $(INSTALL_INCLUDEDIR); fi; - cp $(HEADERSDIR)/$(EXPORTHEADERS) $(INSTALL_INCLUDEDIR) - cp $(PKGFILE) $(INSTALL_PKGDIR) - @echo "Done." - -uninstall : - @echo "====> Uninstalling" - $(DELETER) $(INSTALL_PKGDIR)/$(PKGFILE) $(INSTALL_INCLUDEDIR)/$(EXPORTHEADERS) $(INSTALL_INCLUDEDIR)/$(MAINTARGET) - if test -d $(INSTALL_INCLUDEDIR);\ - then rmdir $(INSTALL_INCLUDEDIR); fi; - -clean : - @echo "====> Cleaning" - @$(DELETER) $(OBJ) - @echo "Deleting objects" - @$(DELETER) $(MAINTARGET) - @echo "Deleting $(MAINTARGET)" - -############################################################################### -############################################################################### diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.cbp b/applications/hbbtvplayer/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.cbp deleted file mode 100644 index 54b6c97..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.cbp +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.layout b/applications/hbbtvplayer/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.layout deleted file mode 100644 index 5c17549..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/projectmanager/codeblocks/hbbtvbrowserplugin/hbbtvbrowserplugin.layout +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/releases/hbbtvbrowserplugin-0.01.tar.gz b/applications/hbbtvplayer/hbbtvbrowserplugin/releases/hbbtvbrowserplugin-0.01.tar.gz deleted file mode 100644 index c8595c8..0000000 Binary files a/applications/hbbtvplayer/hbbtvbrowserplugin/releases/hbbtvbrowserplugin-0.01.tar.gz and /dev/null differ diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationclass.c deleted file mode 100644 index f804fcd..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationclass.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "applicationprivatedataclass.h" -#include "applicationclass.h" - -#define kAPPLICATION_ID_PROPERTY_VISIBLE 0 -#define kAPPLICATION_ID_PROPERTY_PRIVATEDATA 1 -#define kAPPLICATION_NUM_PROPERTY_IDENTIFIERS 2 - -#define kAPPLICATION_ID_METHOD_CREATEAPPLICATION 0 -#define kAPPLICATION_ID_METHOD_DESTROYAPPLICATION 1 -#define kAPPLICATION_ID_METHOD_SHOW 2 -#define kAPPLICATION_ID_METHOD_HIDE 3 -#define kAPPLICATION_NUM_METHOD_IDENTIFIERS 4 - - -static bool v_bAPPLICATIONIdentifiersInitialized = false; - -static NPIdentifier v_APPLICATIONPropertyIdentifiers[kAPPLICATION_NUM_PROPERTY_IDENTIFIERS]; -static const NPUTF8 * v_APPLICATIONPropertyNames[kAPPLICATION_NUM_PROPERTY_IDENTIFIERS] = { - "visible", - "privateData" -}; - -static NPIdentifier v_APPLICATIONMethodIdentifiers[kAPPLICATION_NUM_METHOD_IDENTIFIERS]; -static const NPUTF8 * v_APPLICATIONMethodNames[kAPPLICATION_NUM_METHOD_IDENTIFIERS] = { - "createApplication", - "destroyApplication", - "show", - "hide" -}; - - -static void APPLICATIONinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_APPLICATIONPropertyNames, kAPPLICATION_NUM_PROPERTY_IDENTIFIERS, v_APPLICATIONPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_APPLICATIONMethodNames, kAPPLICATION_NUM_METHOD_IDENTIFIERS, v_APPLICATIONMethodIdentifiers ); -} - -NPClass stAPPLICATIONclass; -NPClass* pAPPLICATIONclass = NULL; - -NPClass* fillAPPLICATIONpclass(void) -{ - TRACEINFO; - if (pAPPLICATIONclass == NULL) - { - stAPPLICATIONclass.allocate = APPLICATION_Allocate; - stAPPLICATIONclass.deallocate = APPLICATION_Deallocate; - stAPPLICATIONclass.invalidate = APPLICATION_Invalidate; - stAPPLICATIONclass.hasMethod = APPLICATION_HasMethod; - stAPPLICATIONclass.invoke = APPLICATION_Invoke; - stAPPLICATIONclass.invokeDefault = APPLICATION_InvokeDefault; - stAPPLICATIONclass.hasProperty = APPLICATION_HasProperty; - stAPPLICATIONclass.getProperty = APPLICATION_GetProperty; - stAPPLICATIONclass.setProperty = APPLICATION_SetProperty; - stAPPLICATIONclass.removeProperty = APPLICATION_RemoveProperty; - stAPPLICATIONclass.enumerate = APPLICATION_Enumerate; - pAPPLICATIONclass = &stAPPLICATIONclass; - } - - return pAPPLICATIONclass; -} - - -NPObject * APPLICATION_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - if (!v_bAPPLICATIONIdentifiersInitialized) - { - v_bAPPLICATIONIdentifiersInitialized = true; - APPLICATIONinitializeIdentifiers(); - } - - NPObj_Application* newapplication = (NPObj_Application*)MEMALLOC(sizeof(NPObj_Application)); - fprintf(stderr, "\t%s : Allocation at \x1b[%i;3%im%p\n\x1b[0m",__FUNCTION__, 1, 1, newapplication ); - newapplication->npp = npp; - newapplication->visible = true; - newapplication->privateData = sBrowserFuncs->createobject(npp, fillAPPPRIVDATApclass()); - fprintf(stderr, "\t%s : Create privateData property at \x1b[%i;3%im%p\n\x1b[0m ",__FUNCTION__, 1, 1, newapplication->privateData ); - newapplication->visible = true; - return (NPObject*)newapplication; -} - - void APPLICATION_Deallocate(NPObject* obj) -{ - TRACEINFO; - NPObj_Application* applicationobj = (NPObj_Application*)obj; - sBrowserFuncs->releaseobject(applicationobj->privateData); - MEMFREE(applicationobj); - return; -} - - void APPLICATION_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - - bool APPLICATION_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kAPPLICATION_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_APPLICATIONMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool APPLICATION_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - if (name == v_APPLICATIONMethodIdentifiers[kAPPLICATION_ID_METHOD_CREATEAPPLICATION]) - { - APPLICATION_Invoke_CreateApplication(obj, args, argCount); - fctresult = true; - } - else if (name == v_APPLICATIONMethodIdentifiers[kAPPLICATION_ID_METHOD_DESTROYAPPLICATION]) - { - APPLICATION_Invoke_DestroyApplication(obj, args, argCount); - fctresult = true; - } - else if (name == v_APPLICATIONMethodIdentifiers[kAPPLICATION_ID_METHOD_HIDE]) - { - APPLICATION_Invoke_Hide(obj, args, argCount); - fctresult = true; - } - else if (name == v_APPLICATIONMethodIdentifiers[kAPPLICATION_ID_METHOD_SHOW]) - { - APPLICATION_Invoke_Show(obj, args, argCount); - fctresult = true; - } - else - { - fctresult = false; - } - return fctresult; -} - - bool APPLICATION_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - - bool APPLICATION_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kAPPLICATION_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_APPLICATIONPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool APPLICATION_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - - bool fctresult = false; - NPObj_Application* AppliObj = (NPObj_Application*)obj; - - if (name == v_APPLICATIONPropertyIdentifiers[kAPPLICATION_ID_PROPERTY_PRIVATEDATA]) - { - sBrowserFuncs->retainobject(AppliObj->privateData); - OBJECT_TO_NPVARIANT(AppliObj->privateData, *result); - fctresult = true; - } - else if (name == v_APPLICATIONPropertyIdentifiers[kAPPLICATION_ID_PROPERTY_VISIBLE]) - { - BOOLEAN_TO_NPVARIANT(AppliObj->visible, *result); - fctresult = true; - } - else - - return fctresult; -} - - bool APPLICATION_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - - bool APPLICATION_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - - bool APPLICATION_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - -/** implementation **/ - -void APPLICATION_Invoke_CreateApplication(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} - -void APPLICATION_Invoke_DestroyApplication(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} - -void APPLICATION_Invoke_Show(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NPObj_Application* AppliObj = (NPObj_Application*)obj; - OnAPPLICATION_Show(); - AppliObj->visible = true; - NOTIMPLEMENTED; -} - -void APPLICATION_Invoke_Hide(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - - NPObj_Application* AppliObj = (NPObj_Application*)obj; - OnAPPLICATION_Hide(); - AppliObj->visible = false; - NOTIMPLEMENTED; -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationclass.h deleted file mode 100644 index 967c1f5..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationclass.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __APPLICATIONCLASS_H__ -#define __APPLICATIONCLASS_H__ - -#include "hbbtvbrowserplugin.h" - -typedef struct -{ - NPObject header; - NPP npp; - - NPBool visible; - NPObject* privateData; - -} NPObj_Application; - - -NPClass* fillAPPLICATIONpclass(void); - -NPObject * APPLICATION_Allocate(NPP npp, NPClass *aClass); -void APPLICATION_Deallocate(NPObject *obj); -void APPLICATION_Invalidate(NPObject *obj); -bool APPLICATION_HasMethod(NPObject *obj, NPIdentifier name); -bool APPLICATION_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool APPLICATION_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool APPLICATION_HasProperty(NPObject *obj, NPIdentifier name); -bool APPLICATION_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool APPLICATION_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool APPLICATION_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool APPLICATION_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - - -void APPLICATION_Invoke_CreateApplication(NPObject* obj,const NPVariant* args, uint32_t argCount); -void APPLICATION_Invoke_DestroyApplication(NPObject* obj,const NPVariant* args, uint32_t argCount); -void APPLICATION_Invoke_Show(NPObject* obj,const NPVariant* args, uint32_t argCount); -void APPLICATION_Invoke_Hide(NPObject* obj,const NPVariant* args, uint32_t argCount); - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationprivatedataclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationprivatedataclass.c deleted file mode 100644 index fdb8443..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationprivatedataclass.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "applicationprivatedataclass.h" - -#define kAPPPRIVDATA_ID_PROPERTY_KEYSET 0 -#define kAPPPRIVDATA_ID_PROPERTY_CURRENTCHANNEL 1 -#define kAPPPRIVDATA_NUM_PROPERTY_IDENTIFIERS 2 - -#define kAPPPRIVDATA_ID_METHOD_GETMEMFREE 0 -#define kAPPPRIVDATA_NUM_METHOD_IDENTIFIERS 1 - - - -bool v_bAPPPRIVDATAIdentifiersInitialized = false; - -NPIdentifier v_APPPRIVDATAPropertyIdentifiers[kAPPPRIVDATA_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_APPPRIVDATAPropertyNames[kAPPPRIVDATA_NUM_PROPERTY_IDENTIFIERS] = { - "keyset", - "currentChannel" - }; - -NPIdentifier v_APPPRIVDATAMethodIdentifiers[kAPPPRIVDATA_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_APPPRIVDATAMethodNames[kAPPPRIVDATA_NUM_METHOD_IDENTIFIERS] = { - "getMEMFREE" - }; - -static void APPPRIVDATAinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_APPPRIVDATAPropertyNames, kAPPPRIVDATA_NUM_PROPERTY_IDENTIFIERS, v_APPPRIVDATAPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_APPPRIVDATAMethodNames, kAPPPRIVDATA_NUM_METHOD_IDENTIFIERS, v_APPPRIVDATAMethodIdentifiers ); -} - - -NPClass stAPPPRIVDATAclass; -NPClass* pAPPPRIVDATAclass = NULL; - -NPClass* fillAPPPRIVDATApclass(void) -{ - TRACEINFO; - if (pAPPPRIVDATAclass == NULL) - { - stAPPPRIVDATAclass.allocate = APPPRIVDATA_Allocate; - stAPPPRIVDATAclass.deallocate = APPPRIVDATA_Deallocate; - stAPPPRIVDATAclass.invalidate = APPPRIVDATA_Invalidate; - stAPPPRIVDATAclass.hasMethod = APPPRIVDATA_HasMethod; - stAPPPRIVDATAclass.invoke = APPPRIVDATA_Invoke; - stAPPPRIVDATAclass.invokeDefault = APPPRIVDATA_InvokeDefault; - stAPPPRIVDATAclass.hasProperty = APPPRIVDATA_HasProperty; - stAPPPRIVDATAclass.getProperty = APPPRIVDATA_GetProperty; - stAPPPRIVDATAclass.setProperty = APPPRIVDATA_SetProperty; - stAPPPRIVDATAclass.removeProperty = APPPRIVDATA_RemoveProperty; - stAPPPRIVDATAclass.enumerate = APPPRIVDATA_Enumerate; - pAPPPRIVDATAclass = &stAPPPRIVDATAclass; - } - - return pAPPPRIVDATAclass; -} - - -NPObject * APPPRIVDATA_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - NPObject* result; - - - if (!v_bAPPPRIVDATAIdentifiersInitialized) - { - v_bAPPPRIVDATAIdentifiersInitialized = true; - APPPRIVDATAinitializeIdentifiers(); - } - - NPObj_AppPrivData* newappprivdata = (NPObj_AppPrivData*)MEMALLOC(sizeof(NPObj_AppPrivData)); - fprintf(stderr, "\t%s : Allocation at \x1b[%i;3%im%p\n\x1b[0m",__FUNCTION__, 1, 1, newappprivdata); - newappprivdata->npp = npp; - newappprivdata->keyset = sBrowserFuncs->createobject(npp, fillKEYSETpclass()); - fprintf(stderr, "\t%s : Create keyset property at \x1b[%i;3%im%p\n\x1b[0m",__FUNCTION__, 1, 1, newappprivdata->keyset ); - result = (NPObject*)newappprivdata; - return result; -} - - -void APPPRIVDATA_Deallocate(NPObject* obj) -{ - TRACEINFO; - NPObj_AppPrivData* appprivdataobj = (NPObj_AppPrivData*)obj; - sBrowserFuncs->releaseobject(appprivdataobj->keyset); - MEMFREE(appprivdataobj); - return; -} - -void APPPRIVDATA_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - -bool APPPRIVDATA_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kAPPPRIVDATA_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_APPPRIVDATAMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool APPPRIVDATA_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - if (name == v_APPPRIVDATAMethodIdentifiers[kAPPPRIVDATA_ID_METHOD_GETMEMFREE]) - { - APPPRIVDATA_Invoke_GetFreeMen(obj, args, argCount); - fctresult = true; - } - else - { - fctresult = false; - } - return fctresult; -} - -bool APPPRIVDATA_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - -bool APPPRIVDATA_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kAPPPRIVDATA_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_APPPRIVDATAPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - - return result; -} - -bool APPPRIVDATA_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - - bool fctresult = false; - NPObj_AppPrivData* AppPrivDataObj = (NPObj_AppPrivData*)obj; - if (!strcmp(sBrowserFuncs->utf8fromidentifier(name), v_APPPRIVDATAPropertyNames[kAPPPRIVDATA_ID_PROPERTY_KEYSET])) - { - sBrowserFuncs->retainobject(AppPrivDataObj->keyset); - OBJECT_TO_NPVARIANT(AppPrivDataObj->keyset, *result); - - fctresult = true; - } - else - - return fctresult; -} - -bool APPPRIVDATA_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - bool fctresult = false; - return fctresult; -} - -bool APPPRIVDATA_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - -bool APPPRIVDATA_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - - -/** implementation **/ -void APPPRIVDATA_Invoke_GetFreeMen(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationprivatedataclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationprivatedataclass.h deleted file mode 100644 index fc8a867..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/applicationprivatedataclass.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __APPLICATIONPRIVATEDATACLASS_H__ -#define __APPLICATIONPRIVATEDATACLASS_H__ - -#include "keysetclass.h" -#include "hbbtvbrowserplugin.h" - -typedef struct -{ - NPObject header; - NPP npp; - - NPObject* keyset; - NPObject* currentChannel; -} NPObj_AppPrivData; - -NPClass* fillAPPPRIVDATApclass(void); - -NPObject * APPPRIVDATA_Allocate(NPP npp, NPClass *aClass); -void APPPRIVDATA_Deallocate(NPObject *obj); -void APPPRIVDATA_Invalidate(NPObject *obj); -bool APPPRIVDATA_HasMethod(NPObject *obj, NPIdentifier name); -bool APPPRIVDATA_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool APPPRIVDATA_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool APPPRIVDATA_HasProperty(NPObject *obj, NPIdentifier name); -bool APPPRIVDATA_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool APPPRIVDATA_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool APPPRIVDATA_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool APPPRIVDATA_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - -void APPPRIVDATA_Invoke_GetFreeMen(NPObject* obj,const NPVariant* args, uint32_t argCount); - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/configurationclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/configurationclass.c deleted file mode 100644 index b4f14ff..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/configurationclass.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - * - */ -#include "configurationclass.h" - - -#define kCONFIGURATION_ID_PROPERTY_PREFERREDAUDIOLANGUAGE 0 -#define kCONFIGURATION_ID_PROPERTY_PREFERREDSUBTITLELANGUAGE 1 -#define kCONFIGURATION_ID_PROPERTY_COUNTRYID 2 -#define kCONFIGURATION_NUM_PROPERTY_IDENTIFIERS 3 - -#define kCONFIGURATION_NUM_METHOD_IDENTIFIERS 0 - - - -bool v_bCONFIGURATIONIdentifiersInitialized = false; - -NPIdentifier v_CONFIGURATIONPropertyIdentifiers[kCONFIGURATION_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_CONFIGURATIONPropertyNames[kCONFIGURATION_NUM_PROPERTY_IDENTIFIERS] = { - "preferredAudioLanguage", - "preferredSubtitleLanguage", - "countryId" - }; - -NPIdentifier v_CONFIGURATIONMethodIdentifiers[kCONFIGURATION_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_CONFIGURATIONMethodNames[kCONFIGURATION_NUM_METHOD_IDENTIFIERS] = {}; - -static void CONFIGURATIONinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_CONFIGURATIONPropertyNames, kCONFIGURATION_NUM_PROPERTY_IDENTIFIERS, v_CONFIGURATIONPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_CONFIGURATIONMethodNames, kCONFIGURATION_NUM_METHOD_IDENTIFIERS, v_CONFIGURATIONMethodIdentifiers ); -} - - -NPClass stCONFIGURATIONclass; -NPClass* pCONFIGURATIONclass = NULL; - -NPClass* fillCONFIGURATIONpclass(void) -{ - TRACEINFO; - if (pCONFIGURATIONclass == NULL) - { - stCONFIGURATIONclass.allocate = CONFIGURATION_Allocate; - stCONFIGURATIONclass.deallocate = CONFIGURATION_Deallocate; - stCONFIGURATIONclass.invalidate = CONFIGURATION_Invalidate; - stCONFIGURATIONclass.hasMethod = CONFIGURATION_HasMethod; - stCONFIGURATIONclass.invoke = CONFIGURATION_Invoke; - stCONFIGURATIONclass.invokeDefault = CONFIGURATION_InvokeDefault; - stCONFIGURATIONclass.hasProperty = CONFIGURATION_HasProperty; - stCONFIGURATIONclass.getProperty = CONFIGURATION_GetProperty; - stCONFIGURATIONclass.setProperty = CONFIGURATION_SetProperty; - stCONFIGURATIONclass.removeProperty = CONFIGURATION_RemoveProperty; - stCONFIGURATIONclass.enumerate = CONFIGURATION_Enumerate; - pCONFIGURATIONclass = &stCONFIGURATIONclass; - } - - return pCONFIGURATIONclass; -} - - -NPObject * CONFIGURATION_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - if (!v_bCONFIGURATIONIdentifiersInitialized) - { - v_bCONFIGURATIONIdentifiersInitialized = true; - CONFIGURATIONinitializeIdentifiers(); - } - NPObject* newconfiguration = NULL; - - newconfiguration = (NPObject *)MEMALLOC(sizeof(NPObject)); - - return newconfiguration; -} - - -void CONFIGURATION_Deallocate(NPObject* obj) -{ - TRACEINFO; - MEMFREE(obj); - return; -} - -void CONFIGURATION_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - -bool CONFIGURATION_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kCONFIGURATION_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_CONFIGURATIONMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool CONFIGURATION_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - return true; -} - -bool CONFIGURATION_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - -bool CONFIGURATION_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kCONFIGURATION_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_CONFIGURATIONPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - - return result; -} - -bool CONFIGURATION_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - -bool CONFIGURATION_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - -bool CONFIGURATION_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - -bool CONFIGURATION_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/configurationclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/configurationclass.h deleted file mode 100644 index ddba67b..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/configurationclass.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __CONFIGURATIONCLASS_H__ -#define __CONFIGURATIONCLASS_H__ - -#include "hbbtvbrowserplugin.h" - - -NPClass* fillCONFIGURATIONpclass(void); - -NPObject * CONFIGURATION_Allocate(NPP npp, NPClass *aClass); -void CONFIGURATION_Deallocate(NPObject *obj); -void CONFIGURATION_Invalidate(NPObject *obj); -bool CONFIGURATION_HasMethod(NPObject *obj, NPIdentifier name); -bool CONFIGURATION_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool CONFIGURATION_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool CONFIGURATION_HasProperty(NPObject *obj, NPIdentifier name); -bool CONFIGURATION_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool CONFIGURATION_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool CONFIGURATION_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool CONFIGURATION_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadclass.c deleted file mode 100644 index 6cfb967..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadclass.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - * - */ -#include "downloadclass.h" - -#define kDOWNLOAD_ID_PROPERTY_TOTALIZE 0 -#define kDOWNLOAD_ID_PROPERTY_STATE 1 -#define kDOWNLOAD_ID_PROPERTY_AMOUNTDOWNLOADED 2 -#define kDOWNLOAD_ID_PROPERTY_NAME 3 -#define kDOWNLOAD_ID_PROPERTY_ID 4 -#define kDOWNLOAD_ID_PROPERTY_CONTENTURL 5 -#define kDOWNLOAD_ID_PROPERTY_DESCRIPTION 6 -#define kDOWNLOAD_ID_PROPERTY_PARENTALRATINGS 7 -#define kDOWNLOAD_ID_PROPERTY_DRMCONTROL 8 -#define kDOWNLOAD_ID_PROPERTY_STARTTIME 9 -#define kDOWNLOAD_ID_PROPERTY_TIMEELAPSED 10 -#define kDOWNLOAD_ID_PROPERTY_TIMEREMAINING 11 -#define kDOWNLOAD_ID_PROPERTY_TRANSFERTYPE 12 -#define kDOWNLOAD_ID_PROPERTY_ORIGINSITE 13 -#define kDOWNLOAD_ID_PROPERTY_ORIGINSITENAME 14 -#define kDOWNLOAD_ID_PROPERTY_CONTENTID 15 -#define kDOWNLOAD_ID_PROPERTY_ICONURL 16 -#define kDOWNLOAD_NUM_PROPERTY_IDENTIFIERS 17 - - -#define kDOWNLOAD_NUM_METHOD_IDENTIFIERS 0 - - -bool v_bDOWNLOADIdentifiersInitialized = false; - -NPIdentifier v_DOWNLOADPropertyIdentifiers[kDOWNLOAD_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_DOWNLOADPropertyNames[kDOWNLOAD_NUM_PROPERTY_IDENTIFIERS] = { - "totalize", - "state", - "amountDownloaded", - "name", - "id", - "contentURL", - "description", - "parentalRatings", - "drmControl", - "startTime", - "timeElapsed", - "timeRemaining", - "transferType", - "originSite", - "originSiteName", - "contentID", - "iconURL" - }; - -NPIdentifier v_DOWNLOADMethodIdentifiers[kDOWNLOAD_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_DOWNLOADMethodNames[kDOWNLOAD_NUM_METHOD_IDENTIFIERS] = { -}; - - -static void DOWNLOADinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_DOWNLOADPropertyNames, kDOWNLOAD_NUM_PROPERTY_IDENTIFIERS, v_DOWNLOADPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_DOWNLOADMethodNames, kDOWNLOAD_NUM_METHOD_IDENTIFIERS, v_DOWNLOADMethodIdentifiers ); -} - -NPClass stDOWNLOADclass; -NPClass* pDOWNLOADclass = NULL; - -NPClass* fillDOWNLOADpclass(void) -{ - TRACEINFO; - if (pDOWNLOADclass == NULL) - { - stDOWNLOADclass.allocate = DOWNLOAD_Allocate; - stDOWNLOADclass.deallocate = DOWNLOAD_Deallocate; - stDOWNLOADclass.invalidate = DOWNLOAD_Invalidate; - stDOWNLOADclass.hasMethod = DOWNLOAD_HasMethod; - stDOWNLOADclass.invoke = DOWNLOAD_Invoke; - stDOWNLOADclass.invokeDefault = DOWNLOAD_InvokeDefault; - stDOWNLOADclass.hasProperty = DOWNLOAD_HasProperty; - stDOWNLOADclass.getProperty = DOWNLOAD_GetProperty; - stDOWNLOADclass.setProperty = DOWNLOAD_SetProperty; - stDOWNLOADclass.removeProperty = DOWNLOAD_RemoveProperty; - stDOWNLOADclass.enumerate = DOWNLOAD_Enumerate; - pDOWNLOADclass = &stDOWNLOADclass; - } - - return pDOWNLOADclass; -} - - -NPObject * DOWNLOAD_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - - if (!v_bDOWNLOADIdentifiersInitialized) - { - v_bDOWNLOADIdentifiersInitialized = true; - DOWNLOADinitializeIdentifiers(); - } - - NPObject* newdownload = (NPObject *)MEMALLOC(sizeof(NPObject)); - - return newdownload; -} - - void DOWNLOAD_Deallocate(NPObject* obj) -{ - TRACEINFO; - MEMFREE(obj); - return; -} - - void DOWNLOAD_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - - bool DOWNLOAD_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kDOWNLOAD_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_DOWNLOADMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool DOWNLOAD_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - return true; -} - - bool DOWNLOAD_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - - bool DOWNLOAD_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kDOWNLOAD_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_DOWNLOADPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - - bool DOWNLOAD_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - - bool DOWNLOAD_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - - bool DOWNLOAD_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - - bool DOWNLOAD_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadclass.h deleted file mode 100644 index a7e5673..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadclass.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __DOWNLOADCLASS_H__ -#define __DOWNLOADCLASS_H__ - -#include "hbbtvbrowserplugin.h" - -NPClass* fillDOWNLOADpclass(void); - -NPObject * DOWNLOAD_Allocate(NPP npp, NPClass *aClass); -void DOWNLOAD_Deallocate(NPObject *obj); -void DOWNLOAD_Invalidate(NPObject *obj); -bool DOWNLOAD_HasMethod(NPObject *obj, NPIdentifier name); -bool DOWNLOAD_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool DOWNLOAD_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool DOWNLOAD_HasProperty(NPObject *obj, NPIdentifier name); -bool DOWNLOAD_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool DOWNLOAD_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool DOWNLOAD_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool DOWNLOAD_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadcollectionclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadcollectionclass.c deleted file mode 100644 index 40524f6..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadcollectionclass.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "downloadcollectionclass.h" - - -#define kDWLDCOLLECTION_ID_PROPERTY_LENGH 0 -#define kDWLDCOLLECTION_NUM_PROPERTY_IDENTIFIERS 1 - -#define kDWLDCOLLECTION_ID_METHOD_ITEM 0 -#define kDWLDCOLLECTION_NUM_METHOD_IDENTIFIERS 1 - -bool v_bDWLDCOLLECTIONIdentifiersInitialized = false; - -NPIdentifier v_DWLDCOLLECTIONPropertyIdentifiers[kDWLDCOLLECTION_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_DWLDCOLLECTIONPropertyNames[kDWLDCOLLECTION_NUM_PROPERTY_IDENTIFIERS] = { - "lengh" - }; - -NPIdentifier v_DWLDCOLLECTIONMethodIdentifiers[kDWLDCOLLECTION_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_DWLDCOLLECTIONMethodNames[kDWLDCOLLECTION_NUM_METHOD_IDENTIFIERS] = { - "item" - }; - -static void DWLDCOLLECTIONinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_DWLDCOLLECTIONPropertyNames, kDWLDCOLLECTION_NUM_PROPERTY_IDENTIFIERS, v_DWLDCOLLECTIONPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_DWLDCOLLECTIONMethodNames, kDWLDCOLLECTION_NUM_METHOD_IDENTIFIERS, v_DWLDCOLLECTIONMethodIdentifiers ); -} - - -NPClass stDWLDCOLLECTIONclass; -NPClass* pDWLDCOLLECTIONclass = NULL; - -NPClass* fillDWLDCOLLECTIONpclass(void) -{ - TRACEINFO; - if (pDWLDCOLLECTIONclass == NULL) - { - stDWLDCOLLECTIONclass.allocate = DWLDCOLLECTION_Allocate; - stDWLDCOLLECTIONclass.deallocate = DWLDCOLLECTION_Deallocate; - stDWLDCOLLECTIONclass.invalidate = DWLDCOLLECTION_Invalidate; - stDWLDCOLLECTIONclass.hasMethod = DWLDCOLLECTION_HasMethod; - stDWLDCOLLECTIONclass.invoke = DWLDCOLLECTION_Invoke; - stDWLDCOLLECTIONclass.invokeDefault = DWLDCOLLECTION_InvokeDefault; - stDWLDCOLLECTIONclass.hasProperty = DWLDCOLLECTION_HasProperty; - stDWLDCOLLECTIONclass.getProperty = DWLDCOLLECTION_GetProperty; - stDWLDCOLLECTIONclass.setProperty = DWLDCOLLECTION_SetProperty; - stDWLDCOLLECTIONclass.removeProperty = DWLDCOLLECTION_RemoveProperty; - stDWLDCOLLECTIONclass.enumerate = DWLDCOLLECTION_Enumerate; - pDWLDCOLLECTIONclass = &stDWLDCOLLECTIONclass; - } - - return pDWLDCOLLECTIONclass; -} - - -NPObject * DWLDCOLLECTION_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - if (!v_bDWLDCOLLECTIONIdentifiersInitialized) - { - v_bDWLDCOLLECTIONIdentifiersInitialized = true; - DWLDCOLLECTIONinitializeIdentifiers(); - } - - NPObject* newdwldcollection = (NPObject *)MEMALLOC(sizeof(NPObject)); - - return newdwldcollection; -} - - -void DWLDCOLLECTION_Deallocate(NPObject* obj) -{ - TRACEINFO; - MEMFREE(obj); - return; -} - -void DWLDCOLLECTION_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - -bool DWLDCOLLECTION_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kDWLDCOLLECTION_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_DWLDCOLLECTIONMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool DWLDCOLLECTION_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - if (name == v_DWLDCOLLECTIONMethodIdentifiers[kDWLDCOLLECTION_ID_METHOD_ITEM ]) - { - DWLDCOLLECTION_Invoke_Item(obj, args, argCount); - fctresult = true; - } - else - { - fctresult = false; - } - return fctresult; - -} - -bool DWLDCOLLECTION_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - -bool DWLDCOLLECTION_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kDWLDCOLLECTION_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_DWLDCOLLECTIONPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - - return result; -} - -bool DWLDCOLLECTION_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - -bool DWLDCOLLECTION_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - -bool DWLDCOLLECTION_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - -bool DWLDCOLLECTION_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - -/** implementation **/ -void DWLDCOLLECTION_Invoke_Item(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadcollectionclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadcollectionclass.h deleted file mode 100644 index c178d1b..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/downloadcollectionclass.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __DWLDCOLLECTIONCOLLECTIONCLASS_H__ -#define __DWLDCOLLECTIONCOLLECTIONCLASS_H__ - -#include "hbbtvbrowserplugin.h" - - -NPClass* fillDWLDCOLLECTIONpclass(void); - -NPObject * DWLDCOLLECTION_Allocate(NPP npp, NPClass *aClass); -void DWLDCOLLECTION_Deallocate(NPObject *obj); -void DWLDCOLLECTION_Invalidate(NPObject *obj); -bool DWLDCOLLECTION_HasMethod(NPObject *obj, NPIdentifier name); -bool DWLDCOLLECTION_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool DWLDCOLLECTION_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool DWLDCOLLECTION_HasProperty(NPObject *obj, NPIdentifier name); -bool DWLDCOLLECTION_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool DWLDCOLLECTION_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool DWLDCOLLECTION_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool DWLDCOLLECTION_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - -void DWLDCOLLECTION_Invoke_Item(NPObject* obj,const NPVariant* args, uint32_t argCount); -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinfocollectionclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinfocollectionclass.c deleted file mode 100644 index 0dc0bd0..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinfocollectionclass.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "drmcontrolinfocollectionclass.h" diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinfocollectionclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinfocollectionclass.h deleted file mode 100644 index cb20d97..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinfocollectionclass.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __DRMCONTROLINFOCOLLECTIONCLASS_H__ -#define __DRMCONTROLINFOCOLLECTIONCLASS_H__ - -#include "hbbtvbrowserplugin.h" - - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinformationclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinformationclass.c deleted file mode 100644 index 0dc0bd0..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinformationclass.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "drmcontrolinfocollectionclass.h" diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinformationclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinformationclass.h deleted file mode 100644 index b9a2121..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/drmcontrolinformationclass.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __DRMCONTROLINFORMATIONCLASS_H__ -#define __DRMCONTROLINFORMATIONCLASS_H__ - -#include "hbbtvbrowserplugin.h" - - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserplugin.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserplugin.c deleted file mode 100644 index 82c6425..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserplugin.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -/* -** HbbTV Plugin PC -*/ - - -#include -#ifdef XP_UNIX -#include -#include -#endif -#include - -#include "hbbtvbrowserplugin.h" -#include "oipfapplicationmanager.h" -#include "oipfconfiguration.h" -#include "videobroadcast.h" - -#define MIMETYPEDESCRIPTION "application/hbbtvbrowserplugin::Hbbtv Browser Plugin;" \ - "video/broadcast::Video Broadcast;"\ - "application/oipfapplicationmanager::Oipf Application Manager;"\ - "application/oipfconfiguration::Oipf Configuration;" - - -#define PLUGIN_NAME "hbbtvbrowserplugin" -#define PLUGIN_DESCRIPTION "HbbTV browser plugin " -#define PLUGIN_VERSION "0.20110704" - - - -static void -fillPluginFunctionTable(NPPluginFuncs* pFuncs) -{ - TRACEINFO; - pFuncs->version = 11; - pFuncs->size = sizeof(*pFuncs); - pFuncs->newp = OIPF_NPP_New; - pFuncs->destroy = OIPF_NPP_Destroy; - pFuncs->setwindow = OIPF_NPP_SetWindow; - pFuncs->newstream = OIPF_NPP_NewStream; -// pFuncs->destroystream = NPP_DestroyStream; -// pFuncs->asfile = NPP_StreamAsFile; -// pFuncs->writeready = NPP_WriteReady; -// pFuncs->write = NPP_Write; -// pFuncs->print = NPP_Print; - pFuncs->event = OIPF_NPP_HandleEvent; -// pFuncs->urlnotify = NPP_URLNotify; - pFuncs->getvalue = OIPF_NPP_GetValue; - pFuncs->setvalue = OIPF_NPP_SetValue; -} - -char* booltostr(bool data) -{ - char *result; - if (data) - result = "true"; - else - result = "false"; - return result; -} - -/* - void drawWindow (HBBTVPluginData* instanceData, GdkDrawable* gdkWindow) -{ - TRACEINFO; - NPWindow window = *(instanceData->window); - int x = window.x; - int y = window.y; - int width = window.width; - int height = window.height; - fprintf(stderr,"%p, x = %i y=%i, width = %i height = %i\n",gdkWindow, x ,y,width,height); - - NPP npp = instanceData->npp; - if (!npp) - return; - - const char* uaString = "DemoPlug"; // sBrowserFuncs->uagent(npp); - if (!uaString) - return; - - GdkGC* gdkContext = gdk_gc_new(gdkWindow); - - // draw a grey background for the plugin frame - GdkColor grey; - grey.red = 24000; grey.blue = 24000; grey.green = 24000; - gdk_gc_set_rgb_fg_color(gdkContext, &grey); - gdk_draw_rectangle(gdkWindow, gdkContext, TRUE, x, y, width, height); - - // draw a 3-pixel-thick black frame around the plugin - GdkColor black; - black.red = black.green = black.blue = 0; - gdk_gc_set_rgb_fg_color(gdkContext, &black); - gdk_gc_set_line_attributes(gdkContext, 3, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_MITER); - gdk_draw_rectangle(gdkWindow, gdkContext, FALSE, x + 1, y + 1, - width - 3, height - 3); - - // paint the UA string - PangoContext* pangoContext = gdk_pango_context_get(); - PangoLayout* pangoTextLayout = pango_layout_new(pangoContext); - pango_layout_set_width(pangoTextLayout, (width - 10) * PANGO_SCALE); - pango_layout_set_text(pangoTextLayout, uaString, -1); - gdk_draw_layout(gdkWindow, gdkContext, x + 5, y + 5, pangoTextLayout); - g_object_unref(pangoTextLayout); - - g_object_unref(gdkContext); -} -*/ - - -NPError NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs) -{ - TRACEINFO; - - sBrowserFuncs = bFuncs; - - fillPluginFunctionTable(pFuncs); - - return NPERR_NO_ERROR; -} - -char* NP_GetPluginVersion() -{ - TRACEINFO; - return PLUGIN_VERSION; -} - -NPError NP_Shutdown() -{ - TRACEINFO; - return NPERR_NO_ERROR; -} - -char* NP_GetMIMEDescription() -{ - TRACEINFO; - return MIMETYPEDESCRIPTION; -} - - -NPError NP_GetValue(void *instance, NPPVariable variable, void *value) -{ - TRACEINFO; - switch (variable) - { - case NPPVpluginNameString : - *(char**)value = PLUGIN_NAME; - break; - case NPPVpluginDescriptionString : - *(char**)value = PLUGIN_DESCRIPTION; - break; - default : - break; - } - return NPERR_NO_ERROR; -} - -NPError OIPF_NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved) -{ - TRACEINFO; - int i = 0; - - NPBool browserSupportsWindowless = false; - sBrowserFuncs->getvalue(instance, NPNVSupportsWindowless, &browserSupportsWindowless); - if (!browserSupportsWindowless) - { - return NPERR_GENERIC_ERROR; - } - sBrowserFuncs->setvalue(instance, NPPVpluginWindowBool, (void*)false); - sBrowserFuncs->setvalue(instance, NPPVpluginTransparentBool, (void*)false); - - - NPObject* obj; - for(i = 0 ; ipdata = (HBBTVPluginData*)MEMALLOC(sizeof(HBBTVPluginData)); - HBBTVPluginData* pdata = ((HBBTVPluginData*)instance->pdata); - - if (strcmp(argv[i], "application/oipfApplicationManager") == 0) - { - obj = sBrowserFuncs->createobject(instance, fillOAMpclass()); - } - else if (strcmp(argv[i], "application/oipfConfiguration") == 0) - { - obj = sBrowserFuncs->createobject(instance, fillOCFGpclass()); - } - else if (strcmp(argv[i], "video/broadcast") == 0) - { - obj = sBrowserFuncs->createobject(instance, fillVIDBRCpclass()); - }else{ - - obj = NULL; - } - pdata->type = (char*)MEMALLOC(strlen(argv[i])); - strcpy(pdata->type, argv[i] ); - pdata->obj = obj; - pdata->npp = instance; - - }else{ - - obj = NULL; - } - } - - return NPERR_NO_ERROR; -} - -NPError OIPF_NPP_Destroy(NPP instance, NPSavedData **save) -{ - TRACEINFO; - HBBTVPluginData* pdata = (HBBTVPluginData*)instance->pdata; - if (pdata) - { - sBrowserFuncs->releaseobject(pdata->obj); - MEMFREE(pdata->type); - MEMFREE(pdata); - } - return NPERR_NO_ERROR; -} - - -NPError OIPF_NPP_SetWindow(NPP instance, NPWindow *window) -{ - TRACEINFO; - - - - HBBTVPluginData* pdata = (HBBTVPluginData*)instance->pdata; - if(pdata) - { - pdata->window = window; - if (pdata->type) - { - if (strcmp(pdata->type, "video/broadcast") == 0) - { - fprintf(stderr, "%s found \n", pdata->type); - if (pdata->obj) - { - NPObj_VidBrc* vidbrcobj = (NPObj_VidBrc*)pdata->obj; - if (!(vidbrcobj->fullscreen)) - { - OnNoFullscreenSetWindow(pdata->window->x, - pdata->window->y, - pdata->window->width, - pdata->window->height); - } - } - } - } - /*fprintf(stderr, "\tWindow found : %p\n", window); - fprintf(stderr, "\twindow = %p ws_info %p \n\tx = %d, y= %d\n\tclipRect.left = %d clipRect.top= %d\n\twidth=%d, height= %d\n", - pdata->window->window, - pdata->window->ws_info, - pdata->window->x, - pdata->window->y, - pdata->window->clipRect.left, - pdata->window->clipRect.top, - pdata->window->width, - pdata->window->height);*/ - } - - return NPERR_NO_ERROR; -} - -NPError OIPF_NPP_HandleEvent(NPP instance, void* event) -{ - //TRACEINFO; // frequent event, avoid over log... - - XEvent *nativeEvent = (XEvent*)event; - if (nativeEvent->type == GraphicsExpose) - { - XGraphicsExposeEvent *expose = &nativeEvent->xgraphicsexpose; - GC gc = XCreateGC(expose->display, expose->drawable, 0, 0); - XFillRectangle(expose->display, expose->drawable, gc, expose->x, expose->y,expose->width, expose->height); - XFreeGC(expose->display, gc); - return true; - } - - - return false; -} - - - -NPError OIPF_NPP_GetValue(NPP instance, NPPVariable variable, void *value) -{ - TRACEINFO; - - if ( variable == NPPVpluginScriptableNPObject ) - { - void ** v = (void **)value; - if(instance->pdata) - { - NPObject* obj = ((HBBTVPluginData*)instance->pdata)->obj; - if(obj == NULL){ - }else{ - sBrowserFuncs->retainobject(obj); - } - *v = obj; - } - } - return NPERR_NO_ERROR; -} - - -NPError OIPF_NPP_SetValue(NPP instance, NPNVariable variable, void *value) -{ - TRACEINFO; - return NPERR_GENERIC_ERROR; -} - - -NPError OIPF_NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) -{ - TRACEINFO; - return NPERR_GENERIC_ERROR; -} - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserplugin.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserplugin.h deleted file mode 100644 index 87e61c0..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserplugin.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef hbbtvbrowserplugin_h -#define hbbtvbrowserplugin_h - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include -#include -#include -#include - -#include "hbbtvbrowserpluginapi.h" - -#ifndef DEBUG - #define DEBUG true - #define PROJECTNAME "HbbTVBrowserPlugin" - #define TRACEINFO if (DEBUG) { fprintf(stderr,"\x1b[%i;3%im%s\x1b[0m : call %s\n", 1, 3, PROJECTNAME, __FUNCTION__); } - #define NOTIMPLEMENTED if (DEBUG) { printf("%s : %s is \x1b[1;31mNOT IMPLEMENTED\x1b[0m : TODO \n", PROJECTNAME, __FUNCTION__); } -#endif - -typedef struct -{ - NPObject* obj; - char* type; - NPWindow* window; - NPP npp; -}HBBTVPluginData; - -NPNetscapeFuncs* sBrowserFuncs; - -#define ALLOCBROWSERMEMORY true - -#ifdef ALLOCBROWSERMEMORY - #define MEMALLOC sBrowserFuncs->memalloc - #define MEMFREE sBrowserFuncs->memfree -#else - #define MEMALLOC malloc - #define MEMFREE free -#endif - -char* booltostr(bool data); - -NPError NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs); -NPError NP_Shutdown(); -NPError NP_GetValue(void *instance, NPPVariable variable, void *value); -char* NP_GetPluginVersion(); -char* NP_GetMIMEDescription(); - -NPError OIPF_NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved); -NPError OIPF_NPP_Destroy(NPP instance, NPSavedData **save); -NPError OIPF_NPP_SetWindow(NPP instance, NPWindow *window); -NPError OIPF_NPP_HandleEvent(NPP instance, void* Event); -NPError OIPF_NPP_GetValue(NPP instance, NPPVariable variable, void *value); -NPError OIPF_NPP_SetValue(NPP instance, NPNVariable variable, void *value); -NPError OIPF_NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserpluginapi.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserpluginapi.c deleted file mode 100644 index aa7ff81..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserpluginapi.c +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */#include "hbbtvbrowserpluginapi.h" - - -void OnNoFullscreenSetWindow(int x, int y, int width, int height) -{ -} - -void OnAPPLICATION_Show() -{ -} - -void OnAPPLICATION_Hide() -{ -} - -void OnVIDBRC_SetFullScreen(int fullscreenparam) -{ -} - -void OnKEYSET_SetValue(double param) -{ -} - -void OnKEYSET_Allocate() -{ -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserpluginapi.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserpluginapi.h deleted file mode 100644 index 70408a1..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/hbbtvbrowserpluginapi.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef hbbtvbrowserpluginapi_h -#define hbbtvbrowserpluginapi_h - -#include - -///Callbacks -void OnNoFullscreenSetWindow(int x, int y, int width, int height); -void OnAPPLICATION_Show(); -void OnAPPLICATION_Hide(); -void OnVIDBRC_SetFullScreen(int fullscreenparam); -void OnKEYSET_SetValue(double param); -void OnKEYSET_Allocate(); -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/keysetclass.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/keysetclass.c deleted file mode 100644 index 6e9a9d1..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/keysetclass.c +++ /dev/null @@ -1,330 +0,0 @@ - -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */#include "keysetclass.h" - -#define kKEYSET_ID_PROPERTY_VALUE 0 -#define kKEYSET_ID_PROPERTY_MAXIMUMVALUE 1 -#define kKEYSET_ID_PROPERTY_RED 2 -#define kKEYSET_ID_PROPERTY_GREEN 3 -#define kKEYSET_ID_PROPERTY_YELLOW 4 -#define kKEYSET_ID_PROPERTY_BLUE 5 -#define kKEYSET_ID_PROPERTY_NAVIGATION 6 -#define kKEYSET_ID_PROPERTY_VCR 7 -#define kKEYSET_ID_PROPERTY_SCROLL 8 -#define kKEYSET_ID_PROPERTY_INFO 9 -#define kKEYSET_ID_PROPERTY_NUMERIC 10 -#define kKEYSET_ID_PROPERTY_ALPHA 11 -#define kKEYSET_ID_PROPERTY_OTHER 12 -#define kKEYSET_NUM_PROPERTY_IDENTIFIERS 13 - -#define kKEYSET_ID_METHOD_SETVALUE 0 -#define kKEYSET_NUM_METHOD_IDENTIFIERS 1 - - - -bool v_bKEYSETIdentifiersInitialized = false; - -NPIdentifier v_KEYSETPropertyIdentifiers[kKEYSET_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_KEYSETPropertyNames[kKEYSET_NUM_PROPERTY_IDENTIFIERS] = { - "value", - "maximumValue", - "RED", - "GREEN", - "YELLOW", - "BLUE", - "NAVIGATION", - "VCR", - "SCROLL", - "INFO", - "NUMERIC", - "ALPHA", - "OTHER" - }; - -NPIdentifier v_KEYSETMethodIdentifiers[kKEYSET_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_KEYSETMethodNames[kKEYSET_NUM_METHOD_IDENTIFIERS] = { - "setValue" - }; - -static void KEYSETinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_KEYSETPropertyNames, kKEYSET_NUM_PROPERTY_IDENTIFIERS, v_KEYSETPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_KEYSETMethodNames, kKEYSET_NUM_METHOD_IDENTIFIERS, v_KEYSETMethodIdentifiers ); -} - - -NPClass stKEYSETclass; -NPClass* pKEYSETclass = NULL; - -NPClass* fillKEYSETpclass(void) -{ - TRACEINFO; - if (pKEYSETclass == NULL) - { - stKEYSETclass.allocate = KEYSET_Allocate; - stKEYSETclass.deallocate = KEYSET_Deallocate; - stKEYSETclass.invalidate = KEYSET_Invalidate; - stKEYSETclass.hasMethod = KEYSET_HasMethod; - stKEYSETclass.invoke = KEYSET_Invoke; - stKEYSETclass.invokeDefault = KEYSET_InvokeDefault; - stKEYSETclass.hasProperty = KEYSET_HasProperty; - stKEYSETclass.getProperty = KEYSET_GetProperty; - stKEYSETclass.setProperty = KEYSET_SetProperty; - stKEYSETclass.removeProperty = KEYSET_RemoveProperty; - stKEYSETclass.enumerate = KEYSET_Enumerate; - pKEYSETclass = &stKEYSETclass; - } - - return pKEYSETclass; -} - - -NPObject * KEYSET_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - NPObject* result; - - - if (!v_bKEYSETIdentifiersInitialized) - { - v_bKEYSETIdentifiersInitialized = true; - KEYSETinitializeIdentifiers(); - } - - NPObj_KeySet* newkeyset = (NPObj_KeySet *)MEMALLOC(sizeof(NPObj_KeySet)); - newkeyset->npp = npp; - newkeyset->value = (double*)MEMALLOC(sizeof(double)); - newkeyset->maximumValue = (double*)MEMALLOC(sizeof(double)); - result = (NPObject*)newkeyset; - OnKEYSET_Allocate(); - return result; -} - - -void KEYSET_Deallocate(NPObject* obj) -{ - TRACEINFO; - NPObj_KeySet* keysetobj = (NPObj_KeySet*)obj; - MEMFREE(keysetobj->value); - MEMFREE(keysetobj->maximumValue); - MEMFREE(keysetobj); - return; -} - -void KEYSET_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - -bool KEYSET_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kKEYSET_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_KEYSETMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool KEYSET_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - if (name == v_KEYSETMethodIdentifiers[kKEYSET_ID_METHOD_SETVALUE]) - { - KEYSET_Invoke_SetValue(obj, args, argCount, result); - fctresult = true; - } - else - { - fctresult = false; - } - return fctresult; -} - -bool KEYSET_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - -bool KEYSET_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kKEYSET_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_KEYSETPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - - return result; -} - -bool KEYSET_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - NPObj_KeySet* keysetobj = (NPObj_KeySet*)obj; - - double KEYMASK_RED = 0x1; - double KEYMASK_GREEN = 0x2; - double KEYMASK_YELLOW = 0x4; - double KEYMASK_BLUE = 0x8; - double KEYMASK_NAVIGATION = 0x10; - double KEYMASK_VCR = 0x20; - double KEYMASK_SCROLL = 0x40; - double KEYMASK_INFO = 0x80; - double KEYMASK_NUMERIC = 0x100; - double KEYMASK_ALPHA = 0x200; - double KEYMASK_OTHER = 0x400; - - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_RED]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_RED, *result); - fctresult = true; - } - else - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_GREEN]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_GREEN, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_YELLOW]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_YELLOW, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_BLUE]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_BLUE, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_NAVIGATION]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_NAVIGATION, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_VCR]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_VCR, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_SCROLL]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_SCROLL, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_INFO]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_INFO, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_NUMERIC]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_NUMERIC, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_ALPHA]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_ALPHA, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_OTHER]) - { - DOUBLE_TO_NPVARIANT(KEYMASK_OTHER, *result); - fctresult = true; - } - if (name == v_KEYSETPropertyIdentifiers[kKEYSET_ID_PROPERTY_VALUE]) - { - double* value = keysetobj->value; - DOUBLE_TO_NPVARIANT(*value, *result); - fctresult = true; - } - - if (fctresult) - { - - } - - - - return fctresult; -} - -bool KEYSET_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - bool fctresult = false; - - return fctresult; -} - -bool KEYSET_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - -bool KEYSET_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - - -/** implementation **/ -void KEYSET_Invoke_SetValue(NPObject* obj,const NPVariant* args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - //~ NOTIMPLEMENTED; // in progress - double param; - NPObj_KeySet* keysetobj = (NPObj_KeySet*)obj; - double* value = keysetobj->value; - fprintf(stderr,"nb args : %i, %f", argCount,NPVARIANT_TO_DOUBLE(args[0]) ); - if (!NPVARIANT_IS_DOUBLE(args[0])) { - fprintf(stderr,"\t%s : error\n",__FUNCTION__); - return; - } - else { - param = NPVARIANT_TO_DOUBLE( args[0] ); - fprintf(stderr, "\t%s : param to transmit %f \n", __FUNCTION__, param); - *value = param; - OnKEYSET_SetValue(param); - } -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/keysetclass.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/keysetclass.h deleted file mode 100644 index 5448d64..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/keysetclass.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __HBBTVKEYSET_H__ -#define __HBBTVKEYSET_H__ - -#include "hbbtvbrowserplugin.h" - -typedef struct -{ - NPObject header; - NPP npp; - - double* value; - double* maximumValue; -} NPObj_KeySet; - -NPClass* fillKEYSETpclass(void); - -NPObject * KEYSET_Allocate(NPP npp, NPClass *aClass); -void KEYSET_Deallocate(NPObject *obj); -void KEYSET_Invalidate(NPObject *obj); -bool KEYSET_HasMethod(NPObject *obj, NPIdentifier name); -bool KEYSET_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool KEYSET_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool KEYSET_HasProperty(NPObject *obj, NPIdentifier name); -bool KEYSET_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool KEYSET_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); -bool KEYSET_RemoveProperty(NPObject *npobj, NPIdentifier name); -bool KEYSET_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - -void KEYSET_Invoke_SetValue(NPObject* obj,const NPVariant* args, uint32_t argCount, NPVariant *result); - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/makefile.am b/applications/hbbtvplayer/hbbtvbrowserplugin/src/makefile.am deleted file mode 100644 index 59c0d4c..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/makefile.am +++ /dev/null @@ -1,47 +0,0 @@ - -lib_LTLIBRARIES = libhbbtvbrowserplugin.la - -libhbbtvbrowserplugin_la_SOURCES = hbbtvbrowserplugin.c\ - hbbtvbrowserpluginapi.c\ - oipfapplicationmanager.c\ - applicationclass.c\ - applicationprivatedataclass.c\ - oipfconfiguration.c\ - configurationclass.c\ - oipfdownloadmanager.c\ - oipfdownloadtrigger.c\ - downloadclass.c\ - downloadcollectionclass.c\ - drmcontrolinfocollectionclass.c\ - drmcontrolinformationclass.c\ - videobroadcast.c\ - keysetclass.c\ - hbbtvbrowserplugin.h\ - hbbtvbrowserpluginapi.h\ - oipfapplicationmanager.h\ - applicationclass.h\ - applicationprivatedataclass.h\ - oipfconfiguration.h\ - configurationclass.h\ - oipfdownloadmanager.h\ - oipfdownloadtrigger.h\ - downloadclass.h\ - downloadcollectionclass.h\ - drmcontrolinfocollectionclass.h\ - drmcontrolinformationclass.h\ - videobroadcast.h\ - keysetclass.h - -library_includedir=$(includedir)/@PACKAGE_NAME@ -library_include_HEADERS = hbbtvbrowserpluginapi.h - -SPECIALCFLAGS = -g -Wall -DXP_UNIX=1 -DMOZ_X11=1 -fPIC -libhbbtvbrowserplugin_la_CFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(NPAPI_CFLAGS) $(SPECIALCFLAGS) -I./webkit-plugin-header/ -I./src/webkit-plugin-header/ -libhbbtvbrowserplugin_la_LDFLAGS = $(GLIB_LIBS) $(GTK_LIBS) $(NPAPI_LIBS) $(SPECIALCFLAGS) -libhbbtvbrowserplugin_la_LIBADD = $(GLIB_LIBS) $(GTK_LIBS) $(NPAPI_LIBS) - -install-exec-local : - ln -fs $(libdir)/lib@PACKAGE_NAME@.so.0.0.0 $(PLUGINDIR)/lib@PACKAGE_NAME@.so - -uninstall-local : - rm -f $(PLUGINDIR)/lib@PACKAGE_NAME@.so diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfapplicationmanager.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfapplicationmanager.c deleted file mode 100644 index 5adebaf..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfapplicationmanager.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "oipfapplicationmanager.h" -#include "applicationclass.h" - -#define kOAM_ID_PROPERTY_ON_LOW_MEMORY 0 -#define kOAM_NUM_PROPERTY_IDENTIFIERS 1 - -#define kOAM_ID_METHOD_GET_OWNER_APPLICATION 0 -#define kOAM_NUM_METHOD_IDENTIFIERS 1 - -bool v_bOAMIdentifiersInitialized = false; - -NPIdentifier v_OAMPropertyIdentifiers[kOAM_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_OAMPropertyNames[kOAM_NUM_PROPERTY_IDENTIFIERS] = { - "onLowMemory" - }; - -NPIdentifier v_OAMMethodIdentifiers[kOAM_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_OAMMethodNames[kOAM_NUM_METHOD_IDENTIFIERS] = { - "getOwnerApplication" -}; - - - - -static void OAMinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_OAMPropertyNames, kOAM_NUM_PROPERTY_IDENTIFIERS, v_OAMPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_OAMMethodNames, kOAM_NUM_METHOD_IDENTIFIERS, v_OAMMethodIdentifiers ); -} - -NPClass stOAMclass; -NPClass* pOAMclass = NULL; - -NPClass* fillOAMpclass(void) -{ - TRACEINFO; - if (pOAMclass == NULL) - { - stOAMclass.allocate = OAM_Allocate; - stOAMclass.deallocate = OAM_Deallocate; - stOAMclass.invalidate = OAM_Invalidate; - stOAMclass.hasMethod = OAM_HasMethod; - stOAMclass.invoke = OAM_Invoke; - stOAMclass.invokeDefault = OAM_InvokeDefault; - stOAMclass.hasProperty = OAM_HasProperty; - stOAMclass.getProperty = OAM_GetProperty; - stOAMclass.setProperty = OAM_SetProperty; - stOAMclass.removeProperty = OAM_RemoveProperty; - stOAMclass.enumerate = OAM_Enumerate; - pOAMclass = &stOAMclass; - } - - return pOAMclass; -} - - -NPObject * OAM_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - - if (!v_bOAMIdentifiersInitialized) - { - v_bOAMIdentifiersInitialized = true; - OAMinitializeIdentifiers(); - } - - NPObj_OAM* newapplicationmanager = (NPObj_OAM*)MEMALLOC(sizeof(NPObj_OAM)); - fprintf(stderr, "\t%s : Allocation at \x1b[%i;3%im%p\n\x1b[0m ",__FUNCTION__, 1, 1, newapplicationmanager ); - newapplicationmanager->npp = npp; - newapplicationmanager->ownerApplication = sBrowserFuncs->createobject(npp, fillAPPLICATIONpclass()); - fprintf(stderr, "\t%s : Create ownerApplication member at \x1b[%i;3%im%p\n\x1b[0m ",__FUNCTION__, 1, 1, newapplicationmanager->ownerApplication ); - return (NPObject *)newapplicationmanager; -} - - void OAM_Deallocate(NPObject* obj) -{ - TRACEINFO; - NPObj_OAM* oamobj = (NPObj_OAM*)obj; - sBrowserFuncs->releaseobject(oamobj->ownerApplication); - MEMFREE(oamobj); - return; -} - - void OAM_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - - bool OAM_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kOAM_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_OAMMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool OAM_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - //OAM_ObjectMain * pMainObj = reinterpret_cast(obj); - bool fctresult = false; - if (name == v_OAMMethodIdentifiers[kOAM_ID_METHOD_GET_OWNER_APPLICATION]) - { - OAM_ObjectMain_Invoke_GetOwnerApplication((NPObj_OAM*)obj, args, argCount, result); - fctresult = true; - } - else - { - - fctresult = false; - } - return fctresult; -} - - bool OAM_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - - bool OAM_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kOAM_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_OAMPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool OAM_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - - bool OAM_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - - bool OAM_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - - bool OAM_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - -/** implementation **/ -void OAM_ObjectMain_Invoke_GetOwnerApplication(NPObj_OAM* obj,const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - sBrowserFuncs->retainobject(obj->ownerApplication); - OBJECT_TO_NPVARIANT((NPObject*)(obj->ownerApplication), *result); -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfapplicationmanager.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfapplicationmanager.h deleted file mode 100644 index 4334fe4..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfapplicationmanager.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __OIPFAPPLICATIONMANAGER_H__ -#define __OIPFAPPLICATIONMANAGER_H__ - -#include "hbbtvbrowserplugin.h" - -typedef struct { - NPObject header; - NPP npp; - - NPObject* ownerApplication; -} NPObj_OAM; - -NPClass* fillOAMpclass(void); - -NPObject * OAM_Allocate(NPP npp, NPClass *aClass); -void OAM_Deallocate(NPObject *obj); -void OAM_Invalidate(NPObject *obj); -bool OAM_HasMethod(NPObject *obj, NPIdentifier name); -bool OAM_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool OAM_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool OAM_HasProperty(NPObject *obj, NPIdentifier name); -bool OAM_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool OAM_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); -bool OAM_RemoveProperty(NPObject *npobj, NPIdentifier name); -bool OAM_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - -void OAM_ObjectMain_Invoke_GetOwnerApplication(NPObj_OAM* obj,const NPVariant* args, uint32_t argCount, NPVariant* result); - -/* -typedef struct{ - NPObject headear; - NPP npp; - NPObject* onLowMemory; - NPObject* ownerApplication; - NPObject* newApplication; -} OAM_ObjectMain; -*/ - - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfconfiguration.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfconfiguration.c deleted file mode 100644 index cb20c44..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfconfiguration.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "oipfconfiguration.h" - -#define kOCFG_ID_PROPERTY_CONFIGURATION 0 -#define kOCFG_NUM_PROPERTY_IDENTIFIERS 1 - -#define kOCFG_NUM_METHOD_IDENTIFIERS 0 - -bool v_bOCFGIdentifiersInitialized = false; - -NPIdentifier v_OCFGPropertyIdentifiers[kOCFG_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_OCFGPropertyNames[kOCFG_NUM_PROPERTY_IDENTIFIERS] = { - "configuration" - }; - -NPIdentifier v_OCFGMethodIdentifiers[kOCFG_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_OCFGMethodNames[kOCFG_NUM_METHOD_IDENTIFIERS] = {}; - -static void OCFGinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_OCFGPropertyNames, kOCFG_NUM_PROPERTY_IDENTIFIERS, v_OCFGPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_OCFGMethodNames, kOCFG_NUM_METHOD_IDENTIFIERS, v_OCFGMethodIdentifiers ); -} - - -NPClass stOCFGclass; -NPClass* pOCFGclass = NULL; - -NPClass* fillOCFGpclass(void) -{ - TRACEINFO; - if (pOCFGclass == NULL) - { - stOCFGclass.allocate = OCFG_Allocate; - stOCFGclass.deallocate = OCFG_Deallocate; - stOCFGclass.invalidate = OCFG_Invalidate; - stOCFGclass.hasMethod = OCFG_HasMethod; - stOCFGclass.invoke = OCFG_Invoke; - stOCFGclass.invokeDefault = OCFG_InvokeDefault; - stOCFGclass.hasProperty = OCFG_HasProperty; - stOCFGclass.getProperty = OCFG_GetProperty; - stOCFGclass.setProperty = OCFG_SetProperty; - stOCFGclass.removeProperty = OCFG_RemoveProperty; - stOCFGclass.enumerate = OCFG_Enumerate; - pOCFGclass = &stOCFGclass; - } - - return pOCFGclass; -} - - -NPObject * OCFG_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - NPObject* result; - - - if (!v_bOCFGIdentifiersInitialized) - { - v_bOCFGIdentifiersInitialized = true; - OCFGinitializeIdentifiers(); - } - - NPObject* newocfg = (NPObject*)MEMALLOC(sizeof(NPObject)); - result = newocfg; - - return result; -} - - -void OCFG_Deallocate(NPObject* obj) -{ - TRACEINFO; - MEMFREE(obj); - return; -} - -void OCFG_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - -bool OCFG_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kOCFG_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_OCFGMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool OCFG_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - - bool fctresult; - - fctresult = false; - - return fctresult; - -} - -bool OCFG_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - -bool OCFG_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kOCFG_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_OCFGPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool OCFG_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - -bool OCFG_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - -bool OCFG_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - -bool OCFG_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfconfiguration.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfconfiguration.h deleted file mode 100644 index 25f8cf3..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfconfiguration.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __OIPFCONFIGURATION_H__ -#define __OIPFCONFIGURATION_H__ - -#include "hbbtvbrowserplugin.h" - -NPClass* fillOCFGpclass(void); - -NPObject * OCFG_Allocate(NPP npp, NPClass *aClass); -void OCFG_Deallocate(NPObject *obj); -void OCFG_Invalidate(NPObject *obj); -bool OCFG_HasMethod(NPObject *obj, NPIdentifier name); -bool OCFG_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool OCFG_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool OCFG_HasProperty(NPObject *obj, NPIdentifier name); -bool OCFG_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool OCFG_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool OCFG_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool OCFG_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadmanager.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadmanager.c deleted file mode 100644 index cfe9e0f..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadmanager.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "oipfdownloadmanager.h" - -#define kODWLDMAN_ID_PROPERTY_ONDOWNLOADSTATECHANGE 0 -#define kODWLDMAN_NUM_PROPERTY_IDENTIFIERS 1 - -#define kODWLDMAN_ID_METHOD_PAUSE 0 -#define kODWLDMAN_ID_METHOD_RESUME 1 -#define kODWLDMAN_ID_METHOD_REMOVE 2 -#define kODWLDMAN_ID_METHOD_GETDOWNLOADS 3 -#define kODWLDMAN_NUM_METHOD_IDENTIFIERS 4 - -bool v_bODWLDMANIdentifiersInitialized = false; - -NPIdentifier v_ODWLDMANPropertyIdentifiers[kODWLDMAN_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_ODWLDMANPropertyNames[kODWLDMAN_NUM_PROPERTY_IDENTIFIERS] = { - "onDownloadStateChange" - }; - -NPIdentifier v_ODWLDMANMethodIdentifiers[kODWLDMAN_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_ODWLDMANMethodNames[kODWLDMAN_NUM_METHOD_IDENTIFIERS] = { - "pause", - "resume", - "remove", - "getDownloads" -}; - - -static void ODWLDMANinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_ODWLDMANPropertyNames, kODWLDMAN_NUM_PROPERTY_IDENTIFIERS, v_ODWLDMANPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_ODWLDMANMethodNames, kODWLDMAN_NUM_METHOD_IDENTIFIERS, v_ODWLDMANMethodIdentifiers ); -} - -NPClass stODWLDMANclass; -NPClass* pODWLDMANclass = NULL; - -NPClass* fillODWLDMANpclass(void) -{ - TRACEINFO; - if (pODWLDMANclass == NULL) - { - stODWLDMANclass.allocate = ODWLDMAN_Allocate; - stODWLDMANclass.deallocate = ODWLDMAN_Deallocate; - stODWLDMANclass.invalidate = ODWLDMAN_Invalidate; - stODWLDMANclass.hasMethod = ODWLDMAN_HasMethod; - stODWLDMANclass.invoke = ODWLDMAN_Invoke; - stODWLDMANclass.invokeDefault = ODWLDMAN_InvokeDefault; - stODWLDMANclass.hasProperty = ODWLDMAN_HasProperty; - stODWLDMANclass.getProperty = ODWLDMAN_GetProperty; - stODWLDMANclass.setProperty = ODWLDMAN_SetProperty; - stODWLDMANclass.removeProperty = ODWLDMAN_RemoveProperty; - stODWLDMANclass.enumerate = ODWLDMAN_Enumerate; - pODWLDMANclass = &stODWLDMANclass; - } - - return pODWLDMANclass; -} - - -NPObject * ODWLDMAN_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - NPObject* newdwldman = NULL; - if (!v_bODWLDMANIdentifiersInitialized) - { - v_bODWLDMANIdentifiersInitialized = true; - ODWLDMANinitializeIdentifiers(); - } - - newdwldman = (NPObject*)MEMALLOC(sizeof(NPObject)); - - return newdwldman; -} - - void ODWLDMAN_Deallocate(NPObject* obj) -{ - TRACEINFO; - MEMFREE(obj); - return; -} - - void ODWLDMAN_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - - bool ODWLDMAN_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kODWLDMAN_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_ODWLDMANMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool ODWLDMAN_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - if (name == v_ODWLDMANMethodIdentifiers[kODWLDMAN_ID_METHOD_GETDOWNLOADS]) - { - ODWLDMAN_Invoke_GetDownloads(obj, args, argCount); - fctresult = true; - } - else if (name == v_ODWLDMANMethodIdentifiers[kODWLDMAN_ID_METHOD_PAUSE]) - { - ODWLDMAN_Invoke_Pause(obj, args, argCount); - fctresult = true; - } - else if (name == v_ODWLDMANMethodIdentifiers[kODWLDMAN_ID_METHOD_REMOVE]) - { - ODWLDMAN_Invoke_Remove(obj, args, argCount); - fctresult = true; - } - else if (name == v_ODWLDMANMethodIdentifiers[kODWLDMAN_ID_METHOD_RESUME]) - { - ODWLDMAN_Invoke_Resume(obj, args, argCount); - fctresult = true; - } - else - { - fctresult = false; - } - return fctresult; -} - - bool ODWLDMAN_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - - bool ODWLDMAN_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kODWLDMAN_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_ODWLDMANPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - - bool ODWLDMAN_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - - bool ODWLDMAN_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - - bool ODWLDMAN_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - - bool ODWLDMAN_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - -/** implementation */ - - -void ODWLDMAN_Invoke_GetDownloads(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} - -void ODWLDMAN_Invoke_Pause(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} - -void ODWLDMAN_Invoke_Remove(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} - -void ODWLDMAN_Invoke_Resume(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadmanager.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadmanager.h deleted file mode 100644 index e9c3226..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadmanager.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __OIPFDOWNLOADMANAGER_H__ -#define __OIPFDOWNLOADMANAGER_H__ - -#include "hbbtvbrowserplugin.h" - - -NPClass* fillODWLDMANpclass(void); - -NPObject * ODWLDMAN_Allocate(NPP npp, NPClass *aClass); -void ODWLDMAN_Deallocate(NPObject *obj); -void ODWLDMAN_Invalidate(NPObject *obj); -bool ODWLDMAN_HasMethod(NPObject *obj, NPIdentifier name); -bool ODWLDMAN_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool ODWLDMAN_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool ODWLDMAN_HasProperty(NPObject *obj, NPIdentifier name); -bool ODWLDMAN_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool ODWLDMAN_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool ODWLDMAN_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool ODWLDMAN_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - - -void ODWLDMAN_Invoke_GetDownloads(NPObject* obj,const NPVariant* args, uint32_t argCount); -void ODWLDMAN_Invoke_Pause(NPObject* obj,const NPVariant* args, uint32_t argCount); -void ODWLDMAN_Invoke_Remove(NPObject* obj,const NPVariant* args, uint32_t argCount); -void ODWLDMAN_Invoke_Resume(NPObject* obj,const NPVariant* args, uint32_t argCount); - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadtrigger.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadtrigger.c deleted file mode 100644 index ae17f4b..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadtrigger.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - * - */ -#include "oipfdownloadtrigger.h" - - -#define kODWLDTRG_NUM_PROPERTY_IDENTIFIERS 0 - -#define kODWLDTRG_ID_METHOD_REGISTER_DOWNLOAD 0 -#define kODWLDTRG_ID_METHOD_REGISTER_DOWNLOADURL 1 -#define kODWLDTRG_NUM_METHOD_IDENTIFIERS 2 - -bool v_bODWLDTRGIdentifiersInitialized = false; - -NPIdentifier v_ODWLDTRGPropertyIdentifiers[kODWLDTRG_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_ODWLDTRGPropertyNames[kODWLDTRG_NUM_PROPERTY_IDENTIFIERS] = { -}; - -NPIdentifier v_ODWLDTRGMethodIdentifiers[kODWLDTRG_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_ODWLDTRGMethodNames[kODWLDTRG_NUM_METHOD_IDENTIFIERS] = { - "registerDownload", - "registerDownloadURL" -}; - - - -static void ODWLDTRGinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_ODWLDTRGPropertyNames, kODWLDTRG_NUM_PROPERTY_IDENTIFIERS, v_ODWLDTRGPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_ODWLDTRGMethodNames, kODWLDTRG_NUM_METHOD_IDENTIFIERS, v_ODWLDTRGMethodIdentifiers ); -} - -NPClass stODWLDTRGclass; -NPClass* pODWLDTRGclass = NULL; - -NPClass* fillODWLDTRGpclass(void) -{ - TRACEINFO; - if (pODWLDTRGclass == NULL) - { - stODWLDTRGclass.allocate = ODWLDTRG_Allocate; - stODWLDTRGclass.deallocate = ODWLDTRG_Deallocate; - stODWLDTRGclass.invalidate = ODWLDTRG_Invalidate; - stODWLDTRGclass.hasMethod = ODWLDTRG_HasMethod; - stODWLDTRGclass.invoke = ODWLDTRG_Invoke; - stODWLDTRGclass.invokeDefault = ODWLDTRG_InvokeDefault; - stODWLDTRGclass.hasProperty = ODWLDTRG_HasProperty; - stODWLDTRGclass.getProperty = ODWLDTRG_GetProperty; - stODWLDTRGclass.setProperty = ODWLDTRG_SetProperty; - stODWLDTRGclass.removeProperty = ODWLDTRG_RemoveProperty; - stODWLDTRGclass.enumerate = ODWLDTRG_Enumerate; - pODWLDTRGclass = &stODWLDTRGclass; - } - - return pODWLDTRGclass; -} - - -NPObject * ODWLDTRG_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - NPObject* newdwldtrg = NULL; - if (!v_bODWLDTRGIdentifiersInitialized) - { - v_bODWLDTRGIdentifiersInitialized = true; - ODWLDTRGinitializeIdentifiers(); - } - - newdwldtrg = (NPObject*)MEMALLOC(sizeof(NPObject)); - - return newdwldtrg; -} - - void ODWLDTRG_Deallocate(NPObject* obj) -{ - TRACEINFO; - MEMFREE(obj); - return; -} - - void ODWLDTRG_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - - bool ODWLDTRG_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kODWLDTRG_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_ODWLDTRGMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool ODWLDTRG_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - if (name == v_ODWLDTRGMethodIdentifiers[kODWLDTRG_ID_METHOD_REGISTER_DOWNLOAD]) - { - ODWLDTRG_Invoke_registerDownload(obj, args, argCount); - fctresult = true; - } - else if (name == v_ODWLDTRGMethodIdentifiers[kODWLDTRG_ID_METHOD_REGISTER_DOWNLOADURL]) - { - ODWLDTRG_Invoke_registerDownloadURL(obj, args, argCount); - fctresult = true; - } - else - { - fctresult = false; - } - return fctresult; -} - - bool ODWLDTRG_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - - bool ODWLDTRG_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - - int i = 0; - while ((i < kODWLDTRG_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_ODWLDTRGPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - - bool ODWLDTRG_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - return true; -} - - bool ODWLDTRG_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - return true; -} - - bool ODWLDTRG_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - - bool ODWLDTRG_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - -void ODWLDTRG_Invoke_registerDownload(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} - -void ODWLDTRG_Invoke_registerDownloadURL(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; -} diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadtrigger.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadtrigger.h deleted file mode 100644 index cd7c337..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/oipfdownloadtrigger.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - * - */ -#ifndef __OIPFDOWNLOADTRIGGER_H__ -#define __OIPFDOWNLOADTRIGGER_H__ - -#include "hbbtvbrowserplugin.h" - - - -NPClass* fillODWLDTRGpclass(void); - -NPObject * ODWLDTRG_Allocate(NPP npp, NPClass *aClass); -void ODWLDTRG_Deallocate(NPObject *obj); -void ODWLDTRG_Invalidate(NPObject *obj); -bool ODWLDTRG_HasMethod(NPObject *obj, NPIdentifier name); -bool ODWLDTRG_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool ODWLDTRG_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool ODWLDTRG_HasProperty(NPObject *obj, NPIdentifier name); -bool ODWLDTRG_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool ODWLDTRG_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); - -bool ODWLDTRG_RemoveProperty(NPObject *npobj, NPIdentifier name); - -bool ODWLDTRG_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - -void ODWLDTRG_Invoke_registerDownload(NPObject* obj,const NPVariant* args, uint32_t argCount); -void ODWLDTRG_Invoke_registerDownloadURL(NPObject* obj,const NPVariant* args, uint32_t argCount); -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/videobroadcast.c b/applications/hbbtvplayer/hbbtvbrowserplugin/src/videobroadcast.c deleted file mode 100644 index bfcfed7..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/videobroadcast.c +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#include "videobroadcast.h" - -#define kVIDBRC_ID_PROPERTY_WIDTH 0 -#define kVIDBRC_ID_PROPERTY_HEIGHT 1 -#define kVIDBRC_ID_PROPERTY_FULLSCREEN 2 -#define kVIDBRC_ID_PROPERTY_ONCHANNELCHANGEERROR 3 -#define kVIDBRC_ID_PROPERTY_PLAYSTATE 4 -#define kVIDBRC_ID_PROPERTY_ONPLAYSTATECHANGE 5 -#define kVIDBRC_ID_PROPERTY_ONCHANNELCHANGESUCCEEDED 6 -#define kVIDBRC_ID_PROPERTY_ONFULLSCREENCHANGE 7 -#define kVIDBRC_ID_PROPERTY_ONFOCUS 8 -#define kVIDBRC_ID_PROPERTY_ONBLUR 9 -#define kVIDBRC_NUM_PROPERTY_IDENTIFIERS 10 - -#define kVIDBRC_ID_METHOD_GETCHANNELCONFIG 0 -#define kVIDBRC_ID_METHOD_BINDTOCURRENTCHANNEL 1 -#define kVIDBRC_ID_METHOD_CREATECHANNELOBJECT 2 -#define kVIDBRC_ID_METHOD_CREATECHANNELOBJECT2 3 -#define kVIDBRC_ID_METHOD_SETCHANNEL 4 -#define kVIDBRC_ID_METHOD_PREVCHANNEL 5 -#define kVIDBRC_ID_METHOD_NEXTCHANNEL 6 -#define kVIDBRC_ID_METHOD_SETFULLSCREEN 7 -#define kVIDBRC_ID_METHOD_GETVOLUME 8 -#define kVIDBRC_ID_METHOD_RELEASE 9 -#define kVIDBRC_NUM_METHOD_IDENTIFIERS 10 - - -bool v_bVIDBRCIdentifiersInitialized = false; - -NPIdentifier v_VIDBRCPropertyIdentifiers[kVIDBRC_NUM_PROPERTY_IDENTIFIERS]; -const NPUTF8 * v_VIDBRCPropertyNames[kVIDBRC_NUM_PROPERTY_IDENTIFIERS] = { - "width", - "height", - "fullScreen", - "onChannelChangeError", - "playState", - "onPlayStateChange", - "onChannelChangeSucceeded", - "onFullScreenChange", - "onFocus", - "onBlur" - }; - -NPIdentifier v_VIDBRCMethodIdentifiers[kVIDBRC_NUM_METHOD_IDENTIFIERS]; -const NPUTF8 * v_VIDBRCMethodNames[kVIDBRC_NUM_METHOD_IDENTIFIERS] = { - "getChannelConfig", - "bindToCurrentChannel", - "createChannelObject", - "createChannelObject2", - "setChannel", - "prevChannel", - "nextChannel", - "setFullScreen", - "getVolume", - "release" -}; - -static void VIDBRCinitializeIdentifiers(void) -{ - sBrowserFuncs->getstringidentifiers( v_VIDBRCPropertyNames, kVIDBRC_NUM_PROPERTY_IDENTIFIERS, v_VIDBRCPropertyIdentifiers ); - sBrowserFuncs->getstringidentifiers( v_VIDBRCMethodNames, kVIDBRC_NUM_METHOD_IDENTIFIERS, v_VIDBRCMethodIdentifiers ); -} - -NPClass stVIDBRCclass; -NPClass* pVIDBRCclass = NULL; - -NPClass* fillVIDBRCpclass(void) -{ - TRACEINFO; - if (pVIDBRCclass == NULL) - { - stVIDBRCclass.allocate = VIDBRC_Allocate; - stVIDBRCclass.deallocate = VIDBRC_Deallocate; - stVIDBRCclass.invalidate = VIDBRC_Invalidate; - stVIDBRCclass.hasMethod = VIDBRC_HasMethod; - stVIDBRCclass.invoke = VIDBRC_Invoke; - stVIDBRCclass.invokeDefault = VIDBRC_InvokeDefault; - stVIDBRCclass.hasProperty = VIDBRC_HasProperty; - stVIDBRCclass.getProperty = VIDBRC_GetProperty; - stVIDBRCclass.setProperty = VIDBRC_SetProperty; - stVIDBRCclass.removeProperty = VIDBRC_RemoveProperty; - stVIDBRCclass.enumerate = VIDBRC_Enumerate; - pVIDBRCclass = &stVIDBRCclass; - } - - return pVIDBRCclass; -} - - -NPObject * VIDBRC_Allocate(NPP npp, NPClass *theClass) -{ - TRACEINFO; - - - if (!v_bVIDBRCIdentifiersInitialized) - { - v_bVIDBRCIdentifiersInitialized = true; - VIDBRCinitializeIdentifiers(); - } - - NPObj_VidBrc* newvidbrc = (NPObj_VidBrc*)MEMALLOC(sizeof(NPObj_VidBrc)); - newvidbrc->npp = npp; - - return (NPObject*) newvidbrc; -} - -void VIDBRC_Deallocate(NPObject* obj) -{ - TRACEINFO; - OnVIDBRC_SetFullScreen(true); - NPObj_VidBrc* vidbrc = (NPObj_VidBrc*)obj; - /* - if (vidbrc->pcArg_onChannelChangeSucceeded) - { - MEMFREE(vidbrc->pcArg_onChannelChangeSucceeded); - // vidbrc->pcArg_onChannelChangeSucceeded = NULL; - } - if ( vidbrc->onChannelChangeSucceeded ) - { - // sBrowserFuncs->releaseobject(vidbrc->onChannelChangeSucceeded); - // vidbrc->onChannelChangeSucceeded = NULL; - } - - */ - MEMFREE(obj); - return; -} - - void VIDBRC_Invalidate(NPObject* obj) -{ - TRACEINFO; - return; -} - - bool VIDBRC_HasMethod(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; - - bool result = false; - int i = 0; - NPUTF8* utf8methodname = (char*)sBrowserFuncs->utf8fromidentifier(name); - while ((i < kVIDBRC_NUM_METHOD_IDENTIFIERS) && (result == false)) - { - if ( name == v_VIDBRCMethodIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - -bool VIDBRC_Invoke(NPObject* obj, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - - if (name == v_VIDBRCMethodIdentifiers[kVIDBRC_ID_METHOD_GETCHANNELCONFIG]) - { - VIDBRC_Invoke_getChannelConfig((NPObj_VidBrc*)obj, args, argCount, result); - fctresult = true; - } - - if (name == v_VIDBRCMethodIdentifiers[kVIDBRC_ID_METHOD_SETFULLSCREEN]) - { - VIDBRC_Invoke_setFullScreen((NPObj_VidBrc*)obj, args, argCount); - fctresult = true; - } - - if (name == v_VIDBRCMethodIdentifiers[kVIDBRC_ID_METHOD_BINDTOCURRENTCHANNEL]) - { - VIDBRC_Invoke_bindToCurrentChannel(obj, args, argCount); - fctresult = true; - } - - - return fctresult; -} - - bool VIDBRC_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) -{ - TRACEINFO; - return true; -} - - bool VIDBRC_HasProperty(NPObject* obj, NPIdentifier name) -{ - TRACEINFO; bool result = false; - NPUTF8* utf8propertyname = (char*)sBrowserFuncs->utf8fromidentifier(name); - int i = 0; - while ((i < kVIDBRC_NUM_PROPERTY_IDENTIFIERS) && (result == false)) - { - if ( name == v_VIDBRCPropertyIdentifiers[i] ) - { - result= true; - } - i++; - } - - return result; -} - - bool VIDBRC_GetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) -{ - TRACEINFO; - bool fctresult = false; - NPObj_VidBrc* vidbrc = (NPObj_VidBrc*)obj; - - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_WIDTH]) { - INT32_TO_NPVARIANT(vidbrc->width,*result); - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_HEIGHT]) { - INT32_TO_NPVARIANT(vidbrc->height,*result); - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_FULLSCREEN]) { - BOOLEAN_TO_NPVARIANT(vidbrc->fullscreen, *result); - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_PLAYSTATE]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONPLAYSTATECHANGE]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONCHANNELCHANGEERROR]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONCHANNELCHANGESUCCEEDED]) { - /* if ( vidbrc->pcArg_onChannelChangeSucceeded != NULL ) - { - char* dup_str = strdup(vidbrc->pcArg_onChannelChangeSucceeded); - NPString npstr = { dup_str, (uint32_t)(strlen(dup_str)) }; - result->type = NPVariantType_String; - result->value.stringValue = npstr; - fctresult = true; - } - else - { - OBJECT_TO_NPVARIANT(vidbrc->onPlayStateChange,*result); - }*/ - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONFULLSCREENCHANGE]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONFOCUS]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONBLUR]) { - fctresult = true; - } - - return fctresult; -} - - bool VIDBRC_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value) -{ - TRACEINFO; - bool fctresult = false; - NPObj_VidBrc* vidbrc = (NPObj_VidBrc*)obj; - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_WIDTH]) { - vidbrc->width = NPVARIANT_TO_INT32(*value); - VIDBRC_setsize(vidbrc, vidbrc->width, vidbrc->height); - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_HEIGHT]) { - vidbrc->height = NPVARIANT_TO_INT32(*value); - VIDBRC_setsize(vidbrc, vidbrc->width, vidbrc->height); - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_FULLSCREEN]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_PLAYSTATE]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONPLAYSTATECHANGE]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONCHANNELCHANGEERROR]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONCHANNELCHANGESUCCEEDED]) { - /* if ( vidbrc->onChannelChangeSucceeded != NULL ) - { - sBrowserFuncs->releaseobject(vidbrc->onChannelChangeSucceeded); - vidbrc->onChannelChangeSucceeded = NULL; - } - if ( vidbrc->pcArg_onChannelChangeSucceeded ) - { - MEMFREE( vidbrc->pcArg_onChannelChangeSucceeded ); - vidbrc->pcArg_onChannelChangeSucceeded = NULL; - } - vidbrc->onChannelChangeSucceeded = NPVARIANT_TO_OBJECT(*value); - sBrowserFuncs->retainobject( vidbrc->onChannelChangeSucceeded);*/ - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONFULLSCREENCHANGE]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONFOCUS]) { - fctresult = true; - } else - if (name == v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_ONBLUR]) { - fctresult = true; - } - return fctresult; -} - - bool VIDBRC_RemoveProperty(NPObject *npobj, NPIdentifier name) -{ - TRACEINFO; - return true; -} - - - bool VIDBRC_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) -{ - TRACEINFO; - return true; -} - -/** implementation of methods **/ -void VIDBRC_Invoke_getChannelConfig(NPObj_VidBrc* obj,const NPVariant* args, uint32_t argCount, NPVariant* result) -{ - NOTIMPLEMENTED; - NULL_TO_NPVARIANT(*result); - return; -} - -void VIDBRC_Invoke_setFullScreen(NPObj_VidBrc* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - //NOTIMPLEMENTED; ///inprogress - - NPP npp = obj->npp; - int param; - if (argCount != 1 || !NPVARIANT_IS_BOOLEAN(args[0])) { - return; - } - else { - param = NPVARIANT_TO_BOOLEAN( args[0] ); - if (param != obj->fullscreen) - { - if (param){ - obj->fullscreen = true; - VIDBRC_setsize(obj, FULLSIZE_WIDTH, FULLSIZE_HEIGHT); - } - else{ - obj->fullscreen = false; - } - - HBBTVPluginData* pdata = (HBBTVPluginData*)npp->pdata; - if(pdata){ - if (pdata->window){ - OnVIDBRC_SetFullScreen(param); - } - } - } -} - -} - -void VIDBRC_Invoke_bindToCurrentChannel(NPObject* obj,const NPVariant* args, uint32_t argCount) -{ - TRACEINFO; - NOTIMPLEMENTED; - //OnBindToCurrentChannel(); -} - -/** implementation of intermediary function **/ - -void VIDBRC_setsize(NPObj_VidBrc* obj,int32_t width, int32_t height) -{ - ///set the size - obj->width = width; - obj->height = height; - - /// get the plugin object and his style object - NPIdentifier npIdent; - NPVariant npVar; - NPObject * npObjPlugin = NULL; - NPObject * npObjStyle = NULL; - - if (obj->npp) - { - sBrowserFuncs->getvalue( obj->npp , - NPNVPluginElementNPObject , - &npObjPlugin ); - } - if (npObjPlugin) - { - npIdent = sBrowserFuncs->getstringidentifier( (const NPUTF8 *)"style" ); - sBrowserFuncs->getproperty( obj->npp , - npObjPlugin, - npIdent , - &npVar ); - npObjStyle = NPVARIANT_TO_OBJECT(npVar); - } - if (npObjStyle) - { - INT32_TO_NPVARIANT(width,npVar); - npIdent = v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_WIDTH]; - sBrowserFuncs->setproperty( obj->npp,npObjStyle, npIdent, &npVar); - INT32_TO_NPVARIANT(height,npVar); - npIdent = v_VIDBRCPropertyIdentifiers[kVIDBRC_ID_PROPERTY_HEIGHT]; - sBrowserFuncs->setproperty( obj->npp,npObjStyle, npIdent, &npVar); - } -} - diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/videobroadcast.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/videobroadcast.h deleted file mode 100644 index 0027b76..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/videobroadcast.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * Authors: Stanislas Selle - * - */ -#ifndef __VIDEOBROADCAST_H__ -#define __VIDEOBROADCAST_H__ - -#include -#include -#include -#include -#include -#include -#include - -#include "hbbtvbrowserplugin.h" - -#define FULLSIZE_WIDTH 1280 -#define FULLSIZE_HEIGHT 720 - -typedef struct -{ - NPObject header; - NPP npp; - NPBool fullscreen; - int32_t width; - int32_t height; - - - //~ char* pcArg_onChannelChangeSucceeded; - //~ NPObject* onChannelChangeSucceeded; - //NPObject* channelConfig; - -} NPObj_VidBrc; - -NPClass* fillVIDBRCpclass(void); - -NPObject * VIDBRC_Allocate(NPP npp, NPClass *aClass); -void VIDBRC_Deallocate(NPObject *obj); -void VIDBRC_Invalidate(NPObject *obj); -bool VIDBRC_HasMethod(NPObject *obj, NPIdentifier name); -bool VIDBRC_Invoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool VIDBRC_InvokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); -bool VIDBRC_HasProperty(NPObject *obj, NPIdentifier name); -bool VIDBRC_GetProperty(NPObject *obj, NPIdentifier name, NPVariant *result); -bool VIDBRC_SetProperty(NPObject *obj, NPIdentifier name, const NPVariant *value); -bool VIDBRC_RemoveProperty(NPObject *npobj, NPIdentifier name); -bool VIDBRC_Enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); - -void VIDBRC_Invoke_setFullScreen(NPObj_VidBrc* obj,const NPVariant* args, uint32_t argCount); -void VIDBRC_Invoke_bindToCurrentChannel(NPObject* obj,const NPVariant* args, uint32_t argCount); -void VIDBRC_Invoke_getChannelConfig(NPObj_VidBrc* obj,const NPVariant* args, uint32_t argCount, NPVariant* result); - -void VIDBRC_setsize(NPObj_VidBrc* obj,int32_t witdh, int32_t height); -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npapi.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npapi.h deleted file mode 100644 index c217718..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npapi.h +++ /dev/null @@ -1,901 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef npapi_h_ -#define npapi_h_ - -#if defined(__OS2__) -#pragma pack(1) -#endif - -#include "nptypes.h" - -#if defined(__OS2__) || defined(OS2) -#ifndef XP_OS2 -#define XP_OS2 1 -#endif -#endif - -#ifdef INCLUDE_JAVA -#include "jri.h" /* Java Runtime Interface */ -#else -#define jref void * -#define JRIEnv void -#endif - -#if defined(_WIN32) && !defined(__SYMBIAN32__) -#include -#ifndef XP_WIN -#define XP_WIN 1 -#endif -#endif - -#if defined(__SYMBIAN32__) -#ifndef XP_SYMBIAN -#define XP_SYMBIAN 1 -#endif -#endif - -#if defined(__APPLE_CC__) && !defined(XP_UNIX) -#ifndef XP_MACOSX -#define XP_MACOSX 1 -#endif -#endif - -#if defined(XP_MACOSX) && defined(__LP64__) -#define NP_NO_QUICKDRAW -#define NP_NO_CARBON -#endif - -#if defined(XP_MACOSX) -#include -#include -#ifndef NP_NO_CARBON -#include -#endif -#endif - -#if defined(XP_UNIX) -#include -#include -#include -#endif - -#if defined(XP_SYMBIAN) -#include -#include -#endif - -/*----------------------------------------------------------------------*/ -/* Plugin Version Constants */ -/*----------------------------------------------------------------------*/ - -#define NP_VERSION_MAJOR 0 -#define NP_VERSION_MINOR 24 - - -/* The OS/2 version of Netscape uses RC_DATA to define the - mime types, file extensions, etc that are required. - Use a vertical bar to separate types, end types with \0. - FileVersion and ProductVersion are 32bit ints, all other - entries are strings that MUST be terminated with a \0. - -AN EXAMPLE: - -RCDATA NP_INFO_ProductVersion { 1,0,0,1,} - -RCDATA NP_INFO_MIMEType { "video/x-video|", - "video/x-flick\0" } -RCDATA NP_INFO_FileExtents { "avi|", - "flc\0" } -RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|", - "MMOS2 Flc/Fli player(*.flc)\0" } - -RCDATA NP_INFO_FileVersion { 1,0,0,1 } -RCDATA NP_INFO_CompanyName { "Netscape Communications\0" } -RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0" -RCDATA NP_INFO_InternalName { "NPAVI32\0" ) -RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0" -RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" } -RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" } -*/ -/* RC_DATA types for version info - required */ -#define NP_INFO_ProductVersion 1 -#define NP_INFO_MIMEType 2 -#define NP_INFO_FileOpenName 3 -#define NP_INFO_FileExtents 4 -/* RC_DATA types for version info - used if found */ -#define NP_INFO_FileDescription 5 -#define NP_INFO_ProductName 6 -/* RC_DATA types for version info - optional */ -#define NP_INFO_CompanyName 7 -#define NP_INFO_FileVersion 8 -#define NP_INFO_InternalName 9 -#define NP_INFO_LegalCopyright 10 -#define NP_INFO_OriginalFilename 11 - -#ifndef RC_INVOKED - -/*----------------------------------------------------------------------*/ -/* Definition of Basic Types */ -/*----------------------------------------------------------------------*/ - -#ifndef FALSE -#define FALSE (0) -#endif -#ifndef TRUE -#define TRUE (1) -#endif -#ifndef NULL -#define NULL (0L) -#endif - -typedef unsigned char NPBool; -typedef int16_t NPError; -typedef int16_t NPReason; -typedef char* NPMIMEType; - -/*----------------------------------------------------------------------*/ -/* Structures and definitions */ -/*----------------------------------------------------------------------*/ - -#if !defined(__LP64__) -#if defined(XP_MACOSX) -#pragma options align=mac68k -#endif -#endif /* __LP64__ */ - -/* - * NPP is a plug-in's opaque instance handle - */ -typedef struct _NPP -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ -} NPP_t; - -typedef NPP_t* NPP; - -typedef struct _NPStream -{ - void* pdata; /* plug-in private data */ - void* ndata; /* netscape private data */ - const char* url; - uint32_t end; - uint32_t lastmodified; - void* notifyData; - const char* headers; /* Response headers from host. - * Exists only for >= NPVERS_HAS_RESPONSE_HEADERS. - * Used for HTTP only; NULL for non-HTTP. - * Available from NPP_NewStream onwards. - * Plugin should copy this data before storing it. - * Includes HTTP status line and all headers, - * preferably verbatim as received from server, - * headers formatted as in HTTP ("Header: Value"), - * and newlines (\n, NOT \r\n) separating lines. - * Terminated by \n\0 (NOT \n\n\0). */ -} NPStream; - -typedef struct _NPByteRange -{ - int32_t offset; /* negative offset means from the end */ - uint32_t length; - struct _NPByteRange* next; -} NPByteRange; - -typedef struct _NPSavedData -{ - int32_t len; - void* buf; -} NPSavedData; - -typedef struct _NPRect -{ - uint16_t top; - uint16_t left; - uint16_t bottom; - uint16_t right; -} NPRect; - -typedef struct _NPSize -{ - int32_t width; - int32_t height; -} NPSize; - -typedef enum { - NPFocusNext = 0, - NPFocusPrevious = 1 -} NPFocusDirection; - -/* Return values for NPP_HandleEvent */ -#define kNPEventNotHandled 0 -#define kNPEventHandled 1 -/* Exact meaning must be spec'd in event model. */ -#define kNPEventStartIME 2 - -#if defined(XP_UNIX) -/* - * Unix specific structures and definitions - */ - -/* - * Callback Structures. - * - * These are used to pass additional platform specific information. - */ -enum { - NP_SETWINDOW = 1, - NP_PRINT -}; - -typedef struct -{ - int32_t type; -} NPAnyCallbackStruct; - -typedef struct -{ - int32_t type; - Display* display; - Visual* visual; - Colormap colormap; - unsigned int depth; -} NPSetWindowCallbackStruct; - -typedef struct -{ - int32_t type; - FILE* fp; -} NPPrintCallbackStruct; - -#endif /* XP_UNIX */ - -#if defined(XP_MACOSX) -typedef enum { -#ifndef NP_NO_QUICKDRAW - NPDrawingModelQuickDraw = 0, -#endif - NPDrawingModelCoreGraphics = 1, - NPDrawingModelOpenGL = 2, - NPDrawingModelCoreAnimation = 3 -} NPDrawingModel; - -typedef enum { -#ifndef NP_NO_CARBON - NPEventModelCarbon = 0, -#endif - NPEventModelCocoa = 1 -} NPEventModel; -#endif - -/* - * The following masks are applied on certain platforms to NPNV and - * NPPV selectors that pass around pointers to COM interfaces. Newer - * compilers on some platforms may generate vtables that are not - * compatible with older compilers. To prevent older plugins from - * not understanding a new browser's ABI, these masks change the - * values of those selectors on those platforms. To remain backwards - * compatible with different versions of the browser, plugins can - * use these masks to dynamically determine and use the correct C++ - * ABI that the browser is expecting. This does not apply to Windows - * as Microsoft's COM ABI will likely not change. - */ - -#define NP_ABI_GCC3_MASK 0x10000000 -/* - * gcc 3.x generated vtables on UNIX and OSX are incompatible with - * previous compilers. - */ -#if (defined(XP_UNIX) && defined(__GNUC__) && (__GNUC__ >= 3)) -#define _NP_ABI_MIXIN_FOR_GCC3 NP_ABI_GCC3_MASK -#else -#define _NP_ABI_MIXIN_FOR_GCC3 0 -#endif - -#if defined(XP_MACOSX) -#define NP_ABI_MACHO_MASK 0x01000000 -#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK -#else -#define _NP_ABI_MIXIN_FOR_MACHO 0 -#endif - -#define NP_ABI_MASK (_NP_ABI_MIXIN_FOR_GCC3 | _NP_ABI_MIXIN_FOR_MACHO) - -/* - * List of variable names for which NPP_GetValue shall be implemented - */ -typedef enum { - NPPVpluginNameString = 1, - NPPVpluginDescriptionString, - NPPVpluginWindowBool, - NPPVpluginTransparentBool, - NPPVjavaClass, /* Not implemented in WebKit */ - NPPVpluginWindowSize, /* Not implemented in WebKit */ - NPPVpluginTimerInterval, /* Not implemented in WebKit */ - NPPVpluginScriptableInstance = (10 | NP_ABI_MASK), /* Not implemented in WebKit */ - NPPVpluginScriptableIID = 11, /* Not implemented in WebKit */ - NPPVjavascriptPushCallerBool = 12, /* Not implemented in WebKit */ - NPPVpluginKeepLibraryInMemory = 13, /* Not implemented in WebKit */ - NPPVpluginNeedsXEmbed = 14, /* Not implemented in WebKit */ - - /* Get the NPObject for scripting the plugin. Introduced in NPAPI minor version 14. - */ - NPPVpluginScriptableNPObject = 15, - - /* Get the plugin value (as \0-terminated UTF-8 string data) for - * form submission if the plugin is part of a form. Use - * NPN_MemAlloc() to allocate memory for the string data. Introduced - * in NPAPI minor version 15. - */ - NPPVformValue = 16, /* Not implemented in WebKit */ - - NPPVpluginUrlRequestsDisplayedBool = 17, /* Not implemented in WebKit */ - - /* Checks if the plugin is interested in receiving the http body of - * all http requests (including failed ones, http status != 200). - */ - NPPVpluginWantsAllNetworkStreams = 18, - - /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */ - NPPVpluginNativeAccessibleAtkPlugId = 19, - - /* Checks to see if the plug-in would like the browser to load the "src" attribute. */ - NPPVpluginCancelSrcStream = 20 - -#if defined(XP_MACOSX) - /* Used for negotiating drawing models */ - , NPPVpluginDrawingModel = 1000 - /* Used for negotiating event models */ - , NPPVpluginEventModel = 1001 - /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */ - , NPPVpluginCoreAnimationLayer = 1003 -#endif - -#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5) - , NPPVpluginWindowlessLocalBool = 2002 -#endif -} NPPVariable; - -/* - * List of variable names for which NPN_GetValue should be implemented. - */ -typedef enum { - NPNVxDisplay = 1, - NPNVxtAppContext, - NPNVnetscapeWindow, - NPNVjavascriptEnabledBool, - NPNVasdEnabledBool, - NPNVisOfflineBool, - - NPNVserviceManager = (10 | NP_ABI_MASK), /* Not implemented in WebKit */ - NPNVDOMElement = (11 | NP_ABI_MASK), /* Not implemented in WebKit */ - NPNVDOMWindow = (12 | NP_ABI_MASK), /* Not implemented in WebKit */ - NPNVToolkit = (13 | NP_ABI_MASK), /* Not implemented in WebKit */ - NPNVSupportsXEmbedBool = 14, /* Not implemented in WebKit */ - - /* Get the NPObject wrapper for the browser window. */ - NPNVWindowNPObject = 15, - - /* Get the NPObject wrapper for the plugins DOM element. */ - NPNVPluginElementNPObject = 16, - - NPNVSupportsWindowless = 17, - - NPNVprivateModeBool = 18 - -#if defined(XP_MACOSX) - /* Used for negotiating drawing models */ - , NPNVpluginDrawingModel = 1000 -#ifndef NP_NO_QUICKDRAW - , NPNVsupportsQuickDrawBool = 2000 -#endif - , NPNVsupportsCoreGraphicsBool = 2001 - , NPNVsupportsOpenGLBool = 2002 - , NPNVsupportsCoreAnimationBool = 2003 -#ifndef NP_NO_CARBON - , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */ -#endif - , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */ -#endif /* XP_MACOSX */ -#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5) - , NPNVSupportsWindowlessLocal = 2002 -#endif -} NPNVariable; - -typedef enum { - NPNURLVCookie = 501, - NPNURLVProxy -} NPNURLVariable; - -/* - * The type of Toolkit the widgets use - */ -typedef enum { - NPNVGtk12 = 1, - NPNVGtk2 -} NPNToolkitType; - -/* - * The type of a NPWindow - it specifies the type of the data structure - * returned in the window field. - */ -typedef enum { - NPWindowTypeWindow = 1, - NPWindowTypeDrawable -} NPWindowType; - -typedef struct _NPWindow -{ - void* window; /* Platform specific window handle */ - /* OS/2: x - Position of bottom left corner */ - /* OS/2: y - relative to visible netscape window */ - int32_t x; /* Position of top left corner relative */ - int32_t y; /* to a netscape page. */ - uint32_t width; /* Maximum window size */ - uint32_t height; - NPRect clipRect; /* Clipping rectangle in port coordinates */ -#if defined(XP_UNIX) || defined(XP_SYMBIAN) - void * ws_info; /* Platform-dependent additonal data */ -#endif /* XP_UNIX || XP_SYMBIAN */ - NPWindowType type; /* Is this a window or a drawable? */ -} NPWindow; - -typedef struct _NPImageExpose -{ - char* data; /* image pointer */ - int32_t stride; /* Stride of data image pointer */ - int32_t depth; /* Depth of image pointer */ - int32_t x; /* Expose x */ - int32_t y; /* Expose y */ - uint32_t width; /* Expose width */ - uint32_t height; /* Expose height */ - NPSize dataSize; /* Data buffer size */ - float translateX; /* translate X matrix value */ - float translateY; /* translate Y matrix value */ - float scaleX; /* scale X matrix value */ - float scaleY; /* scale Y matrix value */ -} NPImageExpose; - -typedef struct _NPFullPrint -{ - NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */ - NPBool printOne; /* TRUE if plugin should print one copy to default - printer */ - void* platformPrint; /* Platform-specific printing info */ -} NPFullPrint; - -typedef struct _NPEmbedPrint -{ - NPWindow window; - void* platformPrint; /* Platform-specific printing info */ -} NPEmbedPrint; - -typedef struct _NPPrint -{ - uint16_t mode; /* NP_FULL or NP_EMBED */ - union - { - NPFullPrint fullPrint; /* if mode is NP_FULL */ - NPEmbedPrint embedPrint; /* if mode is NP_EMBED */ - } print; -} NPPrint; - -#if defined(XP_MACOSX) -#ifndef NP_NO_CARBON -typedef EventRecord NPEvent; -#else -typedef void* NPEvent; -#endif -#elif defined(XP_SYMBIAN) -typedef QEvent NPEvent; -#elif defined(XP_WIN) -typedef struct _NPEvent -{ - uint16_t event; - uintptr_t wParam; - uintptr_t lParam; -} NPEvent; -#elif defined(XP_OS2) -typedef struct _NPEvent -{ - uint32_t event; - uint32_t wParam; - uint32_t lParam; -} NPEvent; -#elif defined(XP_UNIX) -typedef XEvent NPEvent; -#else -typedef void* NPEvent; -#endif - -#if defined(XP_MACOSX) -typedef void* NPRegion; -#ifndef NP_NO_QUICKDRAW -typedef RgnHandle NPQDRegion; -#endif -typedef CGPathRef NPCGRegion; -#elif defined(XP_WIN) -typedef HRGN NPRegion; -#elif defined(XP_UNIX) -typedef Region NPRegion; -#elif defined(XP_SYMBIAN) -typedef QRegion* NPRegion; -#else -typedef void *NPRegion; -#endif - -typedef struct _NPNSString NPNSString; -typedef struct _NPNSWindow NPNSWindow; -typedef struct _NPNSMenu NPNSMenu; - -#if defined(XP_MACOSX) -typedef NPNSMenu NPMenu; -#else -typedef void *NPMenu; -#endif - -typedef enum { - NPCoordinateSpacePlugin = 1, - NPCoordinateSpaceWindow, - NPCoordinateSpaceFlippedWindow, - NPCoordinateSpaceScreen, - NPCoordinateSpaceFlippedScreen -} NPCoordinateSpace; - -#if defined(XP_MACOSX) - -#ifndef NP_NO_QUICKDRAW -typedef struct NP_Port -{ - CGrafPtr port; - int32_t portx; /* position inside the topmost window */ - int32_t porty; -} NP_Port; -#endif /* NP_NO_QUICKDRAW */ - -/* - * NP_CGContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreGraphics - * as its drawing model. - */ - -typedef struct NP_CGContext -{ - CGContextRef context; -#ifdef NP_NO_CARBON - NPNSWindow *window; -#else - void *window; /* A WindowRef or NULL for the Cocoa event model. */ -#endif -} NP_CGContext; - -/* - * NP_GLContext is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelOpenGL as its - * drawing model. - */ - -typedef struct NP_GLContext -{ - CGLContextObj context; -#ifdef NP_NO_CARBON - NPNSWindow *window; -#else - void *window; /* Can be either an NSWindow or a WindowRef depending on the event model */ -#endif -} NP_GLContext; - -typedef enum { - NPCocoaEventDrawRect = 1, - NPCocoaEventMouseDown, - NPCocoaEventMouseUp, - NPCocoaEventMouseMoved, - NPCocoaEventMouseEntered, - NPCocoaEventMouseExited, - NPCocoaEventMouseDragged, - NPCocoaEventKeyDown, - NPCocoaEventKeyUp, - NPCocoaEventFlagsChanged, - NPCocoaEventFocusChanged, - NPCocoaEventWindowFocusChanged, - NPCocoaEventScrollWheel, - NPCocoaEventTextInput -} NPCocoaEventType; - -typedef struct _NPCocoaEvent { - NPCocoaEventType type; - uint32_t version; - union { - struct { - uint32_t modifierFlags; - double pluginX; - double pluginY; - int32_t buttonNumber; - int32_t clickCount; - double deltaX; - double deltaY; - double deltaZ; - } mouse; - struct { - uint32_t modifierFlags; - NPNSString *characters; - NPNSString *charactersIgnoringModifiers; - NPBool isARepeat; - uint16_t keyCode; - } key; - struct { - CGContextRef context; - double x; - double y; - double width; - double height; - } draw; - struct { - NPBool hasFocus; - } focus; - struct { - NPNSString *text; - } text; - } data; -} NPCocoaEvent; - -#ifndef NP_NO_CARBON -/* Non-standard event types that can be passed to HandleEvent */ -enum NPEventType { - NPEventType_GetFocusEvent = (osEvt + 16), - NPEventType_LoseFocusEvent, - NPEventType_AdjustCursorEvent, - NPEventType_MenuCommandEvent, - NPEventType_ClippingChangedEvent, - NPEventType_ScrollingBeginsEvent = 1000, - NPEventType_ScrollingEndsEvent -}; -#endif /* NP_NO_CARBON */ - -#endif /* XP_MACOSX */ - -/* - * Values for mode passed to NPP_New: - */ -#define NP_EMBED 1 -#define NP_FULL 2 - -/* - * Values for stream type passed to NPP_NewStream: - */ -#define NP_NORMAL 1 -#define NP_SEEK 2 -#define NP_ASFILE 3 -#define NP_ASFILEONLY 4 - -#define NP_MAXREADY (((unsigned)(~0)<<1)>>1) - -/* - * Flags for NPP_ClearSiteData. - */ -#define NP_CLEAR_ALL 0 -#define NP_CLEAR_CACHE (1 << 0) - -#if !defined(__LP64__) -#if defined(XP_MACOSX) -#pragma options align=reset -#endif -#endif /* __LP64__ */ - -/*----------------------------------------------------------------------*/ -/* Error and Reason Code definitions */ -/*----------------------------------------------------------------------*/ - -/* - * Values of type NPError: - */ -#define NPERR_BASE 0 -#define NPERR_NO_ERROR (NPERR_BASE + 0) -#define NPERR_GENERIC_ERROR (NPERR_BASE + 1) -#define NPERR_INVALID_INSTANCE_ERROR (NPERR_BASE + 2) -#define NPERR_INVALID_FUNCTABLE_ERROR (NPERR_BASE + 3) -#define NPERR_MODULE_LOAD_FAILED_ERROR (NPERR_BASE + 4) -#define NPERR_OUT_OF_MEMORY_ERROR (NPERR_BASE + 5) -#define NPERR_INVALID_PLUGIN_ERROR (NPERR_BASE + 6) -#define NPERR_INVALID_PLUGIN_DIR_ERROR (NPERR_BASE + 7) -#define NPERR_INCOMPATIBLE_VERSION_ERROR (NPERR_BASE + 8) -#define NPERR_INVALID_PARAM (NPERR_BASE + 9) -#define NPERR_INVALID_URL (NPERR_BASE + 10) -#define NPERR_FILE_NOT_FOUND (NPERR_BASE + 11) -#define NPERR_NO_DATA (NPERR_BASE + 12) -#define NPERR_STREAM_NOT_SEEKABLE (NPERR_BASE + 13) - -/* - * Values of type NPReason: - */ -#define NPRES_BASE 0 -#define NPRES_DONE (NPRES_BASE + 0) -#define NPRES_NETWORK_ERR (NPRES_BASE + 1) -#define NPRES_USER_BREAK (NPRES_BASE + 2) - -/* - * Don't use these obsolete error codes any more. - */ -#define NP_NOERR NP_NOERR_is_obsolete_use_NPERR_NO_ERROR -#define NP_EINVAL NP_EINVAL_is_obsolete_use_NPERR_GENERIC_ERROR -#define NP_EABORT NP_EABORT_is_obsolete_use_NPRES_USER_BREAK - -/* - * Version feature information - */ -#define NPVERS_HAS_STREAMOUTPUT 8 -#define NPVERS_HAS_NOTIFICATION 9 -#define NPVERS_HAS_LIVECONNECT 9 -#define NPVERS_WIN16_HAS_LIVECONNECT 9 -#define NPVERS_68K_HAS_LIVECONNECT 11 -#define NPVERS_HAS_WINDOWLESS 11 -#define NPVERS_HAS_XPCONNECT_SCRIPTING 13 /* Not implemented in WebKit */ -#define NPVERS_HAS_NPRUNTIME_SCRIPTING 14 -#define NPVERS_HAS_FORM_VALUES 15 /* Not implemented in WebKit; see bug 13061 */ -#define NPVERS_HAS_POPUPS_ENABLED_STATE 16 /* Not implemented in WebKit */ -#define NPVERS_HAS_RESPONSE_HEADERS 17 -#define NPVERS_HAS_NPOBJECT_ENUM 18 -#define NPVERS_HAS_PLUGIN_THREAD_ASYNC_CALL 19 -#define NPVERS_HAS_ALL_NETWORK_STREAMS 20 -#define NPVERS_HAS_URL_AND_AUTH_INFO 21 -#define NPVERS_HAS_PRIVATE_MODE 22 -#define NPVERS_MACOSX_HAS_EVENT_MODELS 23 -#define NPVERS_HAS_CANCEL_SRC_STREAM 24 -#define NPVERS_HAS_ADVANCED_KEY_HANDLING 25 -#define NPVERS_HAS_URL_REDIRECT_HANDLING 26 -#define NPVERS_HAS_CLEAR_SITE_DATA 27 - -/*----------------------------------------------------------------------*/ -/* Function Prototypes */ -/*----------------------------------------------------------------------*/ - -#if defined(__OS2__) -#define NP_LOADDS _System -#else -#define NP_LOADDS -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* NPP_* functions are provided by the plugin and called by the navigator. */ - -#if defined(XP_UNIX) -char* NPP_GetMIMEDescription(void); -#endif - -NPError NP_LOADDS NPP_Initialize(void); -void NP_LOADDS NPP_Shutdown(void); -NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance, - uint16_t mode, int16_t argc, char* argn[], - char* argv[], NPSavedData* saved); -NPError NP_LOADDS NPP_Destroy(NPP instance, NPSavedData** save); -NPError NP_LOADDS NPP_SetWindow(NPP instance, NPWindow* window); -NPError NP_LOADDS NPP_NewStream(NPP instance, NPMIMEType type, - NPStream* stream, NPBool seekable, - uint16_t* stype); -NPError NP_LOADDS NPP_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -int32_t NP_LOADDS NPP_WriteReady(NPP instance, NPStream* stream); -int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset, - int32_t len, void* buffer); -void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream, - const char* fname); -void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint); -int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event); -void NP_LOADDS NPP_URLNotify(NPP instance, const char* url, - NPReason reason, void* notifyData); -jref NP_LOADDS NPP_GetJavaClass(void); -NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value); -NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value); -NPBool NP_LOADDS NPP_GotFocus(NPP instance, NPFocusDirection direction); -void NP_LOADDS NPP_LostFocus(NPP instance); -void NP_LOADDS NPP_URLRedirectNotify(NPP instance, const char* url, int32_t status, void* notifyData); -NPError NP_LOADDS NPP_ClearSiteData(const char* site, uint64_t flags, uint64_t maxAge); -char** NP_LOADDS NPP_GetSitesWithData(void); - -/* NPN_* functions are provided by the navigator and called by the plugin. */ -void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor, - int* netscape_major, int* netscape_minor); -NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url, - const char* target, void* notifyData); -NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url, - const char* target); -NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url, - const char* target, uint32_t len, - const char* buf, NPBool file, - void* notifyData); -NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url, - const char* target, uint32_t len, - const char* buf, NPBool file); -NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList); -NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type, - const char* target, NPStream** stream); -int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len, - void* buffer); -NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream, - NPReason reason); -void NP_LOADDS NPN_Status(NPP instance, const char* message); -const char* NP_LOADDS NPN_UserAgent(NPP instance); -void* NP_LOADDS NPN_MemAlloc(uint32_t size); -void NP_LOADDS NPN_MemFree(void* ptr); -uint32_t NP_LOADDS NPN_MemFlush(uint32_t size); -void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages); -JRIEnv* NP_LOADDS NPN_GetJavaEnv(void); -jref NP_LOADDS NPN_GetJavaPeer(NPP instance); -NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable, - void *value); -NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable, - void *value); -void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect); -void NP_LOADDS NPN_InvalidateRegion(NPP instance, - NPRegion invalidRegion); -void NP_LOADDS NPN_ForceRedraw(NPP instance); -void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled); -void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance); -void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance, - void (*func) (void *), - void *userData); -NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable, - const char *url, char **value, - uint32_t *len); -NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable, - const char *url, const char *value, - uint32_t len); -NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance, - const char *protocol, - const char *host, int32_t port, - const char *scheme, - const char *realm, - char **username, uint32_t *ulen, - char **password, - uint32_t *plen); -uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID)); -void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID); -NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu); -NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace); - -#ifdef __cplusplus -} /* end extern "C" */ -#endif - -#endif /* RC_INVOKED */ -#if defined(__OS2__) -#pragma pack() -#endif - -#endif /* npapi_h_ */ diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npfunctions.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npfunctions.h deleted file mode 100644 index c54e473..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npfunctions.h +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef NPFUNCTIONS_H -#define NPFUNCTIONS_H - - -#include "npruntime.h" -#include "npapi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(XP_WIN) -#define EXPORTED_CALLBACK(_type, _name) _type (__stdcall * _name) -#else -#define EXPORTED_CALLBACK(_type, _name) _type (* _name) -#endif - -typedef NPError (*NPN_GetURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, void* notifyData); -typedef NPError (*NPN_PostURLNotifyProcPtr)(NPP instance, const char* URL, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData); -typedef NPError (*NPN_RequestReadProcPtr)(NPStream* stream, NPByteRange* rangeList); -typedef NPError (*NPN_NewStreamProcPtr)(NPP instance, NPMIMEType type, const char* window, NPStream** stream); -typedef int32_t (*NPN_WriteProcPtr)(NPP instance, NPStream* stream, int32_t len, void* buffer); -typedef NPError (*NPN_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason); -typedef void (*NPN_StatusProcPtr)(NPP instance, const char* message); -typedef const char*(*NPN_UserAgentProcPtr)(NPP instance); -typedef void* (*NPN_MemAllocProcPtr)(uint32_t size); -typedef void (*NPN_MemFreeProcPtr)(void* ptr); -typedef uint32_t (*NPN_MemFlushProcPtr)(uint32_t size); -typedef void (*NPN_ReloadPluginsProcPtr)(NPBool reloadPages); -typedef NPError (*NPN_GetValueProcPtr)(NPP instance, NPNVariable variable, void *ret_value); -typedef NPError (*NPN_SetValueProcPtr)(NPP instance, NPPVariable variable, void *value); -typedef void (*NPN_InvalidateRectProcPtr)(NPP instance, NPRect *rect); -typedef void (*NPN_InvalidateRegionProcPtr)(NPP instance, NPRegion region); -typedef void (*NPN_ForceRedrawProcPtr)(NPP instance); -typedef NPError (*NPN_GetURLProcPtr)(NPP instance, const char* URL, const char* window); -typedef NPError (*NPN_PostURLProcPtr)(NPP instance, const char* URL, const char* window, uint32_t len, const char* buf, NPBool file); -typedef void* (*NPN_GetJavaEnvProcPtr)(void); -typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance); -typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled); -typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance); -typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP npp, void (*func)(void *), void *userData); -typedef NPError (*NPN_GetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, char** value, uint32_t* len); -typedef NPError (*NPN_SetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, const char* value, uint32_t len); -typedef NPError (*NPN_GetAuthenticationInfoProcPtr)(NPP npp, const char* protocol, const char* host, int32_t port, const char* scheme, const char *realm, char** username, uint32_t* ulen, char** password, uint32_t* plen); - -typedef uint32_t (*NPN_ScheduleTimerProcPtr)(NPP npp, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID)); -typedef void (*NPN_UnscheduleTimerProcPtr)(NPP npp, uint32_t timerID); -typedef NPError (*NPN_PopUpContextMenuProcPtr)(NPP instance, NPMenu* menu); -typedef NPBool (*NPN_ConvertPointProcPtr)(NPP npp, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace); - -typedef void (*NPN_ReleaseVariantValueProcPtr) (NPVariant *variant); - -typedef NPIdentifier (*NPN_GetStringIdentifierProcPtr) (const NPUTF8 *name); -typedef void (*NPN_GetStringIdentifiersProcPtr) (const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers); -typedef NPIdentifier (*NPN_GetIntIdentifierProcPtr) (int32_t intid); -typedef int32_t (*NPN_IntFromIdentifierProcPtr) (NPIdentifier identifier); -typedef bool (*NPN_IdentifierIsStringProcPtr) (NPIdentifier identifier); -typedef NPUTF8 *(*NPN_UTF8FromIdentifierProcPtr) (NPIdentifier identifier); - -typedef NPObject* (*NPN_CreateObjectProcPtr) (NPP, NPClass *aClass); -typedef NPObject* (*NPN_RetainObjectProcPtr) (NPObject *obj); -typedef void (*NPN_ReleaseObjectProcPtr) (NPObject *obj); -typedef bool (*NPN_InvokeProcPtr) (NPP npp, NPObject *obj, NPIdentifier methodName, const NPVariant *args, unsigned argCount, NPVariant *result); -typedef bool (*NPN_InvokeDefaultProcPtr) (NPP npp, NPObject *obj, const NPVariant *args, unsigned argCount, NPVariant *result); -typedef bool (*NPN_EvaluateProcPtr) (NPP npp, NPObject *obj, NPString *script, NPVariant *result); -typedef bool (*NPN_GetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant *result); -typedef bool (*NPN_SetPropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName, const NPVariant *value); -typedef bool (*NPN_HasPropertyProcPtr) (NPP, NPObject *npobj, NPIdentifier propertyName); -typedef bool (*NPN_HasMethodProcPtr) (NPP npp, NPObject *npobj, NPIdentifier methodName); -typedef bool (*NPN_RemovePropertyProcPtr) (NPP npp, NPObject *obj, NPIdentifier propertyName); -typedef void (*NPN_SetExceptionProcPtr) (NPObject *obj, const NPUTF8 *message); -typedef bool (*NPN_EnumerateProcPtr) (NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count); -typedef bool (*NPN_ConstructProcPtr)(NPP npp, NPObject* obj, const NPVariant *args, uint32_t argCount, NPVariant *result); - -typedef NPError (*NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved); -typedef NPError (*NPP_DestroyProcPtr)(NPP instance, NPSavedData** save); -typedef NPError (*NPP_SetWindowProcPtr)(NPP instance, NPWindow* window); -typedef NPError (*NPP_NewStreamProcPtr)(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype); -typedef NPError (*NPP_DestroyStreamProcPtr)(NPP instance, NPStream* stream, NPReason reason); -typedef void (*NPP_StreamAsFileProcPtr)(NPP instance, NPStream* stream, const char* fname); -typedef int32_t (*NPP_WriteReadyProcPtr)(NPP instance, NPStream* stream); -typedef int32_t (*NPP_WriteProcPtr)(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer); -typedef void (*NPP_PrintProcPtr)(NPP instance, NPPrint* platformPrint); -typedef int16_t (*NPP_HandleEventProcPtr)(NPP instance, void* event); -typedef void (*NPP_URLNotifyProcPtr)(NPP instance, const char* URL, NPReason reason, void* notifyData); -typedef NPError (*NPP_GetValueProcPtr)(NPP instance, NPPVariable variable, void *ret_value); -typedef NPError (*NPP_SetValueProcPtr)(NPP instance, NPNVariable variable, void *value); -typedef NPBool (*NPP_GotFocusPtr)(NPP instance, NPFocusDirection direction); -typedef void (*NPP_LostFocusPtr)(NPP instance); -typedef void (*NPP_URLRedirectNotifyPtr)(NPP instance, const char* url, int32_t status, void* notifyData); -typedef NPError (*NPP_ClearSiteDataPtr)(const char* site, uint64_t flags, uint64_t maxAge); -typedef char** (*NPP_GetSitesWithDataPtr)(void); - -typedef void *(*NPP_GetJavaClassProcPtr)(void); -typedef void* JRIGlobalRef; //not using this right now - -typedef struct _NPNetscapeFuncs { - uint16_t size; - uint16_t version; - - NPN_GetURLProcPtr geturl; - NPN_PostURLProcPtr posturl; - NPN_RequestReadProcPtr requestread; - NPN_NewStreamProcPtr newstream; - NPN_WriteProcPtr write; - NPN_DestroyStreamProcPtr destroystream; - NPN_StatusProcPtr status; - NPN_UserAgentProcPtr uagent; - NPN_MemAllocProcPtr memalloc; - NPN_MemFreeProcPtr memfree; - NPN_MemFlushProcPtr memflush; - NPN_ReloadPluginsProcPtr reloadplugins; - NPN_GetJavaEnvProcPtr getJavaEnv; - NPN_GetJavaPeerProcPtr getJavaPeer; - NPN_GetURLNotifyProcPtr geturlnotify; - NPN_PostURLNotifyProcPtr posturlnotify; - NPN_GetValueProcPtr getvalue; - NPN_SetValueProcPtr setvalue; - NPN_InvalidateRectProcPtr invalidaterect; - NPN_InvalidateRegionProcPtr invalidateregion; - NPN_ForceRedrawProcPtr forceredraw; - - NPN_GetStringIdentifierProcPtr getstringidentifier; - NPN_GetStringIdentifiersProcPtr getstringidentifiers; - NPN_GetIntIdentifierProcPtr getintidentifier; - NPN_IdentifierIsStringProcPtr identifierisstring; - NPN_UTF8FromIdentifierProcPtr utf8fromidentifier; - NPN_IntFromIdentifierProcPtr intfromidentifier; - NPN_CreateObjectProcPtr createobject; - NPN_RetainObjectProcPtr retainobject; - NPN_ReleaseObjectProcPtr releaseobject; - NPN_InvokeProcPtr invoke; - NPN_InvokeDefaultProcPtr invokeDefault; - NPN_EvaluateProcPtr evaluate; - NPN_GetPropertyProcPtr getproperty; - NPN_SetPropertyProcPtr setproperty; - NPN_RemovePropertyProcPtr removeproperty; - NPN_HasPropertyProcPtr hasproperty; - NPN_HasMethodProcPtr hasmethod; - NPN_ReleaseVariantValueProcPtr releasevariantvalue; - NPN_SetExceptionProcPtr setexception; - NPN_PushPopupsEnabledStateProcPtr pushpopupsenabledstate; - NPN_PopPopupsEnabledStateProcPtr poppopupsenabledstate; - NPN_EnumerateProcPtr enumerate; - NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall; - NPN_ConstructProcPtr construct; - NPN_GetValueForURLProcPtr getvalueforurl; - NPN_SetValueForURLProcPtr setvalueforurl; - NPN_GetAuthenticationInfoProcPtr getauthenticationinfo; - NPN_ScheduleTimerProcPtr scheduletimer; - NPN_UnscheduleTimerProcPtr unscheduletimer; - NPN_PopUpContextMenuProcPtr popupcontextmenu; - NPN_ConvertPointProcPtr convertpoint; -} NPNetscapeFuncs; - -typedef struct _NPPluginFuncs { - uint16_t size; - uint16_t version; - NPP_NewProcPtr newp; - NPP_DestroyProcPtr destroy; - NPP_SetWindowProcPtr setwindow; - NPP_NewStreamProcPtr newstream; - NPP_DestroyStreamProcPtr destroystream; - NPP_StreamAsFileProcPtr asfile; - NPP_WriteReadyProcPtr writeready; - NPP_WriteProcPtr write; - NPP_PrintProcPtr print; - NPP_HandleEventProcPtr event; - NPP_URLNotifyProcPtr urlnotify; - JRIGlobalRef javaClass; - NPP_GetValueProcPtr getvalue; - NPP_SetValueProcPtr setvalue; - NPP_GotFocusPtr gotfocus; - NPP_LostFocusPtr lostfocus; - NPP_URLRedirectNotifyPtr urlredirectnotify; - NPP_ClearSiteDataPtr clearsitedata; - NPP_GetSitesWithDataPtr getsiteswithdata; -} NPPluginFuncs; - -typedef EXPORTED_CALLBACK(NPError, NP_GetEntryPointsFuncPtr)(NPPluginFuncs*); -typedef EXPORTED_CALLBACK(void, NPP_ShutdownProcPtr)(void); - -#if defined(XP_MACOSX) -typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); -typedef NPError (*MainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*); -#endif - -#if defined(XP_UNIX) -typedef EXPORTED_CALLBACK(NPError, NP_InitializeFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*); -typedef EXPORTED_CALLBACK(char*, NP_GetMIMEDescriptionFuncPtr)(void); -#else -typedef EXPORTED_CALLBACK(NPError, NP_InitializeFuncPtr)(NPNetscapeFuncs*); -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npruntime.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npruntime.h deleted file mode 100644 index 828a340..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/npruntime.h +++ /dev/null @@ -1,393 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Copyright (c) 2004, Apple Computer, Inc. and The Mozilla Foundation. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the names of Apple Computer, Inc. ("Apple") or The Mozilla - * Foundation ("Mozilla") nor the names of their contributors may be used - * to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE, MOZILLA AND THEIR CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE, MOZILLA OR - * THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef _NP_RUNTIME_H_ -#define _NP_RUNTIME_H_ - -#include "npapi.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - This API is used to facilitate binding code written in C to script - objects. The API in this header does not assume the presence of a - user agent. That is, it can be used to bind C code to scripting - environments outside of the context of a user agent. - - However, the normal use of the this API is in the context of a - scripting environment running in a browser or other user agent. - In particular it is used to support the extended Netscape - script-ability API for plugins (NP-SAP). NP-SAP is an extension - of the Netscape plugin API. As such we have adopted the use of - the "NP" prefix for this API. - - The following NP{N|P}Variables were added to the Netscape plugin - API (in npapi.h): - - NPNVWindowNPObject - NPNVPluginElementNPObject - NPPVpluginScriptableNPObject - - These variables are exposed through NPN_GetValue() and - NPP_GetValue() (respectively) and are used to establish the - initial binding between the user agent and native code. The DOM - objects in the user agent can be examined and manipulated using - the NPN_ functions that operate on NPObjects described in this - header. - - To the extent possible the assumptions about the scripting - language used by the scripting environment have been minimized. -*/ - -#define NP_BEGIN_MACRO do { -#define NP_END_MACRO } while (0) - -/* - Objects (non-primitive data) passed between 'C' and script is - always wrapped in an NPObject. The 'interface' of an NPObject is - described by an NPClass. -*/ -typedef struct NPObject NPObject; -typedef struct NPClass NPClass; - -typedef char NPUTF8; -typedef struct _NPString { - const NPUTF8 *UTF8Characters; - uint32_t UTF8Length; -} NPString; - -typedef enum { - NPVariantType_Void, - NPVariantType_Null, - NPVariantType_Bool, - NPVariantType_Int32, - NPVariantType_Double, - NPVariantType_String, - NPVariantType_Object -} NPVariantType; - -typedef struct _NPVariant { - NPVariantType type; - union { - bool boolValue; - int32_t intValue; - double doubleValue; - NPString stringValue; - NPObject *objectValue; - } value; -} NPVariant; - -/* - NPN_ReleaseVariantValue is called on all 'out' parameters - references. Specifically it is to be called on variants that own - their value, as is the case with all non-const NPVariant* - arguments after a successful call to any methods (except this one) - in this API. - - After calling NPN_ReleaseVariantValue, the type of the variant - will be NPVariantType_Void. -*/ -void NPN_ReleaseVariantValue(NPVariant *variant); - -#define NPVARIANT_IS_VOID(_v) ((_v).type == NPVariantType_Void) -#define NPVARIANT_IS_NULL(_v) ((_v).type == NPVariantType_Null) -#define NPVARIANT_IS_BOOLEAN(_v) ((_v).type == NPVariantType_Bool) -#define NPVARIANT_IS_INT32(_v) ((_v).type == NPVariantType_Int32) -#define NPVARIANT_IS_DOUBLE(_v) ((_v).type == NPVariantType_Double) -#define NPVARIANT_IS_STRING(_v) ((_v).type == NPVariantType_String) -#define NPVARIANT_IS_OBJECT(_v) ((_v).type == NPVariantType_Object) - -#define NPVARIANT_TO_BOOLEAN(_v) ((_v).value.boolValue) -#define NPVARIANT_TO_INT32(_v) ((_v).value.intValue) -#define NPVARIANT_TO_DOUBLE(_v) ((_v).value.doubleValue) -#define NPVARIANT_TO_STRING(_v) ((_v).value.stringValue) -#define NPVARIANT_TO_OBJECT(_v) ((_v).value.objectValue) - -#define VOID_TO_NPVARIANT(_v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_Void; \ - (_v).value.objectValue = NULL; \ -NP_END_MACRO - -#define NULL_TO_NPVARIANT(_v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_Null; \ - (_v).value.objectValue = NULL; \ -NP_END_MACRO - -#define BOOLEAN_TO_NPVARIANT(_val, _v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_Bool; \ - (_v).value.boolValue = !!(_val); \ -NP_END_MACRO - -#define INT32_TO_NPVARIANT(_val, _v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_Int32; \ - (_v).value.intValue = _val; \ -NP_END_MACRO - -#define DOUBLE_TO_NPVARIANT(_val, _v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_Double; \ - (_v).value.doubleValue = _val; \ -NP_END_MACRO - -#define STRINGZ_TO_NPVARIANT(_val, _v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_String; \ - NPString str = { _val, uint32_t(strlen(_val)) }; \ - (_v).value.stringValue = str; \ -NP_END_MACRO - -#define STRINGN_TO_NPVARIANT(_val, _len, _v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_String; \ - NPString str = { _val, uint32_t(_len) }; \ - (_v).value.stringValue = str; \ -NP_END_MACRO - -#define OBJECT_TO_NPVARIANT(_val, _v) \ -NP_BEGIN_MACRO \ - (_v).type = NPVariantType_Object; \ - (_v).value.objectValue = _val; \ -NP_END_MACRO - - -/* - Type mappings (JavaScript types have been used for illustration - purposes): - - JavaScript to C (NPVariant with type:) - undefined NPVariantType_Void - null NPVariantType_Null - Boolean NPVariantType_Bool - Number NPVariantType_Double or NPVariantType_Int32 - String NPVariantType_String - Object NPVariantType_Object - - C (NPVariant with type:) to JavaScript - NPVariantType_Void undefined - NPVariantType_Null null - NPVariantType_Bool Boolean - NPVariantType_Int32 Number - NPVariantType_Double Number - NPVariantType_String String - NPVariantType_Object Object -*/ - -typedef void *NPIdentifier; - -/* - NPObjects have methods and properties. Methods and properties are - identified with NPIdentifiers. These identifiers may be reflected - in script. NPIdentifiers can be either strings or integers, IOW, - methods and properties can be identified by either strings or - integers (i.e. foo["bar"] vs foo[1]). NPIdentifiers can be - compared using ==. In case of any errors, the requested - NPIdentifier(s) will be NULL. NPIdentifier lifetime is controlled - by the browser. Plugins do not need to worry about memory management - with regards to NPIdentifiers. -*/ -NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name); -void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, - NPIdentifier *identifiers); -NPIdentifier NPN_GetIntIdentifier(int32_t intid); -bool NPN_IdentifierIsString(NPIdentifier identifier); - -/* - The NPUTF8 returned from NPN_UTF8FromIdentifier SHOULD be freed. -*/ -NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier); - -/* - Get the integer represented by identifier. If identifier is not an - integer identifier, the behaviour is undefined. -*/ -int32_t NPN_IntFromIdentifier(NPIdentifier identifier); - -/* - NPObject behavior is implemented using the following set of - callback functions. - - The NPVariant *result argument of these functions (where - applicable) should be released using NPN_ReleaseVariantValue(). -*/ -typedef NPObject *(*NPAllocateFunctionPtr)(NPP npp, NPClass *aClass); -typedef void (*NPDeallocateFunctionPtr)(NPObject *npobj); -typedef void (*NPInvalidateFunctionPtr)(NPObject *npobj); -typedef bool (*NPHasMethodFunctionPtr)(NPObject *npobj, NPIdentifier name); -typedef bool (*NPInvokeFunctionPtr)(NPObject *npobj, NPIdentifier name, - const NPVariant *args, uint32_t argCount, - NPVariant *result); -typedef bool (*NPInvokeDefaultFunctionPtr)(NPObject *npobj, - const NPVariant *args, - uint32_t argCount, - NPVariant *result); -typedef bool (*NPHasPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name); -typedef bool (*NPGetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name, - NPVariant *result); -typedef bool (*NPSetPropertyFunctionPtr)(NPObject *npobj, NPIdentifier name, - const NPVariant *value); -typedef bool (*NPRemovePropertyFunctionPtr)(NPObject *npobj, - NPIdentifier name); -typedef bool (*NPEnumerationFunctionPtr)(NPObject *npobj, NPIdentifier **value, - uint32_t *count); -typedef bool (*NPConstructFunctionPtr)(NPObject *npobj, - const NPVariant *args, - uint32_t argCount, - NPVariant *result); - -/* - NPObjects returned by create, retain, invoke, and getProperty pass - a reference count to the caller. That is, the callee adds a - reference count which passes to the caller. It is the caller's - responsibility to release the returned object. - - NPInvokeFunctionPtr function may return 0 to indicate a void - result. - - NPInvalidateFunctionPtr is called by the scripting environment - when the native code is shutdown. Any attempt to message a - NPObject instance after the invalidate callback has been - called will result in undefined behavior, even if the native code - is still retaining those NPObject instances. (The runtime - will typically return immediately, with 0 or NULL, from an attempt - to dispatch to a NPObject, but this behavior should not be - depended upon.) - - The NPEnumerationFunctionPtr function may pass an array of - NPIdentifiers back to the caller. The callee allocs the memory of - the array using NPN_MemAlloc(), and it's the caller's responsibility - to release it using NPN_MemFree(). -*/ -struct NPClass -{ - uint32_t structVersion; - NPAllocateFunctionPtr allocate; - NPDeallocateFunctionPtr deallocate; - NPInvalidateFunctionPtr invalidate; - NPHasMethodFunctionPtr hasMethod; - NPInvokeFunctionPtr invoke; - NPInvokeDefaultFunctionPtr invokeDefault; - NPHasPropertyFunctionPtr hasProperty; - NPGetPropertyFunctionPtr getProperty; - NPSetPropertyFunctionPtr setProperty; - NPRemovePropertyFunctionPtr removeProperty; - NPEnumerationFunctionPtr enumerate; - NPConstructFunctionPtr construct; -}; - -#define NP_CLASS_STRUCT_VERSION 3 - -#define NP_CLASS_STRUCT_VERSION_ENUM 2 -#define NP_CLASS_STRUCT_VERSION_CTOR 3 - -#define NP_CLASS_STRUCT_VERSION_HAS_ENUM(npclass) \ - ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_ENUM) - -#define NP_CLASS_STRUCT_VERSION_HAS_CTOR(npclass) \ - ((npclass)->structVersion >= NP_CLASS_STRUCT_VERSION_CTOR) - -struct NPObject { - NPClass *_class; - uint32_t referenceCount; - /* - * Additional space may be allocated here by types of NPObjects - */ -}; - -/* - If the class has an allocate function, NPN_CreateObject invokes - that function, otherwise a NPObject is allocated and - returned. This method will initialize the referenceCount member of - the NPObject to 1. -*/ -NPObject *NPN_CreateObject(NPP npp, NPClass *aClass); - -/* - Increment the NPObject's reference count. -*/ -NPObject *NPN_RetainObject(NPObject *npobj); - -/* - Decremented the NPObject's reference count. If the reference - count goes to zero, the class's destroy function is invoke if - specified, otherwise the object is freed directly. -*/ -void NPN_ReleaseObject(NPObject *npobj); - -/* - Functions to access script objects represented by NPObject. - - Calls to script objects are synchronous. If a function returns a - value, it will be supplied via the result NPVariant - argument. Successful calls will return true, false will be - returned in case of an error. - - Calls made from plugin code to script must be made from the thread - on which the plugin was initialized. -*/ - -bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, - const NPVariant *args, uint32_t argCount, NPVariant *result); -bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); -bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, - NPVariant *result); -bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, - NPVariant *result); -bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, - const NPVariant *value); -bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName); -bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName); -bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName); -bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, - uint32_t *count); -bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, - uint32_t argCount, NPVariant *result); - -/* - NPN_SetException may be called to trigger a script exception upon - return from entry points into NPObjects. Typical usage: - - NPN_SetException (npobj, message); -*/ -void NPN_SetException(NPObject *npobj, const NPUTF8 *message); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/nptypes.h b/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/nptypes.h deleted file mode 100644 index 4ebeb97..0000000 --- a/applications/hbbtvplayer/hbbtvbrowserplugin/src/webkit-plugin-header/nptypes.h +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * mozilla.org. - * Portions created by the Initial Developer are Copyright (C) 2004 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Johnny Stenback (Original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef nptypes_h_ -#define nptypes_h_ - -/* - * Header file for ensuring that C99 types ([u]int32_t, [u]int64_t and bool) and - * true/false macros are available. - */ - -#if defined(WIN32) || defined(OS2) - /* - * Win32 and OS/2 don't know C99, so define [u]int_16/32/64 here. The bool - * is predefined tho, both in C and C++. - */ - typedef short int16_t; - typedef unsigned short uint16_t; - typedef int int32_t; - typedef unsigned int uint32_t; - typedef long long int64_t; - typedef unsigned long long uint64_t; - -#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX) - /* - * AIX and SunOS ship a inttypes.h header that defines [u]int32_t, - * but not bool for C. - */ - #include - - #ifndef __cplusplus - typedef int bool; - #define true 1 - #define false 0 - #endif -#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) - /* - * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and - * u_int32_t. - */ - #include - - /* - * BSD/OS ships no header that defines uint32_t, nor bool (for C) - */ - #if defined(bsdi) - typedef u_int32_t uint32_t; - typedef u_int64_t uint64_t; - - #if !defined(__cplusplus) - typedef int bool; - #define true 1 - #define false 0 - #endif - #else - /* - * FreeBSD and OpenBSD define uint32_t and bool. - */ - #include - #include - #endif -#elif defined(BEOS) - #include -#else - /* - * For those that ship a standard C99 stdint.h header file, include - * it. Can't do the same for stdbool.h tho, since some systems ship - * with a stdbool.h file that doesn't compile! - */ - #include - - #ifndef __cplusplus - #if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95) - #include - #else - /* - * GCC 2.91 can't deal with a typedef for bool, but a #define - * works. - */ - #define bool int - #define true 1 - #define false 0 - #endif - #endif -#endif - -#endif /* nptypes_h_ */ diff --git a/applications/hbbtvplayer/hbbtvterminal/autogen.sh b/applications/hbbtvplayer/hbbtvterminal/autogen.sh deleted file mode 100644 index cad4e11..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/autogen.sh +++ /dev/null @@ -1,6 +0,0 @@ - -#! /bin/sh - -autoreconf --install -v - -./configure diff --git a/applications/hbbtvplayer/hbbtvterminal/configure.ac b/applications/hbbtvplayer/hbbtvterminal/configure.ac deleted file mode 100644 index 866a299..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/configure.ac +++ /dev/null @@ -1,40 +0,0 @@ -########################################################################################### -## -## Copyright 2011 Telecom Paristech -## Author : Stanislas Selle -## -########################################################################################### - -### Configure.ac for hbbtvterminal - - -AC_INIT([hbbtvterminal], [0.1.0], [stanislas.selle@telecom-paristech.fr]) - -AC_CONFIG_AUX_DIR([build-aux]) - -AC_CONFIG_MACRO_DIR([m4]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AM_INIT_AUTOMAKE([foreign -Wall -Werror]) - -#check programs -AC_PROG_CXX - -#check modules -PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28.0]) -PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.20.1]) -PKG_CHECK_MODULES([WEBKIT], [webkit-1.0 >= 1.5.2]) -PKG_CHECK_MODULES([PIXMAN], [pixman-1 >= 0.16.4]) -PKG_CHECK_MODULES([HBBTVBROWSERPLUGIN], [hbbtvbrowserplugin >= 0.0.3]) - -# Checks for header files. -AC_PATH_X - -# check header -AC_HEADER_STDBOOL - -# makefiles -AC_CONFIG_FILES([makefile src/makefile]) - - -AC_OUTPUT diff --git a/applications/hbbtvplayer/hbbtvterminal/hbbtv_terminal.vcproj b/applications/hbbtvplayer/hbbtvterminal/hbbtv_terminal.vcproj deleted file mode 100644 index 987a985..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/hbbtv_terminal.vcproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/applications/hbbtvplayer/hbbtvterminal/makefile.am b/applications/hbbtvplayer/hbbtvterminal/makefile.am deleted file mode 100644 index e21b6f2..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/makefile.am +++ /dev/null @@ -1,17 +0,0 @@ - -SUBDIRS = src - -#TESTTS = /home/selle/ressources/mpeg2-ts-hbbtv/TPT/OpenHbb-ch4.ts -TESTTS = /home/selle/ressources/OpenHbbDemo-3ch2app/OpenHbbDemo-3ch2app.ts - - -TESTURL1 = http://cairhblog.free.fr/menu.html -TESTURL2 = http://aquila.enst.fr:8080/subwebsite/hbbtvtest/oha0005web/index.php -TESTLOG = /tmp/test-err.txt - -test : all - ./src/hbbtvterminal -input=$(TESTTS) -test1 : all - ./src/hbbtvterminal -input=$(TESTTS) -url=$(TESTURL1) -test2 : all - ./src/hbbtvterminal -input=$(TESTTS) -url=$(TESTURL2) diff --git a/applications/hbbtvplayer/hbbtvterminal/makefile.old b/applications/hbbtvplayer/hbbtvterminal/makefile.old deleted file mode 100644 index b56fe1b..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/makefile.old +++ /dev/null @@ -1,81 +0,0 @@ -## -## Copyright : Telecom Paristech - 2011 -## -## Author : Stanislas Selle -## - -############################################################################### -## Programs - -COMPILER = g++ -DELETER = rm -f - - -CFLAGS = -g - -CFLAGS += -DXP_UNIX -CFLAGS += -fPIC - -############################################################################### -## Options, Flags and LinkS - -INCLUDEFLAGS = -I/usr/include/xulrunner-lastest/ \ - -I../../gpac_public/include/ \ - -I../hbbtvbrowserplugin/src/ \ - -I../../gpac_public/ - -LIBRARYPATHS = -L/usr/lib/xulrunner-devel-lastest/sdk/lib/ \ - -L../../gpac_public/bin/gcc/ \ - -L../hbbtvbrowserplugin/bin/ - -LIBRARYNAMES = -lgpac \ - -lmozjs \ - -lxpcom \ - -lxul \ - ../hbbtvbrowserplugin/bin/hbbtvbrowserplugin.so - - -LIBRARYFLAGS = $(LIBRARYPATHS) $(LIBRARYNAMES) - -FROMPKG = webkit-1.0 gtk+-2.0 pixman-1 - -ifneq ($(strip $(FROMPKG)),) -PKGFLAGS = `pkg-config --cflags $(FROMPKG) ` -PKGLIBS = `pkg-config --libs $(FROMPKG) ` -INCLUDEFLAGS += $(PKGFLAGS) -LIBRARYFLAGS += $(PKGLIBS) -endif - - -############################################################################### -## Files - - -MAINTARGET = bin/hbbtvterminal - -OBJ = obj/hbbtvterminal.o \ - obj/hbbtv_demux.o \ - obj/hbbtv_channel.o - -#TESTTS = /home/selle/ressources/OpenHbbDemo-3ch2app/OpenHbbDemo-3ch2app.ts -TESTTS = /home/selle/ressources/mpeg2-ts-hbbtv/TPT/OpenHbb-ch4.ts -TESTURL = http://aquila.enst.fr:8080/subwebsite/hbbtvtest/oha0005web/index.php -TESTLOG = /tmp/test-err.txt - -############################################################################### -## Rules - - -all : $(MAINTARGET) - -$(MAINTARGET) : $(OBJ) - $(COMPILER) $(CFLAGS) $(LIBRARYFLAGS) $(OBJ) -o $(MAINTARGET) - -obj/%.o : src/%.cpp - $(COMPILER) $(CFLAGS) $(INCLUDEFLAGS) -c $^ -o $@ - -test : all - $(MAINTARGET) -input=$(TESTTS) - -clean : - rm -f $(OBJ) $(MAINTARGET) diff --git a/applications/hbbtvplayer/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/HbbtvTerminal.cbp b/applications/hbbtvplayer/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/HbbtvTerminal.cbp deleted file mode 100644 index 8f32993..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/HbbtvTerminal.cbp +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - diff --git a/applications/hbbtvplayer/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/HbbtvTerminal.layout b/applications/hbbtvplayer/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/HbbtvTerminal.layout deleted file mode 100644 index c091bfa..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/projectmanager/codeblocks/hbbtvterminal/HbbtvTerminal.layout +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_channel.cpp b/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_channel.cpp deleted file mode 100644 index 37e4427..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_channel.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Jonathan Sillan - * - */ - -#include "hbbtvterminal.h" - -static Bool app_priority_test(GF_M2TS_AIT_APPLICATION*,u8 app_priority,u8 app_transport, u8 MaxPriority); - -/* Constructor */ -Channel::Channel(u32 TSservice_ID, char* TSchannel_name){ - - u8 i; - service_ID = TSservice_ID; - if(TSchannel_name){ - channel_name = gf_strdup(channel_name); - }else{ - channel_name = NULL; - } - - video_ID = 0; - for(i=0 ; i= nb_chan_audio_stream){ - indice = 0; - } - current_audio_index = indice; - return audio_ID[indice]; -} - -u32 Channel::Get_ait_pid(){ - return AIT_PID; -} - -u32 Channel::Get_pmt_pid(){ - return PMT_PID; -} - -Bool Channel::Get_processed(){ - return processed; -} - -u32 Channel::Get_audio_index(){ - return current_audio_index; -} - -u32 Channel::Get_nb_chan_audio_stream(){ - return nb_chan_audio_stream; -} - -GF_M2TS_CHANNEL_APPLICATION_INFO*Channel::Get_App_info(){ - return ChannelApp; -} - -GF_M2TS_AIT_APPLICATION* Channel::App_to_play(Bool isConnected,u8 MaxPriority){ - u32 i; - Bool App_selected; - u32 app_index; - u8 app_priority; - u8 app_transport; - - App_selected = 0; - app_priority = 0; - app_index = 0; - app_transport = 0; - - for(i = 0 ; inb_application; i++){ - GF_M2TS_AIT_APPLICATION* App_info = (GF_M2TS_AIT_APPLICATION*)gf_list_get(ChannelApp->Application,i); - if((isConnected && App_info->broadband) || App_info->broadcast){ - if(App_info->application_control_code == AUTOSTART){ - if(app_priority_test(App_info,app_priority,isConnected,MaxPriority)){ - app_priority = App_info->priority; - app_index = i; - App_selected = 1; - if(!app_transport && App_info->broadband && isConnected){ - app_transport = BROADBAND; - }else{ - app_transport = BROADCAST; - } - - } - } - } - } - if(App_selected){ - GF_M2TS_AIT_APPLICATION* App_info = (GF_M2TS_AIT_APPLICATION*)gf_list_get(ChannelApp->Application,app_index); - return App_info; - } - return NULL; -} - -GF_M2TS_AIT_APPLICATION* Channel::Get_App(u32 application_id){ - u32 i; - - for(i = 0 ; inb_application; i++){ - GF_M2TS_AIT_APPLICATION* App_info = (GF_M2TS_AIT_APPLICATION*)gf_list_get(ChannelApp->Application,i); - if(App_info->application_id == application_id){ - return App_info; - } - } - return NULL; -} - - - -/* Class Fonction */ - -u32 Channel::Add_service_id(u32 service_id){ - if(service_id){ - service_ID = service_id; - return GF_OK; - } - return GF_BAD_PARAM; -} - -u32 Channel::Add_channel_name(char* chan_name){ - if(chan_name != NULL){ - channel_name = gf_strdup(chan_name); - return GF_OK; - } - return GF_BAD_PARAM; -} -u32 Channel::Add_video_ID(u32 video_index){ - if(video_index){ - video_ID = video_index; - return GF_OK; - } - return GF_BAD_PARAM; -} - -u32 Channel::Add_audio_ID(u32 audio_index){ - if(audio_index){ - u32 i; - for(i = 0; ipriority >= MaxPriority && (MaxPriority >0)) && - ((app_priority < App_info->priority) || (app_priority == App_info->priority)) - && ((isConnected && App_info->broadband)||App_info->broadcast)){ - return 1; - } - - return 0; -} diff --git a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_demux.cpp b/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_demux.cpp deleted file mode 100644 index 9bdaebf..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_demux.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Jonathan Sillan - * - */ - -#include "hbbtvterminal.h" - -static u32 New_ait_received(HbbtvDemuxer* hbbtv_demuxer,GF_M2TS_AIT *ait, char *data, u32 data_size, u32 table_id); -static u32 On_hbbtv_ait_section(sPlayerInterface* player_interf, GF_Event *event); -static u32 On_hbbtv_dsmcc_section(sPlayerInterface* player_interf, GF_Event *event); -static u32 On_hbbtv_get_tsdemuxer(sPlayerInterface* player_interf, GF_Event *event); - - - -/* Constructor */ -HbbtvDemuxer::HbbtvDemuxer(char *input_data, char* url, Bool dsmcc, Bool no_url,sPlayerInterface* player_interf) -{ - - Demuxts = NULL; - - Channels = gf_list_new(); - Input_data = gf_strdup(input_data); - user = player_interf; - player_interf->Demuxer = this; - ait_to_process = 0; - nb_prog_pmt_received = 0; - all_prog_pmt_received =0; - No_URL = 0; - Ignore_TS_URL = 0; - if(dsmcc){ - process_dsmcc = 1; - }else{ - process_dsmcc = 0; - } - - if(no_url){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] No URL \n")); - No_URL = 1; - }else if(url){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Forced URL %s \n",url)); - Force_URL = gf_strdup(url); - Ignore_TS_URL = 1; - } - nb_ait = 0; - ts_demux_mutex = gf_mx_new("HBBTV_TS_Demux_Mutex"); - - ts_demux_thread = gf_th_new("HBBTV_TS_Demux_Thread"); - -} - -/* Destructor */ - -/* Getter */ - -GF_M2TS_Demuxer* HbbtvDemuxer::Get_Ts() -{ - return Demuxts; -} - -GF_List* HbbtvDemuxer::Get_AIT_To_Process_list() -{ - return Ait_To_Process; -} - -char* HbbtvDemuxer::Get_Input_data() -{ - return Input_data; -} - -Bool HbbtvDemuxer::Get_if_dsmcc_process() -{ - return process_dsmcc; -} - -GF_Thread * HbbtvDemuxer::Get_Demux_Thread() -{ - return ts_demux_thread; -} - -GF_Mutex * HbbtvDemuxer::Get_Demux_Mutex() -{ - return ts_demux_mutex; -} - -GF_List * HbbtvDemuxer::Get_ChannelList(){ - return Channels; -} - - -Channel* HbbtvDemuxer::Get_Channel(u32 service_id){ - u32 nb_channel,i; - - nb_channel = gf_list_count(Channels); - - for(i=0;iGet_service_id() == service_id){ - return Chan; - } - } - return NULL; -} - -void* HbbtvDemuxer::Get_User(){ - - return user; -} - - -char* HbbtvDemuxer::Get_Force_URL(){ - return Force_URL; -} - -Bool HbbtvDemuxer::Get_Ignore_TS_URL(){ - return Ignore_TS_URL; -} - -Bool HbbtvDemuxer::Get_ait_to_proces(){ - return ait_to_process; -} - - -/* Setter */ -void HbbtvDemuxer::Set_Ts(GF_M2TS_Demuxer *on_ts){ - Demuxts = on_ts; -} - -void HbbtvDemuxer::Set_ait_to_process(Bool on){ - ait_to_process = on; -} - -/* Class Fonction */ -GF_Err HbbtvDemuxer::Get_application_info(GF_M2TS_CHANNEL_APPLICATION_INFO*ChannelApp) -{ - if(!Ignore_TS_URL && !No_URL){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Get application for service %d \n",ChannelApp->service_id)); - return get_app_url((sPlayerInterface*)user,ChannelApp); - }else{ - - if(!No_URL){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Forced URL %s \n",Force_URL)); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] URL blocked by the user. No Application to play \n"));; - } - return GF_OK; - - } -} - -Channel* HbbtvDemuxer::Zap_channel(u32 service_id,int zap){ - u32 count_list; - u32 i ; - - count_list = gf_list_count(Channels); -// GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] list: %d\n",count_list)); - for(i=0;iGet_service_id() == service_id){ - if(zap != 0){ - /* zap is use for changing channel. It could be +1 or -1 in order to take the next/previous service */ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] i: %d zap %d\n",i,zap)); - - i= (i+zap+count_list)%count_list; /* loop on the channels */ - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] i: %d list %d\n",i,count_list)); - } - Channel* chan = ( Channel*)gf_list_get(Channels,i); - return chan; - } - } - - /* If the prog goes here that means Channels list is empty or - no object from this current service_id has already been processed */ -// GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] add service_id: %d \n",service_id)); - Channel* chan = new Channel(service_id,NULL); - gf_list_add(Channels,chan); - return chan; -} - -void HbbtvDemuxer::Channel_check(){ - u32 count_list; - u32 i ; - - count_list = gf_list_count(Channels); - for(i=0;iCheck_Info_Done(); - } - } - - -int HbbtvDemuxer::Check_all_channel_info_received(int Timer){ - - if(!Demuxts){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTV]No PAT received \n")); - return 0; - } - /* Check if all the PMT have been processed or wait until 5 secondes to starts the program */ - if(all_prog_pmt_received || Timer == 5){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] nb_prog_pmt_received %d\n",nb_prog_pmt_received)); - return 1; - } - return 0; -} - -void HbbtvDemuxer::Create_Channel(GF_M2TS_Program *prog){ - - Channel* chan = new Channel(prog->number,NULL); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal]Service number:%d\n",prog->number)); - chan->Add_pmt_pid(prog->pmt_pid); - gf_list_add(Channels,chan); - -} - -void HbbtvDemuxer::Check_PMT_Processing(){ - nb_prog_pmt_received++; - GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("Demuxts->programs %d\n",gf_list_count(Demuxts->programs))); - if(nb_prog_pmt_received == gf_list_count(Demuxts->programs)){ - all_prog_pmt_received = 1; - } -} - - -/* Global Functions */ - -u32 DemuxThreadStart(HbbtvDemuxer *hbbtv_demuxer){ - - return gf_th_run(hbbtv_demuxer->Get_Demux_Thread(),DemuxStart,(void*)hbbtv_demuxer); -} - -u32 On_hbbtv_received_section(void *ptr, GF_Event *event){ - u32 e; - - e = GF_OK; - HbbtvDemuxer* hbbtv_demuxer = (HbbtvDemuxer*)ptr; - sPlayerInterface* player_interf = (sPlayerInterface*)hbbtv_demuxer->Get_User(); - - - if (event->type == GF_EVENT_FORWARDED) - { - if(event->forwarded_event.service_event_type == GF_M2TS_EVT_PAT_FOUND && hbbtv_demuxer->Get_Ts() == NULL){ - e = On_hbbtv_get_tsdemuxer(player_interf,event); - if(e != 0){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Error in receiving the TS Demuxer \n")); - - } - } - if(event->forwarded_event.service_event_type == GF_M2TS_EVT_AIT_FOUND){ - e = On_hbbtv_ait_section(player_interf,event); - } - if(event->forwarded_event.service_event_type == GF_M2TS_EVT_DSMCC_FOUND){ - e = On_hbbtv_dsmcc_section(player_interf,event); - } - if(event->forwarded_event.service_event_type == GF_M2TS_EVT_PMT_FOUND){ - gf_mx_p(hbbtv_demuxer->Get_Demux_Mutex()); - GF_M2TS_Program * prog = (GF_M2TS_Program*)event->forwarded_event.param; - GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("PMT PID %d \n",prog->pmt_pid)); - hbbtv_demuxer->Create_Channel(prog); - hbbtv_demuxer->Check_PMT_Processing(); - gf_mx_v(hbbtv_demuxer->Get_Demux_Mutex()); - } - } - return e; - - -} - -static u32 On_hbbtv_ait_section(sPlayerInterface* player_interf, GF_Event *event) -{ - HbbtvDemuxer* hbbtv_demuxer = (HbbtvDemuxer*)player_interf->Demuxer; - GF_M2TS_AIT_CARRY* ait_carry; - - - ait_carry = (GF_M2TS_AIT_CARRY*)event->forwarded_event.param; - - /* Make sure we are not modifying the AIT List at the same time */ - gf_mx_p(hbbtv_demuxer->Get_Demux_Mutex()); - if(player_interf->init){ - Get_application_for_channel(hbbtv_demuxer,ait_carry->service_id); - } - - /* Unlock the mutex */ - gf_mx_v(hbbtv_demuxer->Get_Demux_Mutex()); - - return 0; -} - -u32 Get_application_for_channel(HbbtvDemuxer* hbbtv_demuxer,u32 service_id){ - u32 nb_channel; - Channel* Chan; - GF_M2TS_CHANNEL_APPLICATION_INFO* ChanAppInfo; - GF_Err e; - - Chan = hbbtv_demuxer->Get_Channel(service_id); - if(!Chan){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] service ID %d is not available\n",service_id)); - return GF_BAD_PARAM; - } - - ChanAppInfo = gf_m2ts_get_channel_application_info(hbbtv_demuxer->Get_Ts()->ChannelAppList,service_id); - - if(!ChanAppInfo){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] service ID %d no application available\n",service_id)); - return GF_BAD_PARAM; - } - - Chan->Add_App_info(ChanAppInfo); - e = hbbtv_demuxer->Get_application_info(ChanAppInfo); - if(e == GF_OK){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Application found for the service ID %d is ON\n",ChanAppInfo->service_id)); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] This application for this service ID %d does not belong to the current one.\n\n",ChanAppInfo->service_id)); - } - - return GF_OK; - -} - -static u32 On_hbbtv_dsmcc_section(sPlayerInterface* player_interf, GF_Event *event) -{ - HbbtvDemuxer* hbbtv_demuxer = (HbbtvDemuxer*)player_interf->Demuxer; - GF_M2TS_Demuxer* ts = hbbtv_demuxer->Get_Ts(); - GF_M2TS_DSMCC_OVERLORD* dsmcc_overlord; - - GF_M2TS_SL_PCK* pck = (GF_M2TS_SL_PCK*)event->forwarded_event.param; - - dsmcc_overlord = gf_m2ts_get_dmscc_overlord(ts->dsmcc_controler,pck->stream->service_id); - - if (dsmcc_overlord && dsmcc_overlord->get_index){ - GF_M2TS_AIT_APPLICATION* Application; - Channel* Chan; - Chan = (Channel*)hbbtv_demuxer->Get_Channel(dsmcc_overlord->service_id); - //if(!Chan) - Application = Chan->Get_App(dsmcc_overlord->application_id); - Application->url_received = 1; - put_app_url(player_interf); - } - - return 0; -} - -static u32 On_hbbtv_get_tsdemuxer(sPlayerInterface* player_interf, GF_Event *event) -{ - HbbtvDemuxer* hbbtv_demuxer = (HbbtvDemuxer*)player_interf->Demuxer; - GF_M2TS_Demuxer *ts = (GF_M2TS_Demuxer*)event->forwarded_event.param; - hbbtv_demuxer->Set_Ts(ts); - if(hbbtv_demuxer->Get_Ts() != NULL){ - if(hbbtv_demuxer->Get_if_dsmcc_process() && !ts->process_dmscc){ - gf_m2ts_demux_dmscc_init(ts); - } - return GF_OK; - } - - return GF_BAD_PARAM; -} - -u32 DemuxStart(void *par){ - - GF_Err e; - HbbtvDemuxer* hbbtv_demuxer = (HbbtvDemuxer*) par; - e = TSDemux_Demux_Setup(hbbtv_demuxer->Get_Ts(), hbbtv_demuxer->Get_Input_data(), 0); - if(e) - { - GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("[HBBTV] Error during TS demux \n")); - } - return e; - -} - -Channel* ZapChannel(HbbtvDemuxer *hbbtv_demuxer,u32 service_id,int zap){ - return hbbtv_demuxer->Zap_channel(service_id,zap); -} diff --git a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_keycontrol.cpp b/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_keycontrol.cpp deleted file mode 100644 index b6108e6..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_keycontrol.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - Jonathan Sillan - * - */ -#include "hbbtvterminal.h" - - - -void gtksendkey(sPlayerInterface* player_interf,int keycode); - -void gtksendkey(sPlayerInterface* player_interf,int keycode) -{ - TRACEINFO; - GdkEvent *KeyEvent; - - fprintf(stderr, "\x1b[%i;3%imKeyCode\x1b[0m: %d\n",1, 4,keycode); - - KeyEvent = gdk_event_new (GDK_KEY_PRESS); - /* Key Value */ - KeyEvent->key.keyval = gdk_unicode_to_keyval(keycode); - /* GDK_BUTTON1_MASK refers to left mouse button */ - KeyEvent->key.state = GDK_BUTTON1_MASK; - /* Send the key event to Web Window */ - - KeyEvent->key.window = player_interf->ui->pWebWindow->window; - gtk_main_do_event (KeyEvent); - //gdk_event_free(KeyEvent); -} - -/* HBBTV Button */ - -void on_redbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - fprintf(stderr, "\x1b[%i;3%imBOUTON PRESSED\n\x1b[0m", 1, 5); - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_RED]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("RED is registered by the application : send HBBTV_VK_RED to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_RED); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("RED is not registered by the application\n")); - } - -} - -void on_greenbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_GREEN]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("GREEN is registered by the application : send HBBTV_VK_GREEN to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_GREEN); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("GREEN is not registered by the application\n")); - } -} - -void on_yellowbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_YELLOW]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("YELLOW is registered by the application : send HBBTV_VK_YELLOW to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_YELLOW); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("YELLOW is not registered by the application\n")); - } -} - -void on_bluebuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_BLUE]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("BLUE is registered by the application : send HBBTV_VK_BLUE to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_BLUE); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("BLUE is not registered by the application\n")); - } -} - -/* Navigation */ - -void on_returnbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_NAVIGATION]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is registered by the application : send HBBTV_VK_ENTER to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_ENTER); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is not registered by the application\n")); - } -} - -void on_exitbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - int posx,posy; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - //~ gtk_window_set_transient_for(GTK_WINDOW(player_interf->ui->pWebWindow),GTK_WINDOW(player_interf->ui->pTVWindow)); - get_window_position(player_interf->ui->pWebWindow, &posx, &posy); - resizevideoplayer(player_interf, HBBTV_VIDEO_WIDTH, HBBTV_VIDEO_HEIGHT); - set_window_position(player_interf->ui->pTVWindow, posx, posy); - gtk_window_set_position(GTK_WINDOW(player_interf->ui->pTVWindow),GTK_WIN_POS_CENTER_ALWAYS); - webkit_web_view_load_uri(player_interf->ui->pWebView, player_interf->url); -} - -void on_upbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_NAVIGATION]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is registered by the application : send HBBTV_VK_UP to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_UP); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is not registered by the application\n")); - } -} - -void on_downbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_NAVIGATION]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is registered by the application : send HBBTV_VK_DOWN to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_DOWN); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is not registered by the application\n")); - } -} - -void on_leftbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_NAVIGATION]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is registered by the application : send HBBTV_VK_LEFT to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_LEFT); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE,("NAVIGATION is not registered by the application\n")); - } -} - -void on_rightbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_NAVIGATION]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is registered by the application : send HBBTV_VK_RIGHT to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_RIGHT); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NAVIGATION is not registered by the application\n")); - } -} - - - -/* Control */ - -void on_playpausebuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - set_window_position(player_interf->ui->pTVWindow, 0, 0); -} - -void on_playbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_VCR]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("VCR is registered by the application : send HBBTV_VK_PLAY to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_PLAY); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("VCR is not registered by the application\n")); - } - -} - -void on_pausebuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf = (sPlayerInterface*)data; - if (player_interf->keyregistered[RK_VCR]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("VCR is registered by the application : send HBBTV_VK_PAUSE to the Application\n")); - gtksendkey(player_interf,HBBTV_VK_PAUSE); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("VCR is not registered by the application\n")); - } -} - -void on_onoffbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf; - player_interf = (sPlayerInterface*)data; - - if (player_interf->TVwake == FALSE) { - init_gpac(player_interf); - player_interf->TVwake = TRUE; - } - else { - stop_gpac(player_interf); - player_interf->TVwake = FALSE; - } - TRACEINFO; -} - -void on_langbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf; - u32 current_service_id; - HbbtvDemuxer *hbbtvdemuxer; - GF_MediaInfo odi; - u32 index_audio,audio_ID; - - player_interf = (sPlayerInterface*)data; - hbbtvdemuxer = ( HbbtvDemuxer *)player_interf->Demuxer; - current_service_id = index_audio = audio_ID = 0; - - /* Get the current channel struct */ - current_service_id = gf_term_get_current_service_id(player_interf->m_term); - Channel* chan = (Channel*)ZapChannel(hbbtvdemuxer,current_service_id,0); - if(chan->Get_nb_chan_audio_stream() > 1){ - GF_ObjectManager *root_odm = gf_term_get_root_object(player_interf->m_term); - if (root_odm){ - if (gf_term_get_object_info(player_interf->m_term, root_odm, &odi) == GF_OK){ - if (odi.od) { - /* Increment the audio index to get the next audio stream */ - chan->Incr_audio_index(0); - gf_term_select_object(player_interf->m_term, gf_term_get_object(player_interf->m_term, root_odm, chan->Get_audio_ID(chan->Get_audio_index()))); - } - } - } - } -} - -void on_teletextbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf; - player_interf = (sPlayerInterface*)data; - gtksendkey(player_interf,HBBTV_VK_TELETEXT); - -} - -void on_channelbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf; - GtkButton* button; - int key_code; - char* label; - player_interf = (sPlayerInterface*)data; - button = (GtkButton*) widget; - label = (char*)gtk_button_get_label(button); - - switch(atoi(label)){ - case 0: - key_code = HBBTV_VK_0; - break; - case 1: - key_code = HBBTV_VK_1; - break; - case 2: - key_code = HBBTV_VK_2; - break; - case 3: - key_code = HBBTV_VK_3; - break; - case 4: - key_code = HBBTV_VK_4; - break; - case 5: - key_code = HBBTV_VK_5; - break; - case 6: - key_code = HBBTV_VK_6; - break; - case 7: - key_code = HBBTV_VK_7; - break; - case 8: - key_code = HBBTV_VK_8; - break; - case 9: - key_code = HBBTV_VK_9; - break; - default: - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("Wrong Key Code %d Defaut channel 1 \n",atoi(label))); - key_code = HBBTV_VK_1; - break; - } - if (player_interf->keyregistered[RK_NUMERIC]){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NUMERIC is registered by the application : send HBBTV_VK_%i to the Application\n",atoi(label))); - gtksendkey(player_interf,key_code); - }else{ - hbbtvterm_get_channel_on_air(player_interf,atoi(label),0); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("NUMERIC is not registered by the application, change channel function\n")); - } - - -} - - -void on_chanupbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf; - player_interf = (sPlayerInterface*)data; - - hbbtvterm_channel_zap(player_interf,1); - - TRACEINFO; -} - - -void on_chandownbuttonclicked(GtkWidget *widget, gpointer data) -{ - TRACEINFO; - sPlayerInterface* player_interf; - player_interf = (sPlayerInterface*)data; - - hbbtvterm_channel_zap(player_interf,-1); - - TRACEINFO; -} - -int playpause(sPlayerInterface* player_interf) -{ - int is_pause = gf_term_get_option( player_interf->m_term, GF_OPT_PLAY_STATE); - fprintf(stdout, "[Status: %s]\n", is_pause ? "Playing" : "Paused"); - gf_term_set_option( player_interf->m_term, GF_OPT_PLAY_STATE, is_pause ? GF_STATE_PLAYING : GF_STATE_PAUSED); - return 1; -} - diff --git a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_tools.cpp b/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_tools.cpp deleted file mode 100644 index ddf8cad..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/hbbtv_tools.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Jonathan Sillan - * - */ -#include "hbbtvterminal.h" - - -GF_Config* check_config_file(){ - Bool firstlaunch; - - firstlaunch = 0; - /*init config and modules*/ - return gf_cfg_init(NULL,&firstlaunch); -} - -Bool is_connected(){ - GF_Err e; - - GF_Socket* sock; - - sock = gf_sk_new(GF_SOCK_TYPE_UDP); - if (sock == NULL) { - return 0; - } - e = gf_sk_connect(sock, "www.google.fr", 4096, NULL); - gf_sk_del(sock); - - if(e){ - return 0; - }else{ - return 1; - } -} - - diff --git a/applications/hbbtvplayer/hbbtvterminal/src/hbbtvterminal.cpp b/applications/hbbtvplayer/hbbtvterminal/src/hbbtvterminal.cpp deleted file mode 100644 index f44a95c..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/hbbtvterminal.cpp +++ /dev/null @@ -1,1081 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - Jonathan Sillan - * - */ - -#include "hbbtvterminal.h" -#ifdef XP_UNIX -#include -#include -#else -#include -#include -#endif - -#include -#include - -//static XID handler; -static void activate_uri_entry_cb (GtkWidget* entry, gpointer data); - -sPlayerInterface* player_interf; - -static gboolean on_deleteevent( GtkWidget *widget, GdkEvent *event, gpointer data) -{ - g_print ("delete event occurred\n"); - TRACEINFO; - return TRUE; -} - -static gboolean on_windowconfigure(GtkWidget * widget, GdkEvent *event, gpointer data) -{ - TRACEINFO; - - static int oldx = 0; - static int oldy = 0; - int x, y, olddatax, olddatay; - - sPlayerInterface* player_interf = (sPlayerInterface*)data; - - gtk_window_get_position(GTK_WINDOW(player_interf->ui->pWebWindow), &olddatax, &olddatay); - - x = event->configure.x; - y = event->configure.y; - - int deltax = x - oldx; - int deltay = y - oldy; - - gtk_window_move(GTK_WINDOW(player_interf->ui->pTVWindow),olddatax + deltax, olddatay + deltay); - gtk_window_move(GTK_WINDOW(player_interf->ui->pBackgroundWindow),olddatax + deltax, olddatay + deltay); - - oldx = x; - oldy = y; - return TRUE; -} - - -static void on_destroyevent(GtkWidget *widget, gpointer data) -{ - gtk_main_quit(); - TRACEINFO; -} - - -int ui_init(sPlayerInterface* player_interf) -{ - GtkWidget *pWindow; - GtkWidget *pTVWindow; - GtkWidget *pWebWindow; - GtkWidget *pMainPositionTable; - GtkWidget *pBrowserPositionTable; - GtkWidget *pRCUPositionTable; - GtkWidget *pColorButtonTable; - GtkWidget *pRedButton; - GtkWidget *pGreenButton; - GtkWidget *pYellowButton; - GtkWidget *pBlueButton; - GtkWidget *pArrowButtonTable; - GtkWidget *pUpButton; - GtkWidget *pDownButton; - GtkWidget *pLeftButton; - GtkWidget *pRightButton; - GtkWidget *pUpArrow; - GtkWidget *pDownArrow; - GtkWidget *pLeftArrow; - GtkWidget *pRightArrow; - GtkWidget *pEnterButton; - GtkWidget *pBackButton; - GtkWidget *pEntry; - GtkWidget *pNumPadTable; - GtkWidget *pNumber[10]; - GtkWidget *pPlayButton; - GtkWidget *pStopButton; - GtkWidget *pPauseButton; - GtkWidget *pPlayPauseButton; - GtkWidget *pFastMoveTable; - GtkWidget *pFastForwardButton; - GtkWidget *pFastRewindButton; - GtkWidget *pLangButton; - GtkWidget *pExitButton; - GtkWidget *pOnOffButton; - GtkWidget *pTeletextButton; - GtkWidget *pProgramSelectionTable; - GtkWidget *pPreviousProgramButton; - GtkWidget *pNextProgramButton; - GtkWidget *pQuitButton; - GtkWidget *pTestButton; - GtkWidget *pTest2Button; - GtkWidget *pGoButton; - GtkWidget *pWebScrollWindow; - GtkWidget *pBackgroundWindow; - - GdkColor color; - int Error,posx,posy; - - TRACEINFO; - - sGraphicInterface* ui = player_interf->ui; - - /** Main window **/ - pBackgroundWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); - pTVWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); - pWebWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); - pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); - - ui->pMainWindow = pWindow; - ui->pTVWindow = pTVWindow; - ui->pWebWindow = pWebWindow; - ui->pBackgroundWindow = pBackgroundWindow; - - gtk_window_set_title(GTK_WINDOW(pWindow), "RCU"); - gtk_window_set_title(GTK_WINDOW(pTVWindow), "TV"); - gtk_window_set_title(GTK_WINDOW(pWebWindow), "WEB"); - gtk_window_set_title(GTK_WINDOW(pBackgroundWindow), "BACK"); - - gtk_window_set_decorated(GTK_WINDOW(pWebWindow), false); - gtk_window_set_decorated(GTK_WINDOW(pTVWindow), false); - gtk_window_set_decorated(GTK_WINDOW(pBackgroundWindow), false); - gtk_window_set_transient_for(GTK_WINDOW(pTVWindow),GTK_WINDOW(pBackgroundWindow)); - gtk_window_set_transient_for(GTK_WINDOW(pWebWindow),GTK_WINDOW(pTVWindow)); - - gtk_window_set_resizable(GTK_WINDOW(pTVWindow), false); - gtk_window_set_resizable(GTK_WINDOW(pWebWindow), false); - gtk_window_set_resizable(GTK_WINDOW(pBackgroundWindow), false); - - /** Quit button **/ - pQuitButton = gtk_button_new_with_label("Quit"); - - /** Tests button **/ - pTestButton = gtk_button_new_with_label("Test"); - pTest2Button = gtk_button_new_with_label("Test2"); - - /** Entry bar for URL **/ - pEntry = gtk_entry_new(); - ui->pEntry = pEntry; - - /** GO Button **/ - pGoButton = gtk_button_new_with_label("Go"); - - /** Browser Zone **/ - pWebScrollWindow = gtk_scrolled_window_new(NULL, NULL); - //gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(pWebScrollWindow), GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS); - - ui->pWebView = WEBKIT_WEB_VIEW(webkit_web_view_new()); - - webkit_web_view_set_transparent(ui->pWebView, TRUE); - - if (ui->pWebView) - gtk_container_add(GTK_CONTAINER(pWebScrollWindow), GTK_WIDGET(ui->pWebView)); - - /** Background Zone **/ - ui->pBackgroundView = gtk_drawing_area_new(); - gdk_color_parse("#000044", &color); - gtk_widget_modify_bg ( GTK_WIDGET(ui->pBackgroundView), GTK_STATE_NORMAL, &color); - - /** TV zone **/ - ui->pTVView = gtk_drawing_area_new(); - - /** RCU zone **/ - - /* create Red color */ - gdk_color_parse("#FF0000", &color); - pRedButton = gtk_button_new(); - gtk_widget_modify_bg ( GTK_WIDGET(pRedButton), GTK_STATE_NORMAL, &color); - gtk_button_set_label(GTK_BUTTON(pRedButton)," "); - /* create Green color */ - gdk_color_parse("#00FF00", &color); - pGreenButton = gtk_button_new(); - gtk_widget_modify_bg ( GTK_WIDGET(pGreenButton), GTK_STATE_NORMAL, &color); - gtk_button_set_label(GTK_BUTTON(pGreenButton)," "); - /* create Yellow color */ - gdk_color_parse("#FFFF00", &color); - pYellowButton = gtk_button_new(); - gtk_widget_modify_bg ( GTK_WIDGET(pYellowButton), GTK_STATE_NORMAL, &color); - gtk_button_set_label(GTK_BUTTON(pYellowButton)," "); - /* create Blue color */ - gdk_color_parse("#0000FF", &color); - pBlueButton = gtk_button_new(); - gtk_widget_modify_bg ( GTK_WIDGET(pBlueButton), GTK_STATE_NORMAL, &color); - gtk_button_set_label(GTK_BUTTON(pBlueButton)," "); - - pUpButton = gtk_button_new(); - pDownButton = gtk_button_new(); - pLeftButton = gtk_button_new(); - pRightButton = gtk_button_new(); - - pUpArrow = gtk_arrow_new(GTK_ARROW_UP,GTK_SHADOW_OUT); - pDownArrow = gtk_arrow_new(GTK_ARROW_DOWN,GTK_SHADOW_OUT); - pLeftArrow = gtk_arrow_new(GTK_ARROW_LEFT,GTK_SHADOW_OUT); - pRightArrow = gtk_arrow_new(GTK_ARROW_RIGHT,GTK_SHADOW_OUT); - - gtk_container_add(GTK_CONTAINER(pUpButton), pUpArrow); - gtk_container_add(GTK_CONTAINER(pDownButton), pDownArrow); - gtk_container_add(GTK_CONTAINER(pLeftButton), pLeftArrow); - gtk_container_add(GTK_CONTAINER(pRightButton), pRightArrow); - - pEnterButton = gtk_button_new_with_label("Enter"); - pBackButton = gtk_button_new_with_label("Back"); - - pNumber[0] = gtk_button_new_with_label("0"); - pNumber[1] = gtk_button_new_with_label("1"); - pNumber[2] = gtk_button_new_with_label("2"); - pNumber[3] = gtk_button_new_with_label("3"); - pNumber[4] = gtk_button_new_with_label("4"); - pNumber[5] = gtk_button_new_with_label("5"); - pNumber[6] = gtk_button_new_with_label("6"); - pNumber[7] = gtk_button_new_with_label("7"); - pNumber[8] = gtk_button_new_with_label("8"); - pNumber[9] = gtk_button_new_with_label("9"); - - pPreviousProgramButton = gtk_button_new_with_label("P-"); - pNextProgramButton = gtk_button_new_with_label("P+"); - - pPlayButton = gtk_button_new_with_label("Play"); - pStopButton = gtk_button_new_with_label("Stop"); - pPauseButton = gtk_button_new_with_label("Pause"); - pPlayPauseButton = gtk_button_new_with_label("PlayPause"); - - pFastForwardButton = gtk_button_new_with_label(">>"); - pFastRewindButton = gtk_button_new_with_label("<<"); - pTeletextButton = gtk_button_new_with_label("Teletext"); - pLangButton = gtk_button_new_with_label("Language"); - pExitButton = gtk_button_new_with_label("Exit"); - pOnOffButton = gtk_button_new_with_label("OnOff"); - - pColorButtonTable = gtk_table_new(4,1,false); - gtk_table_attach(GTK_TABLE(pColorButtonTable),pRedButton, 0,1,0,1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - gtk_table_attach(GTK_TABLE(pColorButtonTable),pGreenButton, 0,1,1,2, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - gtk_table_attach(GTK_TABLE(pColorButtonTable),pYellowButton, 0,1,2,3, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - gtk_table_attach(GTK_TABLE(pColorButtonTable),pBlueButton, 0,1,3,4, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - - pArrowButtonTable = gtk_table_new(3,3, false); - gtk_table_attach(GTK_TABLE(pArrowButtonTable), pUpButton, 1,2,0,1,GtkAttachOptions(GTK_FILL|GTK_EXPAND), GtkAttachOptions(GTK_FILL|GTK_EXPAND), 0,0 ); - gtk_table_attach(GTK_TABLE(pArrowButtonTable), pDownButton, 1,2,2,3,GtkAttachOptions(GTK_FILL|GTK_EXPAND), GtkAttachOptions(GTK_FILL|GTK_EXPAND), 0,0 ); - gtk_table_attach(GTK_TABLE(pArrowButtonTable), pLeftButton, 0,1,1,2,GtkAttachOptions(GTK_FILL|GTK_EXPAND), GtkAttachOptions(GTK_FILL|GTK_EXPAND), 0,0 ); - gtk_table_attach(GTK_TABLE(pArrowButtonTable), pRightButton, 2,3,1,2,GtkAttachOptions(GTK_FILL|GTK_EXPAND), GtkAttachOptions(GTK_FILL|GTK_EXPAND), 0,0 ); - - pNumPadTable = gtk_table_new(4,3,false); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[0], 1, 2, 3, 4, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[1], 0, 1, 0, 1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[2], 1, 2, 0, 1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[3], 2, 3, 0, 1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[4], 0, 1, 1, 2, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[5], 1, 2, 1, 2, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[6], 2, 3, 1, 2, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[7], 0, 1, 2, 3, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[8], 1, 2, 2, 3, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pNumPadTable), pNumber[9], 2, 3, 2, 3, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - - pFastMoveTable = gtk_table_new(1,2,false); - gtk_table_attach(GTK_TABLE(pFastMoveTable), pFastRewindButton, 0,1,0,1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - gtk_table_attach(GTK_TABLE(pFastMoveTable), pFastForwardButton, 1,2,0,1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - - pProgramSelectionTable = gtk_table_new(1,2, false); - gtk_table_attach(GTK_TABLE(pProgramSelectionTable), pPreviousProgramButton, 0,1,0,1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - gtk_table_attach(GTK_TABLE(pProgramSelectionTable), pNextProgramButton, 1,2,0,1, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL),0,0); - - /** create the toplevel tables **/ - pRCUPositionTable = gtk_table_new(24,1,false); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pColorButtonTable, 0, 1, 0, 4, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pArrowButtonTable, 0, 1, 4, 7, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pEnterButton, 0, 1, 7, 8, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pBackButton, 0, 1, 8, 9, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pNumPadTable, 0, 1, 9, 13, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pPlayButton, 0, 1, 13, 14, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pStopButton, 0, 1, 14, 15, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pPauseButton, 0, 1, 15, 16, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pPlayPauseButton, 0, 1, 16, 17, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pFastMoveTable, 0, 1, 17, 18, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pProgramSelectionTable, 0, 1, 18, 19, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pTeletextButton, 0, 1, 19, 20, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pLangButton, 0, 1, 20, 21, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pExitButton, 0, 1, 21, 22, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pOnOffButton, 0, 1, 22, 23, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - gtk_table_attach(GTK_TABLE(pRCUPositionTable), pQuitButton, 0, 1, 23, 24, GtkAttachOptions(GTK_FILL|GTK_EXPAND),GtkAttachOptions(GTK_FILL|GTK_EXPAND),0,0); - - pBrowserPositionTable = gtk_table_new(3,3,false); - //gtk_table_attach(GTK_TABLE(pBrowserPositionTable), pEntry, 0, 2, 0, 1, GtkAttachOptions(GTK_EXPAND | GTK_FILL), GTK_FILL, 0,0); - //gtk_table_attach(GTK_TABLE(pBrowserPositionTable), pGoButton, 2, 3, 0, 1, GtkAttachOptions(GTK_EXPAND | GTK_FILL), GTK_FILL, 0,0); - gtk_table_attach(GTK_TABLE(pBrowserPositionTable), pWebScrollWindow, 0, 3, 1, 3, GtkAttachOptions(GTK_EXPAND | GTK_FILL), GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0,0); - - /** Group toplevel tables in the main table **/ - pMainPositionTable = gtk_table_new(4,7,false); - gtk_table_attach(GTK_TABLE(pMainPositionTable), pRCUPositionTable, 6, 7, 0, 3, GtkAttachOptions(NULL), GtkAttachOptions(NULL), 0,0); - //gtk_table_attach(GTK_TABLE(pMainPositionTable), pBottomBarTable, 0, 7, 3, 4, GtkAttachOptions(GTK_EXPAND | GTK_FILL), GtkAttachOptions(GTK_EXPAND | GTK_FILL), 0,0); - - gtk_container_add(GTK_CONTAINER(pWindow), pMainPositionTable); - gtk_container_add(GTK_CONTAINER(pTVWindow), ui->pTVView); - gtk_container_add(GTK_CONTAINER(pBackgroundWindow), ui->pBackgroundView); - //~ gtk_container_add(GTK_CONTAINER(pWebWindow), ui->pWebView); - gtk_container_add(GTK_CONTAINER(pWebWindow), pBrowserPositionTable); - - /** SET SIZE **/ - gtk_widget_set_size_request(GTK_WIDGET(ui->pTVView), HBBTV_VIDEO_WIDTH,HBBTV_VIDEO_HEIGHT); - gtk_widget_set_size_request(GTK_WIDGET(ui->pBackgroundView), HBBTV_VIDEO_WIDTH,HBBTV_VIDEO_HEIGHT); - gtk_widget_set_size_request(GTK_WIDGET(pBrowserPositionTable), HBBTV_VIDEO_WIDTH,HBBTV_VIDEO_HEIGHT); - - gtk_window_set_position(GTK_WINDOW(pWebWindow), GTK_WIN_POS_CENTER_ALWAYS); - gtk_window_set_position(GTK_WINDOW(pBackgroundWindow), GTK_WIN_POS_CENTER_ALWAYS); - gtk_window_set_position(GTK_WINDOW(pTVWindow), GTK_WIN_POS_CENTER_ALWAYS); - - /** Connect Callback **/ - //** expose drawable - - // connect to deleteevent function - g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(on_deleteevent), NULL); - - // connect to destroy function - g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(on_destroyevent), NULL); - g_signal_connect(G_OBJECT(pWebWindow), "destroy", G_CALLBACK(on_destroyevent), NULL); - g_signal_connect(G_OBJECT(pQuitButton), "clicked", G_CALLBACK(on_destroyevent), NULL); - - //connect button and entry - /* Control */ - g_signal_connect (G_OBJECT(pEntry), "activate", G_CALLBACK (activate_uri_entry_cb), ui); - g_signal_connect (G_OBJECT(pGoButton), "clicked", G_CALLBACK (activate_uri_entry_cb), ui); - g_signal_connect (G_OBJECT(pOnOffButton), "clicked", G_CALLBACK (on_onoffbuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pPlayPauseButton), "clicked", G_CALLBACK (on_playpausebuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pPlayButton), "clicked", G_CALLBACK (on_playbuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pPauseButton), "clicked", G_CALLBACK (on_pausebuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pLangButton), "clicked", G_CALLBACK (on_langbuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pNextProgramButton), "clicked", G_CALLBACK (on_chanupbuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pPreviousProgramButton), "clicked", G_CALLBACK (on_chandownbuttonclicked), player_interf ); - g_signal_connect (G_OBJECT(pNumber[1]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[2]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[3]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[4]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[5]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[6]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[7]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[8]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[9]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pNumber[0]), "clicked", G_CALLBACK (on_channelbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pTeletextButton), "clicked", G_CALLBACK (on_teletextbuttonclicked), player_interf); - - - /* HBBTV Button */ - g_signal_connect (G_OBJECT(pRedButton), "clicked", G_CALLBACK (on_redbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pGreenButton), "clicked", G_CALLBACK (on_greenbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pYellowButton), "clicked", G_CALLBACK (on_yellowbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pBlueButton), "clicked", G_CALLBACK (on_bluebuttonclicked), player_interf); - - /* Navigation */ - g_signal_connect (G_OBJECT(pUpButton), "clicked", G_CALLBACK (on_upbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pDownButton), "clicked", G_CALLBACK (on_downbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pLeftButton), "clicked", G_CALLBACK (on_leftbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pRightButton), "clicked", G_CALLBACK (on_rightbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pEnterButton), "clicked", G_CALLBACK (on_returnbuttonclicked), player_interf); - g_signal_connect (G_OBJECT(pExitButton), "clicked", G_CALLBACK (on_exitbuttonclicked), player_interf); - - - // gtk_widget_add_events(GTK_WIDGET(pWebWindow), GDK_CONFIGURE); - // g_signal_connect(G_OBJECT(pTVWindow), "configure-event", G_CALLBACK(on_windowconfigure), pBackgroundWindow); - // g_signal_connect(G_OBJECT(pWebWindow), "configure-event", G_CALLBACK(on_windowconfigure), player_interf); - - /** realisation, map and show **/ - gtk_widget_realize(ui->pBackgroundView); - gtk_widget_realize(ui->pTVView); - - Error = init_gpac(player_interf); - if(Error){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Error during gpac intialization \n")); - return GF_IO_ERR; - } - - GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(ui->pWebView)); - GdkColormap *rgba = gdk_screen_get_rgba_colormap (screen); - - gtk_widget_set_colormap(GTK_WIDGET(ui->pWebView), rgba); - gtk_widget_set_colormap(GTK_WIDGET(pBrowserPositionTable), rgba); - - /** center the windows **/ - - gtk_widget_set_default_colormap(rgba); - gtk_widget_show_all(pWindow); - gtk_widget_show_all(pBackgroundWindow); - gtk_widget_show_all(pTVWindow); - gtk_widget_show_all(pWebWindow); - gtk_window_present (GTK_WINDOW(pWebWindow)); - - return GF_OK; -} - - -int init_playerinterface(sPlayerInterface* player_interf, char* input_data, char* url, Bool no_url) -{ - - HbbtvDemuxer *hbbtv_demuxer; - int Error; - int ChannelScanTimer; - u32 i,nb_chan; - - hbbtv_demuxer = ( HbbtvDemuxer *)player_interf->Demuxer; - ChannelScanTimer = 0; - - player_interf->ui = (sGraphicInterface*) gf_calloc(1,sizeof(sGraphicInterface)); - - - player_interf->input_data = (char*)gf_calloc(strlen(input_data)+1,sizeof(char)); - sprintf(player_interf->input_data,"%s",input_data); - player_interf->input_data[strlen(input_data)] = 0; - - player_interf->url = url; - player_interf->no_url = no_url; - player_interf->TVwake = FALSE; - player_interf->is_connected = is_connected(); - GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("player_interf->is_connected %d\n",player_interf->is_connected)); - - - Error = ui_init(player_interf); - if(Error){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Initialization error \n")); - return GF_IO_ERR; - } - - if(player_interf->url) { - init_browser(player_interf); - } - - while(!hbbtv_demuxer->Check_all_channel_info_received(ChannelScanTimer)) { - ChannelScanTimer++; - gf_sleep(1000); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Wainting for the PMTs \n")); - } - - hbbtvterm_scan_channel(player_interf); - - /* The check for init is made inside this function. AIT received have to be processed before getting new ones */ - - nb_chan = gf_list_count(hbbtv_demuxer->Get_ChannelList()); - - for(i=0;iGet_ChannelList(),i); - Get_application_for_channel(hbbtv_demuxer,chan->Get_service_id()); - } - player_interf->init = 1; - - put_app_url(player_interf); - - - - return GF_OK; - -} - - -int init_gpac(sPlayerInterface* player_interf) -{ - TRACEINFO; - char config_path[GF_MAX_PATH]; - const char *str; - const char *gpac_cfg; - sGraphicInterface *ui = player_interf->ui; - - -#ifdef XP_UNIX - gpac_cfg = (char *) ".gpacrc"; - strcpy((char *) config_path, getenv("HOME")); -#else - gpac_cfg = "GPAC.cfg"; - strcpy((char*)config_path,"D:\\code\\trunk\\gpac_public\\bin\\win32\\debug"); -#endif - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Configuration path : %s/%s \n",config_path,gpac_cfg)); - - player_interf->m_user = (GF_User*)gf_malloc(sizeof(GF_User)); - memset(player_interf->m_user, 0, sizeof(GF_User)); - //~ player_interf->m_user->config = gf_cfg_new((const char *) config_path, gpac_cfg); - - /*init config and modules*/ - player_interf->m_user->config = check_config_file(); - if(!player_interf->m_user->config){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Configuration failed. COnfiguration file not found \n")); - return GF_BAD_PARAM; - } - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Configuration initialized \n")); - - str = gf_cfg_get_key( player_interf->m_user->config, "General", "ModulesDirectory"); - player_interf->m_user->modules = gf_modules_new(str, player_interf->m_user->config); - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] %d modules loaded \n",gf_modules_get_count( player_interf->m_user->modules))); - - player_interf->m_user->opaque = player_interf->Demuxer; - player_interf->m_user->EventProc = On_hbbtv_received_section; - -#ifdef XP_UNIX - player_interf->m_user->os_window_handler = (void*)GDK_WINDOW_XID(gtk_widget_get_window(ui->pTVView)); - player_interf->m_user->os_display = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(ui->pTVView)); - XSynchronize((Display *) player_interf->m_user->os_display, True); -#else - player_interf->m_user->os_window_handler = (void*)GDK_WINDOW_HWND(gtk_widget_get_window(ui->pTVView)); - player_interf->m_user->os_display = gdk_drawable_get_display (gtk_widget_get_window(ui->pTVView)); - gdk_display_sync((GdkDisplay *)player_interf->m_user->os_display); -#endif - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] User initialized \n")); - - if (( player_interf->m_term = gf_term_new(player_interf->m_user))) { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Terminal created.\n")); - } - else { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Error when creating terminal\n")); - return GF_IO_ERR; - } - - gf_term_set_size( player_interf->m_term, HBBTV_VIDEO_WIDTH,HBBTV_VIDEO_HEIGHT); - - - if (strnicmp(player_interf->input_data, "udp://", 6) - && strnicmp(player_interf->input_data, "mpegts-udp://", 13) - && strnicmp(player_interf->input_data, "mpegts-tcp://", 13) - && strnicmp(player_interf->input_data, "dvb://", 6) - && strnicmp(player_interf->input_data, "http://", 6)) { - - FILE *test = fopen(player_interf->input_data, "rb"); - if (!test) { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] %s file cannot be oppened \n",player_interf->input_data)); - return GF_BAD_PARAM; - } - else { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] %s file oppened successfully \n", player_interf->input_data)); - fclose(test); - } - - } - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Input URL : %s\n", player_interf->input_data)); - gf_term_connect( player_interf->m_term, (const char*)player_interf->input_data ); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Terminal connected\n")); - - return GF_OK; -} - - -int stop_gpac(sPlayerInterface* player_interf) -{ - TRACEINFO; - gf_term_disconnect( player_interf->m_term); - gf_term_del( player_interf->m_term); - gf_modules_del( player_interf->m_user->modules); - gf_cfg_del( player_interf->m_user->config); - - return TRUE; -} - - -static void activate_uri_entry_cb (GtkWidget* entry, gpointer data) -{ - TRACEINFO; - sGraphicInterface *pUI; - - pUI = (sGraphicInterface*)data; - const gchar* uri = gtk_entry_get_text (GTK_ENTRY(pUI->pEntry)); - g_assert (uri); - webkit_web_view_load_uri (pUI->pWebView, uri); -} - -int term_play(sPlayerInterface* player_interf) -{ - gf_term_set_option(player_interf->m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING); - return 1; -} - - -int term_pause(sPlayerInterface* player_interf) -{ - gf_term_set_option(player_interf->m_term, GF_OPT_PLAY_STATE, GF_STATE_PAUSED); - return 1; -} - - -int init_browser(sPlayerInterface* player_interf) -{ - if(!player_interf->no_url) { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Initialized the browser with HBBTV Application URL : %s \n",player_interf->url)); - webkit_web_view_load_uri(player_interf->ui->pWebView, player_interf->url); - return GF_OK; - } - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] URL blocked by the user. No Application to play \n")); - return GF_OK; -} - - -int init_player(sPlayerInterface* player_interf) -{ - /* Init the player with the fisrt channel of the stream */ - - HbbtvDemuxer* hbbtvdemuxer = (HbbtvDemuxer*)player_interf->Demuxer; - Channel* chan = (Channel*)gf_list_get(hbbtvdemuxer->Get_ChannelList(),0); - hbbtvterm_get_channel_on_air(player_interf,chan->Get_service_id(),0); - - return GF_OK; -} - -GF_Err get_app_url(sPlayerInterface* player_interf, GF_M2TS_CHANNEL_APPLICATION_INFO*ChannelApp) -{ - u32 current_service_id; - - current_service_id = player_interf->m_term->root_scene->selected_service_id; - - if(!ChannelApp){ - return GF_IO_ERR; - } - - if((ChannelApp->service_id == current_service_id)) { - GF_M2TS_AIT_APPLICATION* app_info; - Channel* Chan; - - HbbtvDemuxer* hbbtvdemuxer = (HbbtvDemuxer*)player_interf->Demuxer; - Chan = (Channel*)ZapChannel(hbbtvdemuxer,current_service_id,0); - - app_info = Chan->App_to_play(player_interf->is_connected,0); - - if(!app_info){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] This service id %d does not have an autostart application. \n",ChannelApp->service_id,current_service_id)); - return GF_IO_ERR; - } - - if(player_interf->init){ - if(app_info->broadband){ - player_interf->url = app_info->http_url; - }else if(app_info->broadcast){ - player_interf->url = app_info->carousel_url; - } - webkit_web_view_load_uri(player_interf->ui->pWebView, player_interf->url); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] HBBTV Application URL : %s \n",player_interf->url)); - return GF_OK; - } - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Cannot start the application until player initialization is finished \n")); - return GF_IO_ERR; - } - GF_LOG(GF_LOG_DEBUG, GF_LOG_MODULE, ("ChannelApp->service_id %d is wrong current_service_id %d !!\n",ChannelApp->service_id,current_service_id)); - return GF_IO_ERR; - - -} - -int put_app_url(sPlayerInterface* player_interf) -{ - u32 current_service_id; - Bool ignore_TS_url; - GF_Err e; - HbbtvDemuxer* hbbtvdemux = (HbbtvDemuxer*)player_interf->Demuxer; - - ignore_TS_url = hbbtvdemux->Get_Ignore_TS_URL(); - e = GF_OK; - - if(!ignore_TS_url && !player_interf->no_url){ - - current_service_id = player_interf->m_term->root_scene->selected_service_id; - Channel* chan = (Channel*)ZapChannel(hbbtvdemux,current_service_id,0); - e = get_app_url(player_interf,chan->Get_App_info()); - if(e == GF_OK) { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Application started\n")); - return GF_OK; - } - player_interf->url = ""; - webkit_web_view_load_uri(player_interf->ui->pWebView, player_interf->url); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal]No Application found for this service ID %d \n",current_service_id)); - return GF_IO_ERR; - - }else{ - - if(!player_interf->no_url){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Forced URL %s Reaload Application \n",player_interf->url)); - webkit_web_view_load_uri(player_interf->ui->pWebView, player_interf->url); - }else{ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] URL blocked by the user. \n")); - } - return GF_OK; - } -} - - -int hbbtvterm_scan_channel(sPlayerInterface* player_interf) -{ - - GF_MediaInfo odi; - u32 i, count; - - HbbtvDemuxer* HbbtvDemux = (HbbtvDemuxer*)player_interf->Demuxer; - - GF_ObjectManager *root_odm = gf_term_get_root_object(player_interf->m_term); - if (!root_odm){ - return GF_IO_ERR; - } - - if (gf_term_get_object_info(player_interf->m_term, root_odm, &odi) != GF_OK) return GF_IO_ERR; - if (!odi.od) { - return GF_IO_ERR; - } - count = gf_term_get_object_count(player_interf->m_term, root_odm); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Count: %d \n",count)); - - for (i=0; im_term, root_odm, i); - if (!odm) break; - if (gf_term_get_object_info(player_interf->m_term, odm, &odi) == GF_OK) { - u32 service_id = odi.od->ServiceID; - Channel* chan = (Channel*)ZapChannel(HbbtvDemux,service_id,0); - - if (odi.od_type==GF_STREAM_VISUAL && !chan->Get_processed()) { - chan->Add_video_ID(i); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Service: %d chan->video_index : %d \n",service_id,chan->Get_video_ID())); - }else if(odi.od_type==GF_STREAM_AUDIO && !chan->Get_processed()) { - chan->Add_audio_ID(i); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal]Service:%d chan->current_audio_index : %d \n",service_id,chan->Get_audio_ID(0)));; - } - - } - } - HbbtvDemux->Channel_check(); - - return GF_OK; - -} - - -int hbbtvterm_channel_zap(sPlayerInterface* player_interf,int up_down) -{ - - u32 current_service_id; - - current_service_id = gf_term_get_current_service_id(player_interf->m_term); - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Current_service_id : %d \n",current_service_id)); - hbbtvterm_get_channel_on_air(player_interf,current_service_id,up_down); - - return GF_OK; - -} - - -int hbbtvterm_get_channel_on_air(sPlayerInterface* player_interf, u32 service_id, int zap) -{ - - GF_MediaInfo odi; - - HbbtvDemuxer* hbbtvdemuxer = (HbbtvDemuxer*)player_interf->Demuxer; - Channel* chan = (Channel*)ZapChannel(hbbtvdemuxer,service_id,zap); - GF_ObjectManager *root_odm = gf_term_get_root_object(player_interf->m_term); - if (!root_odm) return GF_IO_ERR; - - if (gf_term_get_object_info(player_interf->m_term, root_odm, &odi) != GF_OK) return GF_IO_ERR; - if (!odi.od) { - return GF_IO_ERR; - } - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal]service_id:%d video pid : %d audio pid:%d\n",chan->Get_service_id(),chan->Get_video_ID(),chan->Get_audio_ID(0))); - - gf_term_select_object(player_interf->m_term, gf_term_get_object(player_interf->m_term, root_odm, chan->Get_video_ID())); - gf_term_select_object(player_interf->m_term, gf_term_get_object(player_interf->m_term, root_odm, chan->Get_audio_ID(0))); - - put_app_url(player_interf); - - return GF_OK; - -} - -/** On Windows Functions **/ - -void resizevideoplayer(sPlayerInterface* player_interf, int width, int height) -{ - TRACEINFO; - gf_term_set_size(player_interf->m_term,width,height); - gtk_widget_set_size_request(GTK_WIDGET(player_interf->ui->pTVWindow),width,height); - -} - -void get_window_position(GtkWidget* Widget, int* x, int* y) -{ - //TRACEINFO; - gtk_window_get_position(GTK_WINDOW(Widget), &(*x), &(*y)); -} - -void set_window_position(GtkWidget* Widget, int x, int y) -{ - //~ //TRACEINFO; - gtk_window_move(GTK_WINDOW(Widget), x, y); -} - - -void OnAPPLICATION_Show() -{ - TRACEINFO; - gtk_window_set_opacity(GTK_WINDOW(player_interf->ui->pWebWindow),1); -} - -void OnAPPLICATION_Hide() -{ - TRACEINFO; - gtk_window_set_opacity(GTK_WINDOW(player_interf->ui->pWebWindow),0); -} - - -void OnVIBRC_SetChannel(int channel_number){ - //~ hbbtvterm_get_channel_on_air(player_interf, service_id, 0); -} - -void OnKEYSET_SetValue(double param) -{ - TRACEINFO; - fprintf(stderr, "\t param transmitted : %i\n", (int)param); - - int KEYMASK_RED = 0x1; - int KEYMASK_GREEN = 0x2; - int KEYMASK_YELLOW = 0x4; - int KEYMASK_BLUE = 0x8; - int KEYMASK_NAVIGATION = 0x10; - int KEYMASK_VCR = 0x20; - int KEYMASK_SCROLL = 0x40; - int KEYMASK_INFO = 0x80; - int KEYMASK_NUMERIC = 0x100; - int KEYMASK_ALPHA = 0x200; - int KEYMASK_OTHER = 0x400; - - player_interf->keyregistered[RK_RED] = (((int)param & KEYMASK_RED)) ? true : false; - player_interf->keyregistered[RK_GREEN] = (((int)param & KEYMASK_GREEN)) ? true : false; - player_interf->keyregistered[RK_YELLOW] = (((int)param & KEYMASK_YELLOW)) ? true : false; - player_interf->keyregistered[RK_BLUE] = (((int)param & KEYMASK_BLUE)) ? true : false; - player_interf->keyregistered[RK_NAVIGATION] = (((int)param & KEYMASK_NAVIGATION)) ? true : false; - player_interf->keyregistered[RK_VCR] = (((int)param & KEYMASK_VCR)) ? true : false; - player_interf->keyregistered[RK_SCROLL] = (((int)param & KEYMASK_SCROLL)) ? true : false; - player_interf->keyregistered[RK_INFO] = (((int)param & KEYMASK_INFO)) ? true : false; - player_interf->keyregistered[RK_NUMERIC] = (((int)param & KEYMASK_NUMERIC)) ? true : false; - player_interf->keyregistered[RK_ALPHA] = (((int)param & KEYMASK_ALPHA)) ? true : false; - player_interf->keyregistered[RK_OTHER] = (((int)param & KEYMASK_OTHER)) ? true : false; -} - -void OnNoFullscreenSetWindow(int x, int y, int width, int height) -{ - TRACEINFO; - OnVIDBRC_SetFullScreen(false); -} -void OnVIDBRC_SetFullScreen(int fullscreenparam) -{ - TRACEINFO; - fprintf(stderr,"SET FULLSCREEN OnVIDBRC_SetFullScreen Param : %d\n",fullscreenparam); - - ///Getting the videobroadcast element. - WebKitDOMDocument *pDOMdoc = webkit_web_view_get_dom_document(player_interf->ui->pWebView); - WebKitDOMNodeList *objectslist = webkit_dom_document_get_elements_by_tag_name(pDOMdoc,"object"); - gulong l = webkit_dom_node_list_get_length(objectslist); - gulong i = 0; - bool videofound = false; - WebKitDOMNode* videonode; - char *videonodetype; - while ((i < l) && !videofound) - { - videonode = webkit_dom_node_list_item(objectslist,i); - videonodetype = webkit_dom_element_get_attribute(WEBKIT_DOM_ELEMENT(videonode),"type"); - if (!(strcmp(videonodetype, "video/broadcast"))) - videofound = true; - else - i++; - } - - if (!videofound) - { - fprintf(stderr,"object video broadcast not found \n"); - return; - } - else - { - fprintf(stderr,"object video broadcast found \n"); - WebKitDOMElement* videoelt = WEBKIT_DOM_ELEMENT(videonode); - - ///Getting the position of the WebView - gint posx, posy; - get_window_position(player_interf->ui->pWebWindow, &posx, &posy); - fprintf(stderr,"WebWindow Left : %d , WebWindow Top : %d \n", posx, posy); - - ///Getting the videobroadcast geometry - glong left, top; - glong eltwidth, eltheight ; - ///Setting the new size and position of the TVWindow broadcast - int newx; - int newy; - - if (fullscreenparam){ - left = 0; - top = 0; - eltwidth = HBBTV_VIDEO_WIDTH; - eltheight = HBBTV_VIDEO_HEIGHT; - get_window_position(player_interf->ui->pWebWindow, &newx, &newy); - }else{ - gtk_window_set_position(GTK_WINDOW(player_interf->ui->pTVWindow), GTK_WIN_POS_NONE); - ///Getting the top and left values of the video/broadcast element . - left = webkit_dom_element_get_offset_left(videoelt); - top = webkit_dom_element_get_offset_top(videoelt); - ///Getting the width and height values of the video/broadcast element . - eltwidth = webkit_dom_element_get_offset_width(videoelt); - eltheight = webkit_dom_element_get_offset_height(videoelt); - newx = posx + left; - newy = posy + top; - } - - fprintf(stderr,"Videoelt offset : Left : %d , Top : %d, ", left, top); - fprintf(stderr,"EltWidth : %d , EltHeight : %d \n", eltwidth, eltheight); - set_window_position(player_interf->ui->pTVWindow, newx, newy); - fprintf(stderr,"Supposed TVWindow new position : %d x %d \n", newx, newy); - resizevideoplayer(player_interf, eltwidth, eltheight); - if(fullscreenparam){ - gtk_window_set_position(GTK_WINDOW(player_interf->ui->pTVWindow), GTK_WIN_POS_CENTER_ALWAYS); - } - fprintf(stderr,"Checking position : \n "); - gint checkx, checky; - get_window_position(player_interf->ui->pTVWindow, &checkx, &checky); - fprintf(stderr,"CHECK TVWindow Left : %d , CHECK TVWindow Top : %d \n", checkx, checky); - } - -} - -void OnKEYSET_Allocate() -{ - webkit_web_view_execute_script(player_interf->ui->pWebView, - " var KeyEvent = new Object(); \ - KeyEvent.VK_RED = 403; \ - KeyEvent.VK_YELLOW = 405;\ - KeyEvent.VK_GREEN = 404;\ - KeyEvent.VK_BLUE = 406;\ - KeyEvent.VK_UP = 38;\ - KeyEvent.VK_DOWN = 40;\ - KeyEvent.VK_LEFT = 37;\ - KeyEvent.VK_RIGHT = 39;\ - KeyEvent.VK_PLAY = 415;\ - KeyEvent.VK_STOP = 413;\ - KeyEvent.VK_PAUSE = 19;\ - KeyEvent.VK_FAST_FWD = 417;\ - KeyEvent.VK_REWIND = 412;\ - KeyEvent.VK_TELETEXT = 459;\ - KeyEvent.VK_ESCAPE = 27;\ - KeyEvent.VK_ENTER = 13;\ - KeyEvent.VK_0 = 48;\ - KeyEvent.VK_1 = 49;\ - KeyEvent.VK_2 = 50;\ - KeyEvent.VK_3 = 51;\ - KeyEvent.VK_4 = 52;\ - KeyEvent.VK_5 = 53;\ - KeyEvent.VK_6 = 54;\ - KeyEvent.VK_7 = 55;\ - KeyEvent.VK_8 = 56;\ - KeyEvent.VK_9 = 57; "); -} - - -static void usage() -{ - printf("\nUsage: hbbtvterminal -input=input_data [-url=url] [-no_url]\n"); - printf("-input=input_data : input data to process (dvb://, udp://, or file)\n"); - printf("-url=url : force the player to connect to an url. Ignore the url(s) found in the input data\n"); - printf("-no_url : the player will not connect to HBBTV services \n"); - printf("-dsmcc : enable the DSMCC data carousel processing \n"); -} - - -/****************************************************************************/ -/** getargs */ -/** @author Stanislas Selle */ -/** @date 2011/06/15 */ -/** gets args from agrv and set the options into the arguments */ -/****************************************************************************/ - -static void getargs(int argc, char *argv[], char* &input_data, Bool* dsmcc, char* &url, Bool* no_url) -{ - u32 i; - - no_url = 0; - i = 0; - input_data = NULL; - url = NULL; - - for (i=1; i<(u32) argc; i++) { - char *arg = argv[i]; - if (arg[0]=='-') { - if (!strnicmp(arg, "-input=", 7)) { - input_data = arg+7; - }else if (!strnicmp(arg, "-url=", 5)) { - url = arg+5; - }else if (!strnicmp(arg, "-no_url", 7)) { - *no_url = 1; - }else if (!strnicmp(arg, "-dsmcc", 6)) { - *dsmcc = 1; - }else { - usage(); - exit(0); - } - }else { - usage(); - exit(0); - } - } - - if( !input_data && (!url || *no_url)) { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Input data is needed if no URL is given.\n")); - usage(); - exit(0); - } - if( !*dsmcc) { - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Ignoring DSMCC data !! \n")); - } - - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Starting the processing of the TS file %s \n",input_data)); - -} - -int main (int argc, char* argv[]) -{ - char* input_data; - char* url; - Bool dsmcc; - Bool no_url; - int Error; - - dsmcc = no_url = 0; - - url = input_data = NULL; - - //TRACEINFO; - gf_sys_init(1); - gf_log_set_tool_level(GF_LOG_MODULE,GF_LOG_INFO); - printf("GPAC HBBTV Terminal (c) Telecom ParisTech 2011\n"); - - getargs(argc, argv, input_data , &dsmcc, url, &no_url); - - GF_SAFEALLOC(player_interf, sPlayerInterface); - - HbbtvDemuxer* hbbtv_demuxer = new HbbtvDemuxer(input_data, url,dsmcc, no_url, player_interf); - - gtk_init(&argc, &argv); - - if (!g_thread_supported()) { - g_thread_init(NULL); - } - - Error = init_playerinterface(player_interf,input_data,url,no_url); - if(Error){ - GF_LOG(GF_LOG_INFO, GF_LOG_MODULE, ("[HBBTVTerminal] Error - Aborting the processing \n")); - return 0; - } - //~ gf_term_set_option(player_interf->m_term, GF_OPT_PLAY_STATE, GF_STATE_PLAYING); - - gtk_main(); - //free(ui); -} - diff --git a/applications/hbbtvplayer/hbbtvterminal/src/hbbtvterminal.h b/applications/hbbtvplayer/hbbtvterminal/src/hbbtvterminal.h deleted file mode 100644 index a258002..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/hbbtvterminal.h +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (c) 2010-2011 Telecom-Paristech - * All Rights Reserved - * GPAC 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; either version 2, or (at your option) - * any later version. - * - * GPAC 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; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Authors: Stanislas Selle - Jonathan Sillan - * - */ - -#ifndef __HBBTVTERMINAL__ -#define __HBBTVTERMINAL__ - -#define _WIN32_WINNT 0x0510 - -#ifdef __cplusplus -extern "C" { -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -} -#endif - -#include - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEBUG true -#define PROJECTNAME "HbbTVTerminal" -#define TRACEINFO if (DEBUG) { fprintf(stderr, " BOB \x1b[%i;3%im%s\x1b[0m : call %s\n", 1, 4, PROJECTNAME, __FUNCTION__); } -#define NOTIMPLEMENTED if (DEBUG) { printf("SEGAR %s : %s is NOT IMPLEMENTED : TODO \n", PROJECTNAME, __FUNCTION__); } - -#define TRANSPARENCE true - -#define HBBTV_VIDEO_WIDTH 1280 -#define HBBTV_VIDEO_HEIGHT 720 - -typedef struct GraphicInterface -{ - WebKitWebView *pWebView; - GtkWidget *pTVView; - GtkWidget *pBackgroundView; - GtkWidget *pMainWindow; - GtkWidget *pTVWindow; - GtkWidget *pWebWindow; - GtkWidget *pBackgroundWindow; - GtkWidget *pEntry; -} sGraphicInterface; - - -enum listHBBTVKeys{ - HBBTV_VK_ENTER = 13, - HBBTV_VK_PAUSE = 19, - HBBTV_VK_ESCAPE = 27, - HBBTV_VK_LEFT = 37, - HBBTV_VK_RIGHT = 39, - HBBTV_VK_UP = 38, - HBBTV_VK_DOWN = 40, - HBBTV_VK_0 = 48, - HBBTV_VK_1 = 49, - HBBTV_VK_2 = 50, - HBBTV_VK_3 = 51, - HBBTV_VK_4 = 52, - HBBTV_VK_5 = 53, - HBBTV_VK_6 = 54, - HBBTV_VK_7 = 55, - HBBTV_VK_8 = 56, - HBBTV_VK_9 = 57, - HBBTV_VK_RED = 403, - HBBTV_VK_YELLOW = 405, - HBBTV_VK_GREEN = 404, - HBBTV_VK_BLUE = 406, - HBBTV_VK_REWIND = 412, - HBBTV_VK_STOP = 413, - HBBTV_VK_PLAY = 415, - HBBTV_VK_FAST_FWD = 417, - HBBTV_VK_TELETEXT = 459 -}; - - -enum listRegisteredKeys { - RK_OTHER = 0, - RK_RED = 1, - RK_GREEN = 2, - RK_YELLOW = 3, - RK_BLUE = 4, - RK_NAVIGATION = 5, - RK_VCR = 6, - RK_SCROLL = 7, - RK_INFO = 8, - RK_NUMERIC = 9, - RK_ALPHA = 10 -}; - -typedef struct PlayerInterface -{ - sGraphicInterface* ui; - Bool no_url; - char* input_data; - char* url; - GF_Terminal *m_term; - GF_User *m_user; - void* Demuxer; - GF_Mutex *Get_demux_info_mutex; - int TVwake; - Bool keyregistered[11]; - Bool init; - Bool is_connected; - Bool app_in_action; - -} sPlayerInterface; - -int ui_init(sGraphicInterface *ui); - -int init_gpac(sPlayerInterface* player_interf); -int init_browser(sPlayerInterface* player_interf); -int stop_gpac(sPlayerInterface *player_interf); -int playpause(sPlayerInterface *player_interf); -int term_play(sPlayerInterface *player_interf); -int term_pause(sPlayerInterface *player_interf); -int init_player(sPlayerInterface* player_interf); - - -typedef struct -{ - GF_M2TS_AIT* ait; - - char* data; - u32 table_id; - u32 data_size; -} AIT_TO_PROCESS; - - -typedef struct -{ - GF_M2TS_DSMCC_SECTION* dsmcc_sections; - char* buff; - - /*added not in the spec*/ - u8 first_section_received; -}GF_M2TS_GATHER_DSMCC_SECTION; - -#define MAX_audio_index 16 - -class Channel -{ -public: - /* Constructor */ - Channel(u32 TSservice_ID, char* TSchannel_name); - /* Destructor */ - void Destroy_Channel(); - /* Fonctions */ - u32 Add_service_id(u32 service_id); - u32 Add_channel_name(char* chan_name); - u32 Add_video_ID(u32 video_index); - u32 Add_audio_ID(u32 current_audio_index); - u32 Add_ait_pid(u32 ait_pid); - u32 Add_pmt_pid(u32 pmt_pid); - u32 Add_App_info(GF_M2TS_CHANNEL_APPLICATION_INFO*add_ait); - void Check_Info_Done(); - void Incr_audio_index(int index); - void Set_audio_index(u32 index); - /* Getter */ - u32 Get_service_id(); - char* Get_channel_name(); - u32 Get_video_ID(); - u32 Get_audio_ID(u32 indice); - u32 Get_ait_pid(); - u32 Get_pmt_pid(); - Bool Get_processed(); - u32 Get_audio_index(); - u32 Get_nb_chan_audio_stream(); - GF_M2TS_CHANNEL_APPLICATION_INFO* Get_App_info(); - GF_M2TS_AIT_APPLICATION* App_to_play(Bool isConnected,u8 MaxPriority); - GF_M2TS_AIT_APPLICATION* Get_App(u32 application_id); - -private: - u32 service_ID; - u32 number; - char* channel_name; - u32 video_ID; - u32 audio_ID[MAX_audio_index]; - u32 AIT_PID; - u32 PMT_PID; - Bool processed; - u32 current_audio_index; - u32 nb_chan_audio_stream; - GF_M2TS_CHANNEL_APPLICATION_INFO* ChannelApp; - -}; - -class HbbtvDemuxer -{ -public: - /* Constructeur */ - HbbtvDemuxer(char *input_data, char* url, Bool dsmcc, Bool no_url,sPlayerInterface* player_interf); - - /* Destructeur */ - - /* Fonction */ - u32 HbbtvDemuxer_DemuxStart(); - Bool ait_already_received(char *data,u32 pid); - void GetAppInfoFromAit(GF_M2TS_AIT* ait); - Channel* Zap_channel(u32 service_id,int zap); - void Create_Channel(GF_M2TS_Program* pmt); - void Check_PMT_Processing(); - void Channel_check(); - u32 Check_application_priority(Channel* chan, GF_M2TS_AIT* ait); - /* Getter */ - GF_M2TS_Demuxer* Get_Ts(); - GF_List* Get_ChannelList(); - GF_List* Get_AIT_To_Process_list(); - char* Get_Input_data(); - Bool Get_if_dsmcc_process(); - GF_Thread * Get_Demux_Thread(); - GF_Mutex * Get_Demux_Mutex(); - void* Get_User(); - int Check_all_channel_info_received(int Timer); - char* Get_Force_URL(); - Bool Get_Ignore_TS_URL(); - Bool Get_ait_to_proces(); - Channel* Get_Channel(u32 service_id); - GF_Err Get_application_info(GF_M2TS_CHANNEL_APPLICATION_INFO*app_info); - /* Setter */ - void Set_Ts(GF_M2TS_Demuxer* ts); - void Set_ait_to_process(Bool on); - -private: - /* Fonction */ - - u32 GetDemuxStartFunction(); - - /* Attribut */ - GF_M2TS_Demuxer *Demuxts; - GF_List* Channels; - GF_List* Ait_To_Process; - - /* Thread for Demux */ - GF_Thread *ts_demux_thread; - /* Mutex for Demux */ - GF_Mutex *ts_demux_mutex; - - /*local file playing*/ - char *Input_data; - char *Service_URL; - char *Force_URL; - Bool process_dsmcc; - Bool Ignore_TS_URL; - Bool No_URL; - u32 nb_ait; - u32 file_size; - Bool ait_to_process; - u32 nb_prog_pmt_received; - Bool all_prog_pmt_received; - - /*callback to push AIT information when a AIT is received*/ - void (*on_ait_event)(void *player_interf, GF_M2TS_CHANNEL_APPLICATION_INFO*app_info); - /*private user data - To the PlayerInterface*/ - void *user; - -}; - - -/* Global Functions */ - -u32 On_hbbtv_received_section(void *ptr, GF_Event *event); -u32 DemuxThreadStart(HbbtvDemuxer *hbbtv_demuxer); -u32 DemuxStart(void *par); -GF_Err get_app_url(sPlayerInterface* player_interf, GF_M2TS_CHANNEL_APPLICATION_INFO*app_info); -int put_app_url(sPlayerInterface* player_interf); -u32 Get_application_for_channel(HbbtvDemuxer* hbbtv_demuxer,u32 service_id); - -int change_geometry( int width, int height); -int hbbtvterm_scan_channel(sPlayerInterface* player_interf); -Channel* ZapChannel(HbbtvDemuxer *hbbtv_demuxer,u32 service_id,int zap); -int hbbtvterm_channel_zap(sPlayerInterface* player_interf,int up_down); -int hbbtvterm_get_channel_on_air(sPlayerInterface* player_interf, u32 service_id, int zap); -void resizevideoplayer(sPlayerInterface* player_interf, int width, int height); - -void get_window_position(GtkWidget* Widget, int* x, int* y); -void set_window_position(GtkWidget* Widget, int x, int y); - -GF_Config* check_config_file(); -Bool is_connected(); - -/* HBBTV Functions */ - - -/* HBBTV Button */ -void on_redbuttonclicked(GtkWidget *widget, gpointer data); -void on_greenbuttonclicked(GtkWidget *widget, gpointer data); -void on_yellowbuttonclicked(GtkWidget *widget, gpointer data); -void on_bluebuttonclicked(GtkWidget *widget, gpointer data); - -/*Navigation */ -void on_upbuttonclicked(GtkWidget *widget, gpointer data); -void on_downbuttonclicked(GtkWidget *widget, gpointer data); -void on_leftbuttonclicked(GtkWidget *widget, gpointer data); -void on_rightbuttonclicked(GtkWidget *widget, gpointer data); -void on_returnbuttonclicked(GtkWidget *widget, gpointer data); -void on_exitbuttonclicked(GtkWidget *widget, gpointer data); -void on_2buttonclicked(GtkWidget *widget, gpointer data); - -/* Control */ -void on_onoffbuttonclicked(GtkWidget *widget, gpointer data); -void on_playpausebuttonclicked(GtkWidget *widget, gpointer data); -void on_playbuttonclicked(GtkWidget *widget, gpointer data); -void on_pausebuttonclicked(GtkWidget *widget, gpointer data); -void on_langbuttonclicked(GtkWidget *widget, gpointer data); -void on_chanupbuttonclicked(GtkWidget *widget, gpointer data); -void on_chandownbuttonclicked(GtkWidget *widget, gpointer data); -void on_channelbuttonclicked(GtkWidget *widget, gpointer data); -void on_teletextbuttonclicked(GtkWidget *widget, gpointer data); - - - -#ifdef __cplusplus -} -#endif - -#endif // __HBBTVTERMINAL__ diff --git a/applications/hbbtvplayer/hbbtvterminal/src/makefile.am b/applications/hbbtvplayer/hbbtvterminal/src/makefile.am deleted file mode 100644 index 65c35f3..0000000 --- a/applications/hbbtvplayer/hbbtvterminal/src/makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -########################################################################################### -## -## Copyright 2011 Telecom Paristech -## Author : Stanislas Selle -## -########################################################################################### - -bin_PROGRAMS = hbbtvterminal -hbbtvterminal_SOURCES = hbbtvterminal.cpp hbbtv_demux.cpp hbbtv_channel.cpp hbbtv_keycontrol.cpp hbbtv_tools.cpp hbbtvterminal.h - -SPECIALCFLAGS = -g -DXP_UNIX=1 -DMOZ_X11=1 -fPIC - -hbbtvterminal_CPPFLAGS = $(SPECIALCFLAGS) $(HBBTVBROWSERPLUGIN_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS) $(WEBKIT_CFLAGS) $(PIXMAN_CFLAGS) $(NPAPI_CFLAGS)\ - -g -DXP_UNIX -fPIC \ - -I /usr/include\ - -I /usr/include/gpac/\ - -I /usr/local/include\ - -I /usr/local/include/gpac/ - - -hbbtvterminal_LDFLAGS = $(SPECIALCFLAGS) - -hbbtvterminal_LDADD = $(GLIB_LIBS) $(GTK_LIBS) $(WEBKIT_LIBS) $(PIXMAN_LIBS) $(NPAPI_LIBS) $(MOZILLAJS_LIBS) $(HBBTVBROWSERPLUGIN_LIBS) \ - -L/usr/local/lib -lgpac - diff --git a/applications/hbbtvplayer/install.sh b/applications/hbbtvplayer/install.sh deleted file mode 100644 index a5c9883..0000000 --- a/applications/hbbtvplayer/install.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -e - -PLAYER=0 -DEPENDENCIES=0 -WEBKIT=0 -GPAC=0 - -if [ -z $1 ] ; then - echo "\nUsage: You must choose options :" - echo "\n\033[31m full - build the whole package (gpac+webkit+hbbtvplayer) Recommanded for computer without gpac \033[0m" - echo "\n\033[32m player - build the HBBTV player \033[0m" - echo "\n\033[33m webkit - download Webkit sources and install it\033[0m" - echo "\n\033[33m gpac - download gpac sources and install it\033[0m" - echo "\n\033[34m dependencies - get the dependencies needed to build the HBBTVPlayer \033[0m" - exit 1 -fi - -for i in $* ; do - if [ "$i" = "full" ] ; then - echo -e "\033[31m Usage: $0 Full Building : Activated \033[0m" - PLAYER=1 - DEPENDENCIES=1 - WEBKIT=1 - GPAC=1 - fi - - if [ "$i" = "player" ] ; then - echo -e "\033[32m Usage: $0 Player Building : Activated \033[0m" - PLAYER=1 - fi - - if [ "$i" = "dependencies" ] ; then - echo -e "\033[34m Usage: $0 Dependecies Building : Activated \033[0m" - DEPENDENCIES=1 - fi - - if [ "$i" = "webkit" ] ; then - echo -e "\033[33m Usage: $0 Webkit Building : Activated \033[0m" - WEBKIT=1 - fi - - if [ "$i" = "gpac" ] ; then - echo -e "\033[33m Usage: $0 gpac Building : Activated \033[0m" - WEBKIT=1 - fi -done - -if [ $DEPENDENCIES -eq 1 ] ; then - sudo apt-get install `cat listdependencies` -fi - -if [ $GPAC -eq 1 ] ; then - cd gpac - ./configure --use-js=no - make -j2 - sudo make install - sudo make install-lib - cd .. -fi - -if [ $WEBKIT -eq 1 ] ; then - ./WebKit/Tools/Scripts/build-webkit --gtk --with-gtk=2.0 --no-webkit2 --makeargs="-j2 install" -fi - - -if [ $PLAYER -eq 1 ] ; then - cd hbbtvbrowserplugin - ./autogen.sh - sudo make install - cd .. - - cd hbbtvterminal - ./autogen.sh - sudo make install - cd .. -fi - - diff --git a/applications/hbbtvplayer/listdependencies b/applications/hbbtvplayer/listdependencies deleted file mode 100644 index 58c74a3..0000000 --- a/applications/hbbtvplayer/listdependencies +++ /dev/null @@ -1,79 +0,0 @@ -autoconf -automake -autotools-dev -bison -build-essential -dvb-apps -flex -gail-3.0 -glib-networking -gperf -gtk-doc-tools -liba52-0.7.4-dev -libasound2-dev -libatk1.0-0 -libavcodec52 -libavcodec-dev -libavformat52 -libavformat-dev -libavutil-dev -libc6 -libcairo2 -libenchant1c2a -libenchant-dev -libfaad2 -libfaad-dev -libfontconfig1 -libfreetype6 -libfreetype6-dev -libgail18 -libgail-3-dev -libgail-dev -libgcc1 -libgdk-pixbuf2.0-0 -libgl1-mesa-dev -libglib2.0-0 -libglib2.0-dev -libgpac0.4.5 -libgstreamer0.10-0 -libgstreamer-plugins-base0.10-0 -libgtk2.0-dev -libicu44 -libjpeg62-dev -libmad0-dev -libogg-dev -libopenjpeg-dev -libpango1.0-0 -libpng12-dev -libpulse-dev -libsdl1.2debian -libsdl1.2-dev -libsoup2.4-dev -libsqlite3-dev -libssl-dev -libstdc++6 -libswscale-dev -libtheora-dev -libtool -libvorbis-dev -libwxbase2.8-dev -libwxgtk2.8-dev -libx11-6 -libxml2 -libxslt-dev -libxt6 -libxv-dev -libxvidcore-dev -linux-sound-base -subversion -wx2.8-headers -x11proto-gl-dev -x11proto-video-dev -xulrunner-2.0-dev -zlib1g-dev -libgeoclue-dev -icu-doc -libicu-dev -libgstreamer0.10-dev -libgstreamer-plugins-base0.10-dev - diff --git a/applications/hbbtvplayer/projectmanager/codeblocks/hbbtvplayer.workspace b/applications/hbbtvplayer/projectmanager/codeblocks/hbbtvplayer.workspace deleted file mode 100644 index ab6eb5a..0000000 --- a/applications/hbbtvplayer/projectmanager/codeblocks/hbbtvplayer.workspace +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -