Permalink
Browse files

experimental support for video window

  • Loading branch information...
1 parent 4d5ef49 commit f45f11f4d09c2bb6af741f5629a62601d67ddb1a @juzna committed Jul 11, 2011
Showing with 24 additions and 4 deletions.
  1. +18 −2 VideoWindowAPI.cpp
  2. +6 −2 VideoWindowAPI.h
View
@@ -20,19 +20,31 @@ VideoWindowAPI::VideoWindowAPI(const linphonePtr& plugin, const FB::BrowserHostP
m_plugin(plugin), m_host(host)
{
printf("VideoWindowAPI instance\n");
-
+
// Register exported methods
rmethod(test);
-
+
// Register properties
rproperty(x);
+ rpropertyg(pluginWindowId);
}
VideoWindowAPI::~VideoWindowAPI()
{
printf("deallocating VideoWindowAPI instance\n");
}
+linphonePtr VideoWindowAPI::getPlugin()
+{
+ linphonePtr plugin(m_plugin.lock());
+ if (!plugin) {
+ throw FB::script_error("The plugin is invalid");
+ }
+ return plugin;
+}
+
+
+
bool VideoWindowAPI::call_test(std::string uri) {
return true;
}
@@ -44,3 +56,7 @@ std::string VideoWindowAPI::get_x(void) {
void VideoWindowAPI::set_x(std::string x) {
_x = x;
}
+
+unsigned long VideoWindowAPI::get_pluginWindowId(void) {
+ return getPlugin()->getNativeWindowId();
+}
View
@@ -2,6 +2,7 @@
#include <sstream>
#include "JSAPIAuto.h"
#include "BrowserHostWrapper.h"
+#include "linphone.h"
#include "types.h"
#include <stdio.h>
@@ -15,18 +16,21 @@ class VideoWindowAPI : public FB::JSAPIAuto
VideoWindowAPI(const linphonePtr& plugin, const FB::BrowserHostPtr& host);
virtual ~VideoWindowAPI();
+ linphonePtr getPlugin();
+
// Exported methods
bool call_test(std::string uri);
+ unsigned long get_pluginWindowId(void);
// Property manipulation methods
std::string get_x(void);
void set_x(std::string);
-
+
private:
linphoneWeakPtr m_plugin;
FB::BrowserHostPtr m_host;
std::string _x;
-
+
};
#endif // H_VideoWindowAPI

0 comments on commit f45f11f

Please sign in to comment.