4 * Copyright 2009 Parrot SA. All rights reserved.
5 * @author D HAEYER Frederic
8 #import "OpenGLVideo.h"
10 static int32_t current_num_picture_decoded = 0;
12 int get_video_current_numframes( void )
14 return current_num_picture_decoded;
17 @implementation OpenGLVideo
19 - (id)initWithPath:(NSString *)path withScreenSize:(CGSize)size
21 if((self = [super initWithPath:path withScaling:FIT_XY withScreenSize:size]) != nil)
31 BOOL needToUpdate = NO;
32 video_stage_config_t *config = video_stage_get();
34 if ((config != NULL) && (config->data != NULL) && (config->num_picture_decoded > 0))
36 vp_os_mutex_lock( &config->mutex );
38 texture.bytesPerPixel = config->bytesPerPixel;
39 texture.widthImage = config->widthImage;
40 texture.heightImage = config->heightImage;
41 texture.data = config->data;
43 if (config->num_picture_decoded > current_num_picture_decoded)
48 current_num_picture_decoded = config->num_picture_decoded;
50 vp_os_mutex_unlock( &config->mutex );
53 [super drawSelfIfNeeded:needToUpdate];