VLCMediaThumbnailer.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*****************************************************************************
  2. * VLCKit: VLCMediaThumbnailer
  3. *****************************************************************************
  4. * Copyright (C) 2010-2012 Pierre d'Herbemont and VideoLAN
  5. *
  6. * Authors: Pierre d'Herbemont
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program; if not, write to the Free Software Foundation,
  20. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  21. *****************************************************************************/
  22. #import <Foundation/Foundation.h>
  23. #if TARGET_OS_IPHONE
  24. # import <CoreGraphics/CoreGraphics.h>
  25. #endif
  26. @class VLCMedia;
  27. @protocol VLCMediaThumbnailerDelegate;
  28. @interface VLCMediaThumbnailer : NSObject {
  29. id<VLCMediaThumbnailerDelegate> _delegate;
  30. VLCMedia *_media;
  31. void *_mp;
  32. CGImageRef _thumbnail;
  33. void *_data;
  34. NSTimer *_parsingTimeoutTimer;
  35. NSTimer *_thumbnailingTimeoutTimer;
  36. CGFloat _thumbnailHeight,_thumbnailWidth;
  37. CGFloat _effectiveThumbnailHeight,_effectiveThumbnailWidth;
  38. int _numberOfReceivedFrames;
  39. BOOL _shouldRejectFrames;
  40. }
  41. + (VLCMediaThumbnailer *)thumbnailerWithMedia:(VLCMedia *)media andDelegate:(id<VLCMediaThumbnailerDelegate>)delegate;
  42. - (void)fetchThumbnail;
  43. @property (readwrite, assign) id<VLCMediaThumbnailerDelegate> delegate;
  44. @property (readwrite, retain) VLCMedia *media;
  45. @property (readwrite, assign) CGImageRef thumbnail;
  46. /**
  47. * Thumbnail Height
  48. * You shouldn't change this after -fetchThumbnail
  49. * has been called.
  50. * @return thumbnail height. Default value 240.
  51. */
  52. @property (readwrite, assign) CGFloat thumbnailHeight;
  53. /**
  54. * Thumbnail Width
  55. * You shouldn't change this after -fetchThumbnail
  56. * has been called.
  57. * @return thumbnail height. Default value 320
  58. */
  59. @property (readwrite, assign) CGFloat thumbnailWidth;
  60. @end
  61. @protocol VLCMediaThumbnailerDelegate
  62. @required
  63. - (void)mediaThumbnailerDidTimeOut:(VLCMediaThumbnailer *)mediaThumbnailer;
  64. - (void)mediaThumbnailer:(VLCMediaThumbnailer *)mediaThumbnailer didFinishThumbnail:(CGImageRef)thumbnail;
  65. @end