ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / Soft / Lib / ardrone_tool / Video / video_stage_ffmpeg_recorder.h
1 #ifndef _VIDEO_STAGE_FFMPEG_RECORDER_H_
2 #define _VIDEO_STAGE_FFMPEG_RECORDER_H_
3
4 /* From FFMPEG example */
5 #include <stdlib.h>
6 #include <stdio.h>
7 #include <string.h>
8 #include <math.h>
9
10 #include <libavformat/avformat.h>
11 #include <libswscale/swscale.h>
12 #include <libavfilter/avfilter.h>
13 #include <libavutil/avutil.h>
14 #include <libavcodec/avcodec.h>
15
16 #include <stdio.h>
17 #include <VP_Api/vp_api.h>
18
19 #include <ardrone_tool/Video/video_stage_recorder.h>
20
21
22 #ifndef _VIDEO_RECORD_STATE_ENUM_
23 #define _VIDEO_RECORD_STATE_ENUM_
24 #endif
25
26 typedef struct _video_stage_ffmpeg_recorder_config_t
27 {
28         char video_filename[1024];
29         FILE* fp;
30         video_record_state startRec;
31 } video_stage_ffmpeg_recorder_config_t;
32
33 C_RESULT video_stage_ffmpeg_recorder_handle (video_stage_ffmpeg_recorder_config_t * cfg, PIPELINE_MSG msg_id, void *callback, void *param);
34 C_RESULT video_stage_ffmpeg_recorder_open(video_stage_ffmpeg_recorder_config_t *cfg);
35 C_RESULT video_stage_ffmpeg_recorder_transform(video_stage_ffmpeg_recorder_config_t *cfg, vp_api_io_data_t *in, vp_api_io_data_t *out);
36 C_RESULT video_stage_ffmpeg_recorder_close(video_stage_ffmpeg_recorder_config_t *cfg);
37
38
39
40
41 void create_video_file(const char*filename,int width,int height);
42 void close_video_file();
43 AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id,int width, int height);
44 AVFrame *alloc_picture(enum PixelFormat pix_fmt, int width, int height);
45 void open_video(AVFormatContext *oc, AVStream *st);
46 void write_video_frame(AVFormatContext *oc, AVStream *st);
47 void close_video(AVFormatContext *oc, AVStream *st);
48
49 extern const vp_api_stage_funcs_t video_ffmpeg_recorder_funcs;
50
51 #endif // _VIDEO_STAGE_RECORDER_H_