decoder_listener.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2019, Chips&Media
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright notice,
  11. * this list of conditions and the following disclaimer in the documentation
  12. * and/or other materials provided with the distribution.
  13. *
  14. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  15. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  16. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  17. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  18. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  19. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  20. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  21. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifdef USE_FEEDING_METHOD_BUFFER
  26. #include "wave511/sample_v2/component/cnm_app.h"
  27. #include "wave511/sample_v2/helper/misc/bw_monitor.h"
  28. #else
  29. #include "cnm_app.h"
  30. #include "misc/bw_monitor.h"
  31. #endif
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif /* __cplusplus */
  35. typedef struct DecListenerContext {
  36. Component renderer;
  37. Comparator comparator;
  38. Int32 lastSeqNo;
  39. DecGetFramebufInfo fbInfo;
  40. Uint32 compareType;
  41. BOOL match;
  42. Uint32 notDecodedCount;
  43. /* performance & bandwidth */
  44. BOOL performance;
  45. BOOL bandwidth;
  46. PFCtx pfCtx;
  47. BWCtx* bwCtx;
  48. Uint32 fps;
  49. Uint32 pfClock;
  50. char inputPath[MAX_FILE_PATH];
  51. Uint32 numVCores;
  52. CodStd bitFormat;
  53. Int32 productId;
  54. BOOL enableScaler;
  55. } DecListenerContext;
  56. void DecoderListener(Component com, Uint64 event, void* data, void* context);
  57. BOOL SetupDecListenerContext(DecListenerContext* ctx, CNMComponentConfig* config, Component renderer);
  58. void ClearDecListenerContext(DecListenerContext* ctx);
  59. void HandleDecCompleteSeqEvent(Component com, CNMComListenerDecCompleteSeq* param, DecListenerContext* ctx);
  60. void HandleDecRegisterFbEvent(Component com, CNMComListenerDecRegisterFb* param, DecListenerContext* ctx);
  61. void HandleDecGetOutputEvent(Component com, CNMComListenerDecDone* param, DecListenerContext* ctx);
  62. void HandleDecCloseEvent(Component com, CNMComListenerDecClose* param, DecListenerContext* ctx);
  63. #ifdef __cplusplus
  64. }
  65. #endif /* __cplusplus */