camera_app_spec.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2021 Alibaba Group Holding Limited
  3. * Author: LuChongzhi <chongzhi.lcz@alibaba-inc.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #include <stdio.h>
  10. #define LOG_LEVEL 3
  11. #define LOG_PREFIX "app_spec"
  12. #include <syslog.h>
  13. #include <csi_camera.h>
  14. #include <camera_manager.h>
  15. #include "camera_app_spec.h"
  16. const camera_app_bitmasks_t camera_app_support_camera_event_action[] = {
  17. 2,
  18. {
  19. CAMERA_ACTION_LOG_PRINT,
  20. CAMERA_ACTION_CAPTURE_FRAME,
  21. }
  22. };
  23. const camera_app_bitmasks_t camera_app_support_channel_event_action[] = {
  24. 3,
  25. {
  26. CAMERA_CHANNEL_ACTION_LOG_PRINT,
  27. CAMERA_CHANNEL_ACTION_CAPTURE_FRAME,
  28. CAMERA_CHANNEL_ACTION_DISPLAY_FRAME,
  29. }
  30. };
  31. const camera_app_bitmasks_t *camera_app_get_bitmask_array(int bitmask_id)
  32. {
  33. switch(bitmask_id) {
  34. case CAMERA_APP_BITMAKS_CAMERA_EVENT_ACTION:
  35. return camera_app_support_camera_event_action;
  36. case CAMERA_APP_BITMAKS_CHANNEL_EVENT_ACTION:
  37. return camera_app_support_channel_event_action;
  38. default:
  39. LOG_E("Unknown bitmask_id:%d\n", bitmask_id);
  40. return NULL;
  41. }
  42. }