From 73056155b32ad39c370518985de844bd9f46f1cc Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vignali@gmail.com>
Date: Mon, 24 Oct 2016 23:00:23 +0200
Subject: [PATCH] fate filter metadata : add test for aphasemeter - Test a mono
 file (in phase) -> 1. as result - Test a out of phase 1000 Hz -> -1. as
 result

---
 tests/fate/filter-video.mak                        |  8 +++++++
 .../ref/fate/filter-metadata-avf-aphase-meter-mono | 25 ++++++++++++++++++++++
 .../filter-metadata-avf-aphase-meter-out-of-phase  | 25 ++++++++++++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 tests/ref/fate/filter-metadata-avf-aphase-meter-mono
 create mode 100644 tests/ref/fate/filter-metadata-avf-aphase-meter-out-of-phase

diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index e2513f5..d79bbf6 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -653,6 +653,14 @@ FATE_METADATA_FILTER-$(call ALLYES, $(READVITC_METADATA_DEPS)) += fate-filter-me
 fate-filter-metadata-readvitc-thr: SRC = $(TARGET_SAMPLES)/filter/sample-vitc.avi
 fate-filter-metadata-readvitc-thr: CMD = run $(FILTER_METADATA_COMMAND) "movie='$(SRC)',readvitc=thr_b=0.3:thr_w=0.5"
 
+AVF_PHASE_METER_DEPS = FFPROBE AVDEVICE LAVFI_INDEV AMOVIE_FILTER FLAC_DEMUXER FLAC_DECODER SINE_FILTER APHASEMETER_FILTER
+FATE_METADATA_FILTER-$(call ALLYES, $(AVF_PHASE_METER_DEPS)) += fate-filter-metadata-avf-aphase-meter-mono
+fate-filter-metadata-avf-aphase-meter-mono: CMD = run $(FILTER_METADATA_COMMAND) sine="frequency=1000:sample_rate=48000:duration=1,aphasemeter"
+
+FATE_METADATA_FILTER-$(call ALLYES, $(AVF_PHASE_METER_DEPS)) += fate-filter-metadata-avf-aphase-meter-out-of-phase
+fate-filter-metadata-avf-aphase-meter-out-of-phase: SRC = $(TARGET_SAMPLES)/filter/out-of-phase-1000hz.flac
+fate-filter-metadata-avf-aphase-meter-out-of-phase: CMD = run $(FILTER_METADATA_COMMAND) "amovie='$(SRC)',aphasemeter"
+
 tests/data/file4560-override2rotate0.mov: TAG = GEN
 tests/data/file4560-override2rotate0.mov: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
 	$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
diff --git a/tests/ref/fate/filter-metadata-avf-aphase-meter-mono b/tests/ref/fate/filter-metadata-avf-aphase-meter-mono
new file mode 100644
index 0000000..3c72375
--- /dev/null
+++ b/tests/ref/fate/filter-metadata-avf-aphase-meter-mono
@@ -0,0 +1,25 @@
+pkt_pts=0|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=1920|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=3840|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=5760|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=7680|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=9600|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=11520|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=13440|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=15360|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=17280|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=19200|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=21120|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=23040|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=24960|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=26880|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=28800|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=30720|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=32640|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=34560|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=36480|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=38400|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=40320|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=42240|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=44160|tag:lavfi.aphasemeter.phase=1.000000
+pkt_pts=46080|tag:lavfi.aphasemeter.phase=1.000000
diff --git a/tests/ref/fate/filter-metadata-avf-aphase-meter-out-of-phase b/tests/ref/fate/filter-metadata-avf-aphase-meter-out-of-phase
new file mode 100644
index 0000000..425b2ae
--- /dev/null
+++ b/tests/ref/fate/filter-metadata-avf-aphase-meter-out-of-phase
@@ -0,0 +1,25 @@
+pkt_pts=0|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=1920|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=3840|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=5760|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=7680|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=9600|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=11520|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=13440|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=15360|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=17280|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=19200|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=21120|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=23040|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=24960|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=26880|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=28800|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=30720|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=32640|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=34560|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=36480|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=38400|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=40320|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=42240|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=44160|tag:lavfi.aphasemeter.phase=-1.000000
+pkt_pts=46080|tag:lavfi.aphasemeter.phase=-1.000000
-- 
1.9.3 (Apple Git-50)

