mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
aviio.cpp: Massive code cleanup
- Use multibyte.h functions and std::swap - Turn most macro constants into enums and move them down into classes - Change comments to C++ style
This commit is contained in:
parent
7e4ca3b49c
commit
01040b1e0c
File diff suppressed because it is too large
Load Diff
@ -19,20 +19,13 @@
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
MACROS
|
||||
INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
#define AVI_FOURCC(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
|
||||
|
||||
#define FORMAT_UYVY AVI_FOURCC('U','Y','V','Y')
|
||||
#define FORMAT_VYUY AVI_FOURCC('V','Y','U','Y')
|
||||
#define FORMAT_YUY2 AVI_FOURCC('Y','U','Y','2')
|
||||
#define FORMAT_HFYU AVI_FOURCC('H','F','Y','U')
|
||||
#define FORMAT_I420 AVI_FOURCC('I','4','2','0')
|
||||
#define FORMAT_DIB AVI_FOURCC('D','I','B',' ')
|
||||
#define FORMAT_RGB AVI_FOURCC('R','G','B',' ')
|
||||
#define FORMAT_RAW AVI_FOURCC('R','A','W',' ')
|
||||
#define FORMAT_UNCOMPRESSED 0x00000000
|
||||
inline constexpr std::uint32_t AVI_FOURCC(char a, char b, char c, char d)
|
||||
{
|
||||
return std::uint32_t(a) | (std::uint32_t(b) << 8) | (std::uint32_t(c) << 16) | (std::uint32_t(d) << 24);
|
||||
}
|
||||
|
||||
|
||||
class avi_file
|
||||
@ -43,6 +36,19 @@ public:
|
||||
CONSTANTS
|
||||
***********************************************************************/
|
||||
|
||||
enum : std::uint32_t
|
||||
{
|
||||
FORMAT_UYVY = AVI_FOURCC('U','Y','V','Y'),
|
||||
FORMAT_VYUY = AVI_FOURCC('V','Y','U','Y'),
|
||||
FORMAT_YUY2 = AVI_FOURCC('Y','U','Y','2'),
|
||||
FORMAT_HFYU = AVI_FOURCC('H','F','Y','U'),
|
||||
FORMAT_I420 = AVI_FOURCC('I','4','2','0'),
|
||||
FORMAT_DIB = AVI_FOURCC('D','I','B',' '),
|
||||
FORMAT_RGB = AVI_FOURCC('R','G','B',' '),
|
||||
FORMAT_RAW = AVI_FOURCC('R','A','W',' '),
|
||||
FORMAT_UNCOMPRESSED = 0x00000000
|
||||
};
|
||||
|
||||
enum class error
|
||||
{
|
||||
NONE = 0,
|
||||
|
@ -120,7 +120,7 @@ const int MODE_GDI = 2;
|
||||
|
||||
typedef std::unordered_map<std::string, std::string *> parameters_map;
|
||||
|
||||
template <typename Format, typename... Params> static void report_error(int error, Format &&fmt, Params &&...args);
|
||||
template <typename Format, typename... Params> [[noreturn]] static void report_error(int error, Format &&fmt, Params &&...args);
|
||||
static void do_info(parameters_map ¶ms);
|
||||
static void do_verify(parameters_map ¶ms);
|
||||
static void do_create_raw(parameters_map ¶ms);
|
||||
@ -2869,7 +2869,7 @@ static void do_extract_ld(parameters_map ¶ms)
|
||||
|
||||
// build up the movie info
|
||||
avi_file::movie_info info;
|
||||
info.video_format = FORMAT_YUY2;
|
||||
info.video_format = avi_file::FORMAT_YUY2;
|
||||
info.video_timescale = fps_times_1million / interlace_factor;
|
||||
info.video_sampletime = 1000000;
|
||||
info.video_width = width;
|
||||
|
Loading…
Reference in New Issue
Block a user