FuJuntang
2022-07-06 e795b6226a92961ae10d5ef497d2f78fe88fb918
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
 
#include "PTZBinding.nsmap"
#include "av_demux/av_demux.h"
 
int main(int argc, char **argv)
{
  int ret;
  char parse_buf[MAX_BUF_SIZE] = { 0x00 };
  playback_key data_set = {"192.168.1.101", "2022-7-3", "21-52-16"};
  AVDevs *handle = NULL;
 
  ret = proto_AVInit();
  if (ret < 0) {
    printf("AV stream initialization failure!\n");
 
    return 0;
  }
 
  printf("start the av stream:\n");
  handle = proto_AVGethandle();
  proto_AVStart(handle);
 
  sleep(5 * 60 * 2);
 
  printf("stop the av stream now:\n");
  proto_AVStop(handle, NORMAL);
 
  sleep(3);
 
  printf("re-start the AV now:\n");
  proto_AVStart(handle);
 
  sleep(120);
 
  printf("pause the av stream now:\n");
  proto_AVStop(handle, PAUSE);
 
  sleep(20);
 
  printf("resume the av:\n");
  proto_AVStart(handle);
 
  sleep(200);
 
  printf("stop the av");
  proto_AVStop(handle, NORMAL);
 
  sleep(3);
  
  ret = playback_get_key(data_set, parse_buf, sizeof(parse_buf));
  if (ret > 0) {
    printf("found the playback file: %s\n", parse_buf);
  } else {
    printf("the playback file is not existed!\n");
  }
 
  sleep(3000);
  printf("now exit the process:\n");
  proto_AVClose();
 
  return 0;
}