Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Video is showing but tests are not working as expected

  • Loading branch information...
commit a618f29c758dc0b4a556add0ec32f16901418007 1 parent 5c9faa9
@kthakore kthakore authored
Showing with 22 additions and 15 deletions.
  1. +7 −7 lib/SDL/SMPEG.pm
  2. +9 −3 src/SMPEG.xs
  3. +6 −5 t/smpeg.t
View
14 lib/SDL/SMPEG.pm
@@ -30,7 +30,7 @@ sub new {
bless $self, $class;
$self->audio(1);
$self->video(1);
- return $self, $info;
+ return $self;
}
sub DESTROY {
@@ -54,15 +54,15 @@ sub volume {
}
sub display {
- Carp::confess "SDL::SMPEG::SMPEG::Display requires a SDL::SMPEG::Surface\n"
- unless $_[1]->isa('SDL::SMPEG::Surface');
- SDL::SMPEG::SMPEGSetDisplay( ${ $_[0] }, ${ $_[1] }, 0 );
+ Carp::confess "SDL::SMPEG::Display requires a SDL::Surface\n"
+ unless $_[1]->isa('SDL::Surface');
+ SDL::SMPEG::SMPEGSetDisplay( ${ $_[0] }, $_[1] , 0 );
}
sub scale {
return SDL::SMPEG::SMPEGScaleXY( ${ $_[0] }, $_[1], $_[2] ) if ( @_ == 3 );
return SDL::SMPEG::SMPEGScaleXY( ${ $_[0] }, $_[1]->width(), $_[1]->height() )
- if $_[1]->isa('SDL::SMPEG::Surface');
+ if $_[1]->isa('SDL::Surface');
SDL::SMPEG::SMPEGScale( ${ $_[0] }, $_[1] );
}
@@ -95,8 +95,8 @@ sub loop {
}
sub region {
- Carp::confess "SDL::SMPEG::SMPEG::region requires a SDL::SMPEG::Rect\n"
- unless $_[1]->isa('SDL::SMPEG::Rect');
+ Carp::confess "SDL::SMPEG::region requires a SDL::Rect\n"
+ unless $_[1]->isa('SDL::Rect');
SDL::SMPEG::SMPEGDisplayRegion( ${ $_[0] }, ${ $_[1] } );
}
View
12 src/SMPEG.xs
@@ -13,6 +13,10 @@
#endif
+void smpeg_display_callback (SDL_Surface* s , int a, int b, unsigned int c, unsigned int d)
+{
+
+}
MODULE = SDL::SMPEG PACKAGE = SDL::SMPEG
PROTOTYPES : DISABLE
@@ -174,12 +178,14 @@ SMPEGSetVolume ( mpeg , volume )
SMPEG_setvolume(mpeg,volume);
void
-SMPEGSetDisplay ( mpeg, dest, surfLock )
+SMPEGSetDisplay ( mpeg, dest, callback )
SMPEG* mpeg
SDL_Surface* dest
- SDL_mutex* surfLock
+ SV* callback
CODE:
- SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
+ SDL_mutex* surfLock = SDL_CreateMutex();
+ SMPEG_setdisplay(mpeg,dest,surfLock,(void*)&smpeg_display_callback);
+ safefree(surfLock);
void
SMPEGScaleXY ( mpeg, w, h)
View
11 t/smpeg.t
@@ -6,6 +6,7 @@ BEGIN {
}
use strict;
+use SDL;
use SDL::Config;
use Test::More;
@@ -17,7 +18,7 @@ if ( SDL::Config->has('smpeg') ) {
}
use_ok('SDL::SMPEG');
-use_ok('SDL::Surface');
+use SDL::Video;
can_ok(
'SDL::SMPEG', qw/
@@ -79,12 +80,12 @@ SCOPE: {
# TODO: I'm not entirely sure this is meant to be zero
is( $mpeg->fps, 0, '->fps ok' );
- # Create a surface to attach the movie to
- my $surface = SDL::Surface->new(
+ # Create a display to attach the movie to
+ my $surface = SDL::Video::set_video_mode(
$mpeg->height,
$mpeg->width,
- 24, # Colour bits
- 0, 0, 0, 0, # Masks
+ 32, # Colour bits
+ SDL::Video::SDL_SWSURFACE, # flags
);
isa_ok( $surface, 'SDL::Surface' );

0 comments on commit a618f29

Please sign in to comment.
Something went wrong with that request. Please try again.