VLCMediaThumbnailer.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // VLCMediaThumbnailer.h
  3. // VLCKit
  4. //
  5. // Created by Pierre d'Herbemont on 7/10/10.
  6. // Copyright 2010 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #if TARGET_OS_IPHONE
  10. # import <CoreGraphics/CoreGraphics.h>
  11. #endif
  12. @class VLCMedia;
  13. @protocol VLCMediaThumbnailerDelegate;
  14. @interface VLCMediaThumbnailer : NSObject {
  15. id<VLCMediaThumbnailerDelegate> _delegate;
  16. VLCMedia *_media;
  17. void *_mp;
  18. CGImageRef _thumbnail;
  19. void *_data;
  20. NSTimer *_parsingTimeoutTimer;
  21. NSTimer *_thumbnailingTimeoutTimer;
  22. CGFloat _thumbnailHeight,_thumbnailWidth;
  23. CGFloat _effectiveThumbnailHeight,_effectiveThumbnailWidth;
  24. int _numberOfReceivedFrames;
  25. BOOL _shouldRejectFrames;
  26. }
  27. + (VLCMediaThumbnailer *)thumbnailerWithMedia:(VLCMedia *)media andDelegate:(id<VLCMediaThumbnailerDelegate>)delegate;
  28. - (void)fetchThumbnail;
  29. @property (readwrite, assign) id<VLCMediaThumbnailerDelegate> delegate;
  30. @property (readwrite, retain) VLCMedia *media;
  31. @property (readwrite, assign) CGImageRef thumbnail;
  32. /**
  33. * Thumbnail Height
  34. * You shouldn't change this after -fetchThumbnail
  35. * has been called.
  36. * @return thumbnail height. Default value 240.
  37. */
  38. @property (readwrite, assign) CGFloat thumbnailHeight;
  39. /**
  40. * Thumbnail Width
  41. * You shouldn't change this after -fetchThumbnail
  42. * has been called.
  43. * @return thumbnail height. Default value 320
  44. */
  45. @property (readwrite, assign) CGFloat thumbnailWidth;
  46. @end
  47. @protocol VLCMediaThumbnailerDelegate
  48. @required
  49. - (void)mediaThumbnailerDidTimeOut:(VLCMediaThumbnailer *)mediaThumbnailer;
  50. - (void)mediaThumbnailer:(VLCMediaThumbnailer *)mediaThumbnailer didFinishThumbnail:(CGImageRef)thumbnail;
  51. @end