[vlc-devel] commit: osx/framework: added wrapper methods for snapshots and deinterlacing ( Felix Paul Kühne )
git version control
git at videolan.org
Sun Oct 11 17:09:47 CEST 2009
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Oct 11 17:09:09 2009 +0200| [2d46bfc2668ad54fc8cfa6fa14a3fd28bc93378d] | committer: Felix Paul Kühne
osx/framework: added wrapper methods for snapshots and deinterlacing
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d46bfc2668ad54fc8cfa6fa14a3fd28bc93378d
---
.../framework/Headers/Public/VLCMediaPlayer.h | 20 ++++++++++++++++++++
projects/macosx/framework/Sources/VLCMediaPlayer.m | 16 ++++++++++++++++
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
index 34e31a1..f8347f3 100644
--- a/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
+++ b/projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
@@ -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;
diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index f0ac85b..b698267 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -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 );
More information about the vlc-devel
mailing list