noop_theora.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /********************************************************************
  2. * *
  3. * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
  4. * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
  5. * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
  6. * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
  7. * *
  8. * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
  9. * by the Xiph.Org Foundation http://www.xiph.org/ *
  10. * *
  11. ********************************************************************
  12. function: routines for validating codec initialization
  13. last mod: $Id$
  14. ********************************************************************/
  15. #include <theora/theora.h>
  16. #include "tests.h"
  17. static int
  18. noop_test_encode ()
  19. {
  20. theora_info ti;
  21. theora_state th;
  22. INFO ("+ Initializing theora_info struct");
  23. theora_info_init (&ti);
  24. INFO ("+ Setting a 16x16 frame");
  25. ti.width = 16;
  26. ti.height = 16;
  27. INFO ("+ Setting a 1:1 frame rate");
  28. ti.fps_numerator = 1;
  29. ti.fps_denominator = 1;
  30. INFO ("+ Initializing theora_state for encoding");
  31. if (theora_encode_init (&th, &ti) != OC_DISABLED) {
  32. INFO ("+ Clearing theora_state");
  33. theora_clear (&th);
  34. }
  35. INFO ("+ Clearing theora_info struct");
  36. theora_info_clear (&ti);
  37. return 0;
  38. }
  39. #if 0
  40. static int
  41. noop_test_decode ()
  42. {
  43. theora_info ti;
  44. theora_state th;
  45. INFO ("+ Initializing theora_info struct");
  46. theora_info_init (&ti);
  47. INFO ("+ Initializing theora_state for decoding");
  48. theora_decode_init (&th, &ti);
  49. INFO ("+ Clearing theora_state");
  50. theora_clear (&th);
  51. INFO ("+ Clearing theora_info struct");
  52. theora_info_clear (&ti);
  53. return 0;
  54. }
  55. #endif
  56. static int
  57. noop_test_comments ()
  58. {
  59. theora_comment tc;
  60. theora_comment_init (&tc);
  61. theora_comment_clear (&tc);
  62. return 0;
  63. }
  64. int main(int argc, char *argv[])
  65. {
  66. /*noop_test_decode ();*/
  67. noop_test_encode ();
  68. noop_test_comments ();
  69. exit (0);
  70. }