0
@@ -1238,15 +1238,16 @@ shoes_video_mark(shoes_video *video)
0
shoes_video_free(shoes_video *video)
0
if (video->vlc != NULL)
0
libvlc_destroy(video->vlc);
0
RUBY_CRITICAL(SHOE_FREE(video));
0
shoes_video_new(VALUE klass, VALUE path, VALUE attr, VALUE parent)
0
VALUE obj = shoes_video_alloc(klass);
0
Data_Get_Struct(obj, shoes_video, video);
0
@@ -1275,7 +1276,8 @@ shoes_video_alloc(VALUE klass)
0
obj = Data_Wrap_Struct(klass, shoes_video_mark, shoes_video_free, video);
0
libvlc_exception_init(&video->excp);
0
- video->vlc = libvlc_new(ppsz_argc, ppsz_argv, NULL);
0
+ if (SHOES_VLC(video) == NULL)
0
+ SHOES_VLC(video) = libvlc_new(ppsz_argc, ppsz_argv, NULL);
0
@@ -1328,14 +1330,27 @@ shoes_video_draw(VALUE self, VALUE c, VALUE actual)
0
int play_id = libvlc_playlist_add(self_t->vlc,
0
RSTRING_PTR(self_t->path), NULL, &self_t->excp);
0
+ libvlc_media_t *play = libvlc_media_new(shoes_world->vlc,
0
+ RSTRING_PTR(self_t->path), &self_t->excp);
0
+ shoes_vlc_exception(&self_t->excp);
0
+ self_t->vlc = libvlc_media_player_new_from_media(play, &self_t->excp);
0
+ shoes_vlc_exception(&self_t->excp);
0
+ libvlc_media_release(play);
0
shoes_vlc_exception(&self_t->excp);
0
self_t->ref = shoes_native_surface_new(canvas, self, &self_t->place);
0
shoes_native_surface_position(self_t->ref, &self_t->place, self, canvas, &place);
0
libvlc_video_set_parent(self_t->vlc, DRAWABLE(self_t->ref), &self_t->excp);
0
+ libvlc_media_player_set_drawable(self_t->vlc, DRAWABLE(self_t->ref), &self_t->excp);
0
shoes_vlc_exception(&self_t->excp);
0
@@ -1354,7 +1369,11 @@ shoes_video_draw(VALUE self, VALUE c, VALUE actual)
0
if (RTEST(ATTR(self_t->attr, autoplay)))
0
INFO("Starting playlist.\n");
0
libvlc_playlist_play(self_t->vlc, 0, 0, NULL, &self_t->excp);
0
+ libvlc_media_player_play(self_t->vlc, &self_t->excp);
0
shoes_vlc_exception(&self_t->excp);
0
@@ -1377,9 +1396,15 @@ shoes_video_is_playing(VALUE self)
0
GET_STRUCT(video, self_t);
0
int isp = libvlc_playlist_isplaying(self_t->vlc, &self_t->excp);
0
shoes_vlc_exception(&self_t->excp);
0
return isp == 0 ? Qfalse : Qtrue;
0
+ libvlc_state_t s = libvlc_media_player_get_state(self_t->vlc, &self_t->excp);
0
+ shoes_vlc_exception(&self_t->excp);
0
+ return s == libvlc_Playing ? Qtrue : Qfalse;
0
@@ -1390,7 +1415,11 @@ shoes_video_play(VALUE self)
0
GET_STRUCT(video, self_t);
0
libvlc_playlist_play(self_t->vlc, 0, 0, NULL, &self_t->excp);
0
+ libvlc_media_player_play(self_t->vlc, &self_t->excp);
0
shoes_vlc_exception(&self_t->excp);
0
@@ -1403,12 +1432,13 @@ shoes_video_play(VALUE self)
0
GET_STRUCT(video, self_t); \
0
if (self_t->init == 1) \
0
-
libvlc_playlist_##x(self_t->vlc, &self_t->excp); \
0
+
shoes_libvlc_##x(self_t->vlc, &self_t->excp); \
0
shoes_vlc_exception(&self_t->excp); \
0
#define VIDEO_GET_METHOD(x, ctype, rbtype) \
0
VALUE shoes_video_get_##x(VALUE self) \
0
@@ -1439,6 +1469,32 @@ shoes_video_play(VALUE self)
0
+#define VIDEO_GET_METHOD(x, ctype, rbtype) \
0
+ VALUE shoes_video_get_##x(VALUE self) \
0
+ GET_STRUCT(video, self_t); \
0
+ if (self_t->init == 1) \
0
+ ctype len = libvlc_media_player_get_##x(self_t->vlc, &self_t->excp); \
0
+ shoes_vlc_exception(&self_t->excp); \
0
+#define VIDEO_SET_METHOD(x, rbconv) \
0
+ VALUE shoes_video_set_##x(VALUE self, VALUE val) \
0
+ GET_STRUCT(video, self_t); \
0
+ if (self_t->init == 1) \
0
+ libvlc_media_player_set_##x(self_t->vlc, rbconv(val), &self_t->excp); \
0
+ shoes_vlc_exception(&self_t->excp); \
Comments
Wow, you are replacing all the deprecated playlist functions! I was hacking on your code locally and I am so glad to see this!