You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB

  1. #include "XNetSDKTest.h"
  2. #include "XNetSDKSyn.h"
  3. #include "AVEnc_VideoColor.h"
  4. USE_NS_NETSDK_CFG
  5. int TestVideoCfg()
  6. {
  7. printf("%s\r\n", __FUNCTION__);
  8. char c = 0;
  9. while((c = getchar()) != 'q')
  10. {
  11. switch(c)
  12. {
  13. case 'g':
  14. {
  15. char szOutBuf[40960] = {0};
  16. int nInOutBufLen = sizeof(szOutBuf);
  17. char outbuffer[100] = {0};
  18. int len = 0;
  19. int nGetCfg = XSDK_DevGetChnConfigSyn(g_hDevice, 0, JK_AVEnc_VideoColor, szOutBuf, &nInOutBufLen, 4000, EXCMD_CONFIG_GET);
  20. if (nGetCfg >= 0 && nInOutBufLen > 0)
  21. {
  22. JObjArrayObject<AVEnc_VideoColor> cfg(NULL, "AVEnc.VideoColor.[0]");
  23. cfg.Parse(szOutBuf);
  24. if(cfg.objs.Size() > 0)
  25. {
  26. printf("Enable = %d\r\n", cfg.objs[0].Enable.Value());
  27. cfg.objs[0].m_VideoColorParam.Brightness.SetValue(50);
  28. const char *pCfg = cfg.ToString();
  29. nGetCfg = XSDK_DevSetChnConfigSyn(g_hDevice, 0, JK_AVEnc_VideoColor, pCfg, strlen(pCfg), outbuffer, &len, 5000, EXCMD_CONFIG_SET);
  30. if(nGetCfg >= 0)
  31. {
  32. printf("Set Success!\r\n");
  33. }
  34. }
  35. }
  36. }
  37. break;
  38. }
  39. }
  40. return 0;
  41. }