summaryrefslogtreecommitdiff
authoryanan.wang <yanan.wang@amlogic.com>2020-02-24 10:54:04 (GMT)
committer gerrit autosubmit <gerrit.autosubmit@scgit.amlogic.com>2020-03-12 15:58:51 (GMT)
commite9d38915a49151458f633f9534b910ce1788c6df (patch)
treeffd4ee3d16cbbe2a6031cfa1152a4dd86a4ded36
parent5652b4fcf60a146c23f7f2faa74d7185e70fad0a (diff)
downloadmedia_modules-e9d38915a49151458f633f9534b910ce1788c6df.zip
media_modules-e9d38915a49151458f633f9534b910ce1788c6df.tar.gz
media_modules-e9d38915a49151458f633f9534b910ce1788c6df.tar.bz2
amstream: add IPTV Player event report to middleware from amstream. [2/2]
PD#SWPL-21119 Problem: support AmlProbe feature to AndroidQ. Solution: add IPTV Player event report to middleware from amstream. Verify: u212 Change-Id: Ifa0fd5accbf2beb17ff660801b4021688284aec3 Signed-off-by: yanan.wang <yanan.wang@amlogic.com>
Diffstat
-rw-r--r--drivers/stream_input/amports/amstream.c30
-rw-r--r--drivers/stream_input/parser/tsdemux.c6
-rw-r--r--drivers/stream_input/parser/tsdemux.h1
3 files changed, 37 insertions, 0 deletions
diff --git a/drivers/stream_input/amports/amstream.c b/drivers/stream_input/amports/amstream.c
index 10b1224..d881b37 100644
--- a/drivers/stream_input/amports/amstream.c
+++ b/drivers/stream_input/amports/amstream.c
@@ -30,6 +30,7 @@
#include <linux/delay.h>
#include <linux/kthread.h>
+#include <linux/amlogic/media/video_sink/video.h>
#include <linux/amlogic/media/utils/amstream.h>
#include <linux/amlogic/media/utils/vformat.h>
#include <linux/amlogic/media/utils/aformat.h>
@@ -2678,6 +2679,34 @@ static long amstream_do_ioctl_new(struct port_priv_s *priv,
}
}
break;
+ case AMSTREAM_IOC_GET_AVINFO:
+ {
+ struct av_param_info_t __user *uarg = (void *)arg;
+ struct av_info_t av_info;
+ int delay;
+ u32 avgbps;
+ if (this->type & PORT_TYPE_VIDEO) {
+ av_info.first_pic_coming = get_first_pic_coming();
+ av_info.current_fps = -1;
+ av_info.vpts = timestamp_vpts_get();
+ av_info.vpts_err = tsync_get_vpts_error_num();
+ av_info.apts = timestamp_apts_get();
+ av_info.apts_err = tsync_get_apts_error_num();
+ av_info.ts_error = get_discontinue_counter();
+ av_info.first_vpts = timestamp_firstvpts_get();
+ av_info.toggle_frame_count = get_toggle_frame_count();
+ delay = calculation_stream_delayed_ms(
+ PTS_TYPE_VIDEO, NULL, &avgbps);
+ if (delay >= 0)
+ av_info.dec_video_bps = avgbps;
+ else
+ av_info.dec_video_bps = 0;
+ }
+ if (copy_to_user((void *)&uarg->av_info, (void *)&av_info,
+ sizeof(struct av_info_t)))
+ r = -EFAULT;
+ }
+ break;
default:
r = -ENOIOCTLCMD;
break;
@@ -3480,6 +3509,7 @@ static long amstream_do_ioctl(struct port_priv_s *priv,
case AMSTREAM_IOC_SYSINFO:
case AMSTREAM_IOC_GET_QOSINFO:
case AMSTREAM_IOC_GET_MVDECINFO:
+ case AMSTREAM_IOC_GET_AVINFO:
r = amstream_do_ioctl_new(priv, cmd, arg);
break;
default:
diff --git a/drivers/stream_input/parser/tsdemux.c b/drivers/stream_input/parser/tsdemux.c
index ac34cf7..2a02178 100644
--- a/drivers/stream_input/parser/tsdemux.c
+++ b/drivers/stream_input/parser/tsdemux.c
@@ -967,6 +967,12 @@ ssize_t tsdemux_write(struct file *file,
return -EAGAIN;
}
+int get_discontinue_counter(void)
+{
+ return discontinued_counter;
+}
+EXPORT_SYMBOL(get_discontinue_counter);
+
static ssize_t show_discontinue_counter(struct class *class,
struct class_attribute *attr, char *buf)
{
diff --git a/drivers/stream_input/parser/tsdemux.h b/drivers/stream_input/parser/tsdemux.h
index f63bcdf..5f82309 100644
--- a/drivers/stream_input/parser/tsdemux.h
+++ b/drivers/stream_input/parser/tsdemux.h
@@ -88,6 +88,7 @@ extern u8 tsdemux_pcrvideo_valid(void);
extern u32 tsdemux_first_pcrscr_get(void);
extern void timestamp_pcrscr_enable(u32 enable);
extern void timestamp_pcrscr_set(u32 pts);
+int get_discontinue_counter(void);
int tsdemux_class_register(void);
void tsdemux_class_unregister(void);