test_image_attr.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 20012 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)yahoo[dot]fr>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO 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 General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. #ifndef _TEST_IMG_ATTR_H_
  23. #define _TEST_IMG_ATTR_H_
  24. static const char* __test_imageattrs[] = {
  25. "send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]",
  26. "recv [x=800,y=640,sar=1.1] send [x=330,y=250]",
  27. "recv [x=800,y=640,sar=1.1] send [x=[320:16:640],y=[240:16:480],par=[1.2-1.3]]",
  28. "send [x=[480:16:800],y=[320:16:640],par=[1.2-1.3],q=0.6] [x=[176:8:208],y=[144:8:176],par=[1.2-1.3]] recv *",
  29. "send [x=176,y=144] [x=224,y=176] [x=272,y=224] [x=320,y=240] recv [x=176,y=144] [x=224,y=176] [x=272,y=224,q=0.6] [x=320,y=240]",
  30. "send [x=320,y=240]",
  31. "recv [x=320,y=240]",
  32. "send [x=[400:16:800],y=[320:16:640],sar=[1.0-1.3],par=[1.2-1.3]] recv [x=800,y=600,sar=1.1]",
  33. "recv [x=464,y=384,sar=1.15] send [x=800,y=600,sar=1.1]"
  34. };
  35. void test_qos_imageattr()
  36. {
  37. tsk_size_t i;
  38. tmedia_imageattr_xt imageattr;
  39. for(i = 0; i < sizeof(__test_imageattrs)/sizeof(__test_imageattrs[0]); ++i) {
  40. if(tmedia_imageattr_parse(&imageattr, __test_imageattrs[i], tsk_strlen(__test_imageattrs[i])) == 0) {
  41. TSK_DEBUG_INFO("image-attr parsed (OK): %s", __test_imageattrs[i]);
  42. }
  43. else {
  44. TSK_DEBUG_ERROR("image-attr parsed (NOK): %s", __test_imageattrs[i]);
  45. }
  46. }
  47. }
  48. #endif /* _TEST_IMG_ATTR_H_ */