1 #ifndef _yuv4mpeg_hpp_included_
2 #define _yuv4mpeg_hpp_included_
7 #include "parseval.hpp"
9 regex_results
yuv4mpeg_find_extension(const std::vector
<std::string
>& exts
, const std::string
& regex
);
10 void yuv4mpeg_delete_extensions(std::vector
<std::string
>& exts
, const std::string
& regex
);
12 struct yuv4mpeg_stream_header
14 yuv4mpeg_stream_header();
15 yuv4mpeg_stream_header(const std::string
& str
);
16 yuv4mpeg_stream_header(FILE* pipe
);
17 operator std::string() const;
18 regex_results
find_extension(const std::string
& regex
) const
20 return yuv4mpeg_find_extension(extension
, regex
);
22 void delete_extensions(const std::string
& regex
) { yuv4mpeg_delete_extensions(extension
, regex
); }
26 INT_PROGRESSIVE
= 'p',
28 INT_BOTTOM_FIRST
= 'b',
39 std::vector
<std::string
> extension
;
42 struct yuv4mpeg_frame_header
44 yuv4mpeg_frame_header();
45 yuv4mpeg_frame_header(const std::string
& str
);
46 yuv4mpeg_frame_header(FILE* pipe
);
47 operator std::string() const;
48 regex_results
find_extension(const std::string
& regex
) const
50 return yuv4mpeg_find_extension(extension
, regex
);
52 void delete_extensions(const std::string
& regex
) { yuv4mpeg_delete_extensions(extension
, regex
); }
56 REP_TOP_FIRST_REPEAT
= 'T',
57 REP_BOTTOM_FIRST
= 'b',
58 REP_BOTTOM_FIRST_REPEAT
= 'B',
59 REP_PROGRESSIVE
= '1',
60 REP_PROGRESSIVE_DBL
= '2',
61 REP_PROGRESSIVE_TRIPL
= '3'
65 TMP_PROGRESSIVE
= 'p',
78 std::vector
<std::string
> extension
;
81 void mark_pipe_as_binary(FILE* pipe
);
82 void read_or_die(FILE* pipe
, void* data
, size_t datasize
);
83 bool read_or_die2(FILE* pipe
, void* data
, size_t datasize
);
84 bool read_line2(FILE* pipe
, std::string
& str
);
85 void write_or_die(FILE* pipe
, const void* data
, size_t datasize
);
86 void write_or_die(FILE* pipe
, const std::string
& data
);
87 void get_512_scaling(size_t w
, size_t h
, uint32_t sar_n
, uint32_t sar_d
, size_t& w512
, size_t& h512
);