vidinput.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*Daala video codec
  2. Copyright (c) 2002-2007 Daala project contributors. All rights reserved.
  3. Redistribution and use in source and binary forms, with or without
  4. modification, are permitted provided that the following conditions are met:
  5. - Redistributions of source code must retain the above copyright notice, this
  6. list of conditions and the following disclaimer.
  7. - Redistributions in binary form must reproduce the above copyright notice,
  8. this list of conditions and the following disclaimer in the documentation
  9. and/or other materials provided with the distribution.
  10. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
  11. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  12. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  13. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  14. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  15. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  16. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  17. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  18. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  19. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
  20. #if !defined(_vidinput_H)
  21. # define _vidinput_H (1)
  22. # if !defined(_LARGEFILE_SOURCE)
  23. # define _LARGEFILE_SOURCE
  24. # endif
  25. # if !defined(_LARGEFILE64_SOURCE)
  26. # define _LARGEFILE64_SOURCE
  27. # endif
  28. # if !defined(_FILE_OFFSET_BITS)
  29. # define _FILE_OFFSET_BITS 64
  30. # endif
  31. # include <stdio.h>
  32. # include "theora/theoradec.h"
  33. # if defined(__cplusplus)
  34. extern "C" {
  35. # endif
  36. typedef struct video_input video_input;
  37. typedef struct video_input_vtbl video_input_vtbl;
  38. typedef void (*video_input_get_info_func)(void *_ctx,th_info *_ti);
  39. typedef int (*video_input_fetch_frame_func)(void *_ctx,FILE *_fin,
  40. th_ycbcr_buffer _ycbcr,char _tag[5]);
  41. typedef void (*video_input_close_func)(void *_ctx);
  42. struct video_input_vtbl{
  43. video_input_get_info_func get_info;
  44. video_input_fetch_frame_func fetch_frame;
  45. video_input_close_func close;
  46. };
  47. struct video_input{
  48. const video_input_vtbl *vtbl;
  49. void *ctx;
  50. FILE *fin;
  51. };
  52. int video_input_open(video_input *_vid,FILE *_fin);
  53. void video_input_close(video_input *_vid);
  54. void video_input_get_info(video_input *_vid,th_info *_ti);
  55. int video_input_fetch_frame(video_input *_vid,
  56. th_ycbcr_buffer _ycbcr,char _tag[5]);
  57. # if defined(__cplusplus)
  58. }
  59. # endif
  60. #endif