Displaying 16 results from an estimated 16 matches for "swfdec_scriptable_from_object".
2007 Mar 22
0
7 commits - configure.ac doc/swfdec-docs.sgml libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_js_movie.c test/trace
...--git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c
index 2d9b1a1..3f6333c 100644
--- a/libswfdec/swfdec_js_movie.c
+++ b/libswfdec/swfdec_js_movie.c
@@ -116,7 +116,11 @@ mc_play (JSContext *cx, JSObject *obj, u
{
SwfdecMovie *movie;
- movie = JS_GetPrivate(cx, obj);
+ movie = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_MOVIE);
+ if (movie == NULL) {
+ SWFDEC_WARNING ("not a movie");
+ return JS_TRUE;
+ }
g_assert (movie);
movie->stopped = FALSE;
@@ -128,8 +132,11 @@ mc_stop (JSContext *cx, JSObject *obj, u
{
SwfdecMovie *movie;
- movie = JS_GetPrivate(cx,...
2007 Jun 21
0
Branch 'as' - 5 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_movie.c libswfdec/swfdec_net_connection.c libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_net_stream.c
...ot;
-#include "swfdec_debug.h"
-#include "swfdec_js.h"
-#include "swfdec_player_internal.h"
-
-static JSBool
-swfdec_js_net_stream_play (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
- SwfdecNetStream *stream;
- const char *url;
-
- stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
- if (stream == NULL)
- return JS_TRUE;
- url = swfdec_js_to_string (cx, argv[0]);
- if (url == NULL)
- return JS_FALSE;
- swfdec_net_stream_set_url (stream, url);
- swfdec_net_stream_set_playing (stream, TRUE);
- return JS_TRUE;
-}
-
-static JSBool
-s...
2007 Mar 01
0
7 commits - libswfdec/swfdec_connection.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h
..._js_net_stream.c
+++ b/libswfdec/swfdec_js_net_stream.c
@@ -27,6 +27,23 @@
#include "swfdec_player_internal.h"
static JSBool
+swfdec_js_net_stream_play (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+ SwfdecNetStream *stream;
+ const char *url;
+
+ stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
+ if (stream == NULL)
+ return JS_TRUE;
+ url = swfdec_js_to_string (cx, argv[0]);
+ if (url == NULL)
+ return JS_FALSE;
+ swfdec_net_stream_set_url (stream, url);
+ swfdec_net_stream_set_playing (stream, TRUE);
+ return JS_TRUE;
+}
+
+static JSBool
s...
2007 Jun 27
0
Branch 'as' - libswfdec/swfdec_as_strings.c libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_net_stream.c
...tream_as.c
@@ -74,76 +74,6 @@ swfdec_net_stream_do_seek (SwfdecAsConte
swfdec_net_stream_seek (stream, d);
}
-#if 0
-static void
-swfdec_net_stream_time (SwfdecAsContext *cx, SwfdecAsObject *obj, SwfdecAsValue id, SwfdecAsValue *vp)
-{
- SwfdecNetStream *stream;
- guint msecs;
-
- stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
- if (stream == NULL)
- return JS_TRUE;
-
- if (stream->flvdecoder == NULL ||
- !swfdec_flv_decoder_get_video_info (stream->flvdecoder, &msecs, NULL)) {
- *vp = INT_TO_JSVAL (0);
- return JS_TRUE;
- }
- if (msecs >= stream->curren...
2007 Jul 13
0
4 commits - configure.ac libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.h libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h NEWS
...NULL);
-
- if (scriptable->jsobj)
- return scriptable->jsobj;
- klass = SWFDEC_SCRIPTABLE_GET_CLASS (scriptable);
- g_return_val_if_fail (klass->create_js_object, NULL);
- scriptable->jsobj = klass->create_js_object (scriptable);
-
- return scriptable->jsobj;
-}
-
-/**
- * swfdec_scriptable_from_object:
- * @cx: a #JSContext
- * @object: the JSObject to convert (NULL is a valid value)
- * @type: type of the object to get.
- *
- * Converts the given @object to a #SwfdecScriptable, if it represents one.
- * The object must be of @type, otherwise %NULL will be returned.
- *
- * Returns: the scriptab...
2007 Mar 19
0
7 commits - libswfdec/jpeg libswfdec/swfdec_button_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_movie.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_video.c player/swfdec_debug_movies.c
...c_js_net_stream.c
+++ b/libswfdec/swfdec_js_net_stream.c
@@ -44,6 +44,28 @@ swfdec_js_net_stream_play (JSContext *cx
}
static JSBool
+swfdec_js_net_stream_pause (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+ SwfdecNetStream *stream;
+ gboolean playing;
+
+ stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
+ if (stream == NULL)
+ return JS_TRUE;
+ if (argc == 0) {
+ playing = !swfdec_net_stream_get_playing (stream);
+ } else {
+ JSBool b;
+ if (!JS_ValueToBoolean (cx, argv[0], &b))
+ return JS_FALSE;
+ playing = !b;
+ }
+ g_print ("...
2007 May 29
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_tag.c player/swfplay.c
...--git a/libswfdec/swfdec_js_xml.c b/libswfdec/swfdec_js_xml.c
index 59632b6..92da66e 100644
--- a/libswfdec/swfdec_js_xml.c
+++ b/libswfdec/swfdec_js_xml.c
@@ -32,7 +32,7 @@ swfdec_js_xml_load (JSContext *cx, JSObj
SwfdecXml *xml;
const char *url;
- xml = JS_GetPrivate (cx, obj);
+ xml = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_XML);
if (xml == NULL)
return JS_TRUE;
url = swfdec_js_to_string (cx, argv[0]);
diff --git a/player/swfplay.c b/player/swfplay.c
index 0c2e062..46737ae 100644
--- a/player/swfplay.c
+++ b/player/swfplay.c
@@ -122,6 +122,8 @@ main (int argc, char *argv[])
#else
l...
2007 Mar 20
0
5 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_net_stream.c
...net_stream_play, 1, 0, 0 },
{ "setBufferTime", swfdec_js_net_stream_set_buffer_time, 1, 0, 0 },
- {0,0,0,0,0}
+ { NULL }
+};
+
+static JSBool
+swfdec_js_net_stream_time (JSContext *cx, JSObject *obj, jsval id, jsval *vp)
+{
+ SwfdecNetStream *stream;
+ guint msecs;
+
+ stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
+ if (stream == NULL)
+ return JS_TRUE;
+
+ if (stream->flvdecoder == NULL ||
+ !swfdec_flv_decoder_get_video_info (stream->flvdecoder, &msecs, NULL)) {
+ *vp = INT_TO_JSVAL (0);
+ return JS_TRUE;
+ }
+ if (msecs >= stream->curren...
2007 Mar 02
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_audio_flv.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_js_video.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h
...quot;swfdec_js.h"
+#include "swfdec_net_stream.h"
+#include "swfdec_player_internal.h"
+
+static JSBool
+swfdec_js_video_attach_video (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+ SwfdecNetStream *stream;
+ SwfdecVideoMovie *video;
+
+ video = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_VIDEO_MOVIE);
+ if (video == NULL)
+ return JS_TRUE;
+
+ stream = swfdec_scriptable_from_jsval (cx, argv[0], SWFDEC_TYPE_NET_STREAM);
+ if (stream != NULL) {
+ swfdec_video_movie_set_input (video, &stream->input);
+ return JS_TRUE;
+ }
+ swfdec_video_movie...
2007 Mar 15
0
11 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_event.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c
..._js_video.c
+++ b/libswfdec/swfdec_js_video.c
@@ -33,7 +33,6 @@ swfdec_js_video_attach_video (JSContext
SwfdecNetStream *stream;
SwfdecVideoMovie *video;
- g_print ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
video = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_VIDEO_MOVIE);
if (video == NULL)
return JS_TRUE;
diff-tree 21c8bd56636624a5937fc1ae693ca5233a57fa04 (from 89993e6c8b33afd37db5691265da933b5b506fb9)
Author: Benjamin Otte <otte@gnome.org>
Date: Thu Mar 15 12:37:41 2007 +0100
use the init and construct queue...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.c
...ntN argc, jsval *argv, jsval *rval)
+static void
+swfdec_video_attach_video (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
{
+ SwfdecVideoMovie *video = SWFDEC_VIDEO_MOVIE (obj);
SwfdecNetStream *stream;
- SwfdecVideoMovie *video;
-
- video = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_VIDEO_MOVIE);
- if (video == NULL)
- return JS_TRUE;
- stream = swfdec_scriptable_from_jsval (cx, argv[0], SWFDEC_TYPE_NET_STREAM);
- if (stream != NULL) {
- swfdec_video_movie_set_input (video, &stream->input);
- return JS_TRUE;
+ if (!SWFDEC_AS_VALUE_IS...
2007 Mar 22
0
11 commits - libswfdec/swfdec_color.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_movie.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_net_stream.h libswfdec/swfdec_pattern.c libswfdec/swfdec_script.c NEWS test/trace
...tream.c
+++ b/libswfdec/swfdec_js_net_stream.c
@@ -80,9 +80,25 @@ swfdec_js_net_stream_set_buffer_time (JS
return JS_TRUE;
}
+static JSBool
+swfdec_js_net_stream_seek (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+ SwfdecNetStream *stream;
+ double d;
+
+ stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
+ if (stream == NULL)
+ return JS_TRUE;
+ if (!JS_ValueToNumber (cx, argv[0], &d))
+ return JS_FALSE;
+ swfdec_net_stream_seek (stream, d);
+ return JS_TRUE;
+}
+
static JSFunctionSpec net_stream_methods[] = {
{ "pause", swfdec_js_net_...
2007 Mar 07
0
11 commits - libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h libswfdec/swfdec_script.c libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h
...ptable has no handler for %s event", name);
+ return FALSE;
+ }
+ return TRUE;
+}
+
diff --git a/libswfdec/swfdec_scriptable.h b/libswfdec/swfdec_scriptable.h
index a197d8f..a53ca4a 100644
--- a/libswfdec/swfdec_scriptable.h
+++ b/libswfdec/swfdec_scriptable.h
@@ -66,6 +66,12 @@ gpointer swfdec_scriptable_from_object
void swfdec_scriptable_set_variables (SwfdecScriptable * script,
const char * variables);
+gboolean swfdec_scriptable_can_execute (SwfdecScriptable * script,
+ const char * name);
+void swfdec_scriptable_execute (SwfdecScriptable * script,
+ const char * name,
+...
2007 Mar 14
0
10 commits - libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_flv_decoder.h libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_loadertarget.c
...b/libswfdec/swfdec_js_net_stream.c
@@ -43,8 +43,24 @@ swfdec_js_net_stream_play (JSContext *cx
return JS_TRUE;
}
+static JSBool
+swfdec_js_net_stream_set_buffer_time (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+ SwfdecNetStream *stream;
+ double d;
+
+ stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM);
+ if (stream == NULL)
+ return JS_TRUE;
+ if (!JS_ValueToNumber (cx, argv[0], &d))
+ return JS_FALSE;
+ swfdec_net_stream_set_buffer_time (stream, d);
+ return JS_TRUE;
+}
+
static JSFunctionSpec net_stream_methods[] = {
- { "play", swfd...
2007 Apr 27
0
Changes to 'refs/tags/0.4.3'
...am stub
fix swfdec_scriptable_set_variables again
register the classes with the objects for NetConnection, NetStream and XML
print the class name instead of "Object" as the type
Merge branch 'master' of ssh://company@git.freedesktop.org/git/swfdec
add swfdec_scriptable_from_object
remove if 0'ed code that lay dormant since 0.3
mark properties from attached movies DontDelete and ReadOnly
implement NetStream.play ()
rework video embedding API
add Video class
fix default parser
fix how we handle FLV streams so it works with modified...
2007 Apr 27
0
Changes to 'refs/tags/0.4.4'
...am stub
fix swfdec_scriptable_set_variables again
register the classes with the objects for NetConnection, NetStream and XML
print the class name instead of "Object" as the type
Merge branch 'master' of ssh://company@git.freedesktop.org/git/swfdec
add swfdec_scriptable_from_object
remove if 0'ed code that lay dormant since 0.3
mark properties from attached movies DontDelete and ReadOnly
implement NetStream.play ()
rework video embedding API
add Video class
fix default parser
fix how we handle FLV streams so it works with modified...