]> git.sesse.net Git - vlc/commitdiff
osx/framework: added wrapper methods for snapshots and deinterlacing
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 11 Oct 2009 15:09:09 +0000 (17:09 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 11 Oct 2009 15:09:43 +0000 (17:09 +0200)
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Sources/VLCMediaPlayer.m

index 34e31a181485cadd16901e11f837d062da32db6b..f8347f33c85d0dfad8f9c222a1a9dd1a653d8919 100644 (file)
@@ -112,6 +112,26 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
 - (void)setVideoTeleText:(int)value;
 - (int)videoTeleText;
 
+/**
+ * Take a snapshot of the current video.
+ *
+ * If width AND height is 0, original size is used.
+ * If width OR height is 0, original aspect-ratio is preserved.
+ *
+ * \param path the path where to save the screenshot to
+ * \param width the snapshot's width
+ * \param height the snapshot's height
+ */
+- (void)saveVideoSnapshotAt: (NSString *)path withWidth:(NSUInteger)width andHeight:(NSUInteger)height;
+
+/**
+ * Enable or disable deinterlace filter
+ *
+ * \param name of deinterlace filter to use (availability depends on underlying VLC version)
+ * \param enable boolean to enable or disable deinterlace filter
+ */
+- (void)setDeinterlaceFilter: (NSString *)name enabled: (BOOL)enabled;
+
 @property float rate;
 
 @property (readonly) VLCAudio * audio;
index f0ac85b6132eaeb5e25dfba3237bed728ac9cb64..b698267d753e42e9e1dab2808e2adeaef4220e01 100644 (file)
@@ -304,6 +304,22 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     return result;
 }
 
+- (void)saveVideoSnapshotAt: (NSString *)path withWidth:(NSUInteger)width andHeight:(NSUInteger)height
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    libvlc_video_take_snapshot( instance, [path UTF8String], width, height, &ex );
+    catch_exception( &ex );
+}
+
+- (void)setDeinterlaceFilter: (NSString *)name enabled: (BOOL)enabled
+{
+    libvlc_exception_t ex;
+    libvlc_exception_init( &ex );
+    libvlc_video_set_deinterlace( instance, (int)enabled , [name UTF8String], &ex );
+    catch_exception( &ex );
+}
+
 - (void)setRate:(float)value
 {
     libvlc_media_player_set_rate( instance, value, NULL );