Advertisement
Guest User

Untitled

a guest
Aug 29th, 2011
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. //#include <ti/sdo/ce/CERuntime.h>
  2. #include <xdc/std.h>
  3. #include <ti/sdo/ce/Engine.h>
  4. #include <ti/sdo/ce/osal/Memory.h>
  5. #include <ti/sdo/ce/video2/viddec2.h>
  6. #include <ti/xdais/dm/ivideo.h>
  7. #include <ti/xdais/dm/ividdec2.h>
  8. #include <ti/xdais/xdas.h>
  9. #include <ti/xdais/dm/xdm.h>
  10. #include <ti/xdais/dm/ivideo.h>
  11. #include <ti/xdais/dm/ividdec2.h>
  12.  
  13. #include <ti/sdo/ce/video/videnc.h>
  14. #include <ti/sdo/ce/trace/gt.h>
  15.  
  16. #include <string.h> /* for memset */
  17.  
  18. #include <stdio.h>
  19. #include <stdlib.h>
  20. #include "idsptry.h"
  21. #include "h264vdec.h"
  22. #include "h264vdec_ti.h"
  23.  
  24. static String progName = "ce";
  25. static String decoderName = "h264dec";
  26. static String engineName = "ceEngine";
  27.  
  28. static Engine_Handle ce;
  29. static VIDDEC2_Handle dec;
  30.  
  31. IH264VDEC_Params params;
  32. IH264VDEC_DynamicParams dynamicParams;
  33.  
  34. VIDDEC2_Status status;
  35. VIDDEC2_InArgs in_args;
  36. VIDDEC2_OutArgs out_args;
  37.  
  38. void trycallDSP()
  39. {
  40. /* init Codec Engine */
  41. CERuntime_init();
  42. printf("This is the DSP replying!\n");
  43.  
  44. if ((ce = Engine_open(engineName, NULL, NULL)) == NULL) {
  45. fprintf(stderr, "error: can't open engine ceEngine\n");
  46. goto end;
  47. } else {
  48. printf( "SUCCESS: opened engine %s\n", engineName);
  49. }
  50.  
  51.  
  52. /* Init video decoder parameters */
  53. //TODO: set dynamically
  54. params.viddecParams.maxFrameRate = 30000;
  55. params.viddecParams.maxBitRate = 10000000;
  56. params.viddecParams.dataEndianness = XDM_BYTE;
  57. params.viddecParams.maxHeight = 720;
  58. params.viddecParams.maxWidth = 576;
  59. params.viddecParams.forceChromaFormat = XDM_YUV_420SP;
  60. params.inputStreamFormat = 0;
  61. params.maxDisplayDelay = 0;
  62.  
  63. params.viddecParams.size = sizeof(IH264VDEC_Params);
  64. status.size = sizeof(VIDDEC2_Status);
  65. dynamicParams.viddecDynamicParams.size = sizeof(IH264VDEC_DynamicParams);
  66. in_args.size = sizeof(VIDDEC2_InArgs);
  67. out_args.size = sizeof(VIDDEC2_OutArgs);
  68.  
  69. printf( "Done initialiazing, creating decoder handle\n");
  70. /* allocate and initialize video decoder on the engine */
  71.  
  72. dec = VIDDEC2_create(ce, decoderName, &(params.viddecParams));
  73. if (dec == NULL) {
  74. printf( "App-> ERROR: can't open codec %s\n", decoderName);
  75. goto end;
  76. } else {
  77. printf( "SUCCESS: opened codec %s\n", decoderName);
  78. }
  79.  
  80. end:
  81. printf("Done DSP!\n");
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement