00001 #include <stdio.h> 00002 00003 #include "guicast.h" 00004 #include "pipe.h" 00005 00006 #ifndef HAVE_STDINT_H 00007 #define HAVE_STDINT_H 00008 #endif /* HAVE_STDINT_H */ 00009 00010 #include <mjpegtools/yuv4mpeg.h> 00011 #include <mjpegtools/mpegconsts.h> 00012 00013 class YUVStream { 00014 public: 00015 YUVStream(); 00016 ~YUVStream(); 00017 00018 int open_read(char *path); 00019 int open_write(char *path, char *pipe); 00020 void close_fd(); 00021 00022 int read_frame(uint8_t *yuv[3]); 00023 int read_frame_raw(uint8_t *data, long frame_size); 00024 00025 int write_frame(uint8_t *yuv[3]); 00026 int write_frame_raw(uint8_t *data, long frame_size); 00027 00028 int make_index(); 00029 int seek_frame(int64_t frame_number); 00030 00031 int read_header(); 00032 int write_header(); 00033 00034 int get_interlace(); 00035 void set_interlace(int width); 00036 00037 int get_width(); 00038 void set_width(int width); 00039 00040 int get_height(); 00041 void set_height(int height); 00042 00043 double get_frame_rate(); 00044 void set_frame_rate(double frame_rate); 00045 00046 double get_aspect_ratio(); 00047 void set_aspect_ratio(double aspect_ratio); 00048 00049 int64_t frame_count; 00050 00051 int stream_fd; // used for files 00052 private: 00053 y4m_stream_info_t stream_info; 00054 y4m_frame_info_t frame_info; 00055 Pipe *stream_pipe; // used for pipes 00056 ArrayList<off_t> *frame_index; 00057 };
1.4.4