summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar MooglyGuy <therealmogminer@gmail.com>2019-07-22 17:30:14 +0200
committerGravatarGravatar MooglyGuy <therealmogminer@gmail.com>2019-07-22 17:30:14 +0200
commit2483439a18d545efc01b43199f056551df022429 (patch) (github)
treea87a6c2f3b1b3431c87511bbf4b4999a7f44ef6a
parent51895cdb3260c9a89131c1b99e3be2519e4d7161 (diff)
downloadmame-hlsl_aviplay.tar.bz2
mame-hlsl_aviplay.zip
More work towards generic AVI playback, nwhlsl_aviplay
-rw-r--r--src/lib/util/aviio.cpp3
-rw-r--r--src/osd/modules/input/input_windows.cpp5
-rw-r--r--src/osd/modules/osdwindow.h1
-rw-r--r--src/osd/modules/render/drawbgfx.h1
-rw-r--r--src/osd/modules/render/drawd3d.cpp12
-rw-r--r--src/osd/modules/render/drawd3d.h1
-rw-r--r--src/osd/modules/render/drawgdi.h1
-rw-r--r--src/osd/modules/render/drawnone.h1
-rw-r--r--src/osd/modules/render/drawogl.h1
-rw-r--r--src/osd/windows/video.cpp4
-rw-r--r--src/osd/windows/window.cpp18
-rw-r--r--src/osd/windows/window.h1
12 files changed, 45 insertions, 4 deletions
diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp
index b7849ee36cc..764db744bef 100644
--- a/src/lib/util/aviio.cpp
+++ b/src/lib/util/aviio.cpp
@@ -1687,7 +1687,10 @@ avi_file::error avi_file_impl::read_uncompressed_video_frame(std::uint32_t frame
return error::INVALID_STREAM;
if (stream->format() != FORMAT_UNCOMPRESSED && stream->format() != FORMAT_DIB && stream->format() != FORMAT_RGB && stream->format() != FORMAT_RAW && stream->format() != FORMAT_I420)
+ {
+ printf("Invalid format: %08x\n", stream->format());
return error::UNSUPPORTED_VIDEO_FORMAT;
+ }
if (bitmap.width() < stream->width() || bitmap.height() < stream->height())
bitmap.resize(stream->width(), stream->height());
diff --git a/src/osd/modules/input/input_windows.cpp b/src/osd/modules/input/input_windows.cpp
index 164ee0e3c31..3f62172c84d 100644
--- a/src/osd/modules/input/input_windows.cpp
+++ b/src/osd/modules/input/input_windows.cpp
@@ -156,6 +156,11 @@ void windows_osd_interface::customize_input_type_list(simple_list<input_type_ent
entry.configure_osd("POST_PROCESS", "Toggle Post-Processing");
entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, KEYCODE_LALT, KEYCODE_LCONTROL);
break;
+ // lctrl-lalt-F10 to play avi
+ case IPT_OSD_5:
+ entry.configure_osd("PLAY_AVI", "Play AVI");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F10, KEYCODE_LALT, KEYCODE_LCONTROL);
+ break;
// add a NOT-lctrl-lalt to our default F5
case IPT_UI_TOGGLE_DEBUG: // emu/input.c: input_seq(KEYCODE_F5)
entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LALT);
diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h
index 506b4978161..89db8c007d1 100644
--- a/src/osd/modules/osdwindow.h
+++ b/src/osd/modules/osdwindow.h
@@ -211,6 +211,7 @@ public:
virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) { return 0; };
virtual void save() { };
virtual void record() { };
+ virtual void play() {};
virtual void toggle_fsfx() { };
virtual bool sliders_dirty() { return m_sliders_dirty; }
diff --git a/src/osd/modules/render/drawbgfx.h b/src/osd/modules/render/drawbgfx.h
index e7e648c27d1..a99a3209093 100644
--- a/src/osd/modules/render/drawbgfx.h
+++ b/src/osd/modules/render/drawbgfx.h
@@ -53,6 +53,7 @@ public:
virtual void save() override { }
virtual void record() override;
+ virtual void play() override {};
virtual void toggle_fsfx() override { }
uint32_t get_window_width(uint32_t index) const;
diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp
index 86083170315..d53e64cfc1d 100644
--- a/src/osd/modules/render/drawd3d.cpp
+++ b/src/osd/modules/render/drawd3d.cpp
@@ -143,10 +143,14 @@ void renderer_d3d9::toggle_fsfx()
void renderer_d3d9::record()
{
- //if (m_shaders != nullptr)
- //{
- // m_shaders->record_movie();
- //}
+ if (m_shaders != nullptr)
+ {
+ m_shaders->record_movie();
+ }
+}
+
+void renderer_d3d9::play()
+{
play_avi("pacman.avi");
}
diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h
index c626463265a..4e83ae4eb77 100644
--- a/src/osd/modules/render/drawd3d.h
+++ b/src/osd/modules/render/drawd3d.h
@@ -64,6 +64,7 @@ public:
virtual int draw(const int update) override;
virtual void save() override;
virtual void record() override;
+ virtual void play() override;
virtual void toggle_fsfx() override;
virtual void add_audio_to_recording(const int16_t *buffer, int samples_this_frame) override;
virtual std::vector<ui::menu_item> get_slider_list() override;
diff --git a/src/osd/modules/render/drawgdi.h b/src/osd/modules/render/drawgdi.h
index 49d05c18daa..d203ea4e7ad 100644
--- a/src/osd/modules/render/drawgdi.h
+++ b/src/osd/modules/render/drawgdi.h
@@ -44,6 +44,7 @@ public:
virtual int draw(const int update) override;
virtual void save() override {};
virtual void record() override {};
+ virtual void play() override {};
virtual void toggle_fsfx() override {};
private:
diff --git a/src/osd/modules/render/drawnone.h b/src/osd/modules/render/drawnone.h
index c884f969204..711345015ff 100644
--- a/src/osd/modules/render/drawnone.h
+++ b/src/osd/modules/render/drawnone.h
@@ -27,6 +27,7 @@ public:
virtual int draw(const int update) override { return 0; }
virtual void save() override { }
virtual void record() override { }
+ virtual void play() override { }
virtual void toggle_fsfx() override { }
};
diff --git a/src/osd/modules/render/drawogl.h b/src/osd/modules/render/drawogl.h
index 5444f203141..dfafcdf8ea1 100644
--- a/src/osd/modules/render/drawogl.h
+++ b/src/osd/modules/render/drawogl.h
@@ -160,6 +160,7 @@ public:
#ifdef OSD_WINDOWS
virtual void save() override { }
virtual void record() override { }
+ virtual void play() override { }
virtual void toggle_fsfx() override { }
#endif
diff --git a/src/osd/windows/video.cpp b/src/osd/windows/video.cpp
index 889e76caa6b..2306b2d97ef 100644
--- a/src/osd/windows/video.cpp
+++ b/src/osd/windows/video.cpp
@@ -126,6 +126,10 @@ void windows_osd_interface::check_osd_inputs()
// check for taking fullscreen video
if (machine().ui_input().pressed(IPT_OSD_4))
winwindow_toggle_fsfx();
+
+ // check for taking fullscreen video
+ if (machine().ui_input().pressed(IPT_OSD_5))
+ winwindow_play_video();
}
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index 3066be3d6ec..4e8ec3593ee 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -630,6 +630,24 @@ void winwindow_take_video(void)
//============================================================
+// winwindow_play_video
+// (main thread)
+//============================================================
+
+void winwindow_play_video(void)
+{
+ assert(GetCurrentThreadId() == main_threadid);
+
+ // iterate over windows and request a snap
+ for (auto window : osd_common_t::s_window_list)
+ {
+ window->renderer().play();
+ }
+}
+
+
+
+//============================================================
// winwindow_toggle_full_screen
// (main thread)
//============================================================
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index 3db5177cf6d..2b7630595c0 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -165,6 +165,7 @@ extern LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, W
void winwindow_toggle_full_screen(void);
void winwindow_take_snap(void);
void winwindow_take_video(void);
+void winwindow_play_video(void);
void winwindow_toggle_fsfx(void);
void winwindow_process_events_periodic(running_machine &machine);