video.cpp
Go to the documentation of this file.
1 
25 #include <ardrone_autonomy/video.h>
26 
27 #define NB_STAGES 10
28 #define CAMIF_H_CAMERA_USED CAMIF_CAMERA_OVTRULY
29 
31 int32_t current_frame_id = 0;
33 
34 extern "C" C_RESULT export_stage_open(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out)
35 {
36  return (SUCCESS);
37 }
38 
39 extern "C" C_RESULT export_stage_transform(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out)
40 {
41 // PRINT("In Transform before copy\n");
42 // printf("The size of buffer is %d\n", in->size);
43  vp_os_mutex_lock(&video_lock);
44  shared_video_receive_time = ros::Time::now();
45  memcpy(buffer, in->buffers[0], in->size);
47  if (realtime_video)
48  {
50  }
51  vp_os_mutex_unlock(&video_lock);
52 // vp_os_mutex_unlock(&video_update_lock);
53  return (SUCCESS);
54 }
55 
56 extern "C" C_RESULT export_stage_close(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out)
57 {
58  return (SUCCESS);
59 }
60 
61 const vp_api_stage_funcs_t vp_stages_export_funcs =
62 {
63  NULL,
64  (vp_api_stage_open_t)export_stage_open,
65  (vp_api_stage_transform_t)export_stage_transform,
66  (vp_api_stage_close_t)export_stage_close
67 };
vp_os_mutex_t video_lock
Definition: ardrone_sdk.cpp:34
#define MAX_STREAM_WIDTH
Definition: video.h:33
C_RESULT export_stage_transform(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out)
Definition: video.cpp:39
#define MAX_STREAM_HEIGHT
Definition: video.h:34
SUCCESS
const vp_api_stage_funcs_t vp_stages_export_funcs
Definition: video.cpp:61
bool realtime_video
Definition: ardrone_sdk.cpp:43
unsigned char buffer[MAX_STREAM_WIDTH *MAX_STREAM_HEIGHT *3]
Definition: video.cpp:30
C_RESULT export_stage_close(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out)
Definition: video.cpp:56
C_RESULT export_stage_open(void *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out)
Definition: video.cpp:34
ARDroneDriver * ros_driver
Definition: ardrone_sdk.cpp:39
static Time now()
ros::Time shared_video_receive_time
Definition: video.cpp:32
int32_t current_frame_id
Definition: video.cpp:31


ardrone_autonomy
Author(s): Mani Monajjemi, Mani Monajjemi
autogenerated on Mon Jun 10 2019 12:39:49