tsync: move tsync related start/stop from v-stream to tsync [2/3]
authorZhizhong Zhang <zhizhong.zhang@amlogic.com>
Wed, 16 Sep 2020 11:19:31 +0000 (19:19 +0800)
committerZhizhong Zhang <zhizhong.zhang@amlogic.com>
Thu, 17 Sep 2020 11:08:55 +0000 (04:08 -0700)
PD#SWPL-32957

Problem:
zap to audio only channel,no audio output

Solution:
move tsync related start/stop from v-stream to tsync

Verify:
AH212 patch-build

Change-Id: Ia2f741aac7ea91319fd0592da8d9485eb14423df
Signed-off-by: Zhizhong Zhang <zhizhong.zhang@amlogic.com>
drivers/stream_input/amports/stream_buffer_interface.c

index 98cb1bfd1cdfcd70beab8e51fdc9ba380766274a..6e0988d873cbe688e73976c03091ef73bbf665cb 100644 (file)
@@ -60,18 +60,6 @@ static const char *type_to_str(int t)
        }
 }
 
-static int type_to_pts(int t)
-{
-       switch (t) {
-       case BUF_TYPE_VIDEO:
-               return PTS_TYPE_VIDEO;
-       case BUF_TYPE_HEVC:
-               return PTS_TYPE_HEVC;
-       default:
-               return PTS_TYPE_MAX;
-       }
-}
-
 static int stream_buffer_init(struct stream_buf_s *stbuf, struct vdec_s *vdec)
 {
        int ret = 0;
@@ -128,16 +116,6 @@ static int stream_buffer_init(struct stream_buf_s *stbuf, struct vdec_s *vdec)
        stbuf->canusebuf_size   = size;
        stbuf->stream_offset    = 0;
 
-       if (stbuf->use_ptsserv) {
-               /* init pts server. */
-               ret = pts_start(type_to_pts(stbuf->type));
-               if (ret < 0) {
-                       pr_err("[%d]: pts server failed\n", stbuf->id);
-                       stbuf->use_ptsserv = false;
-                       //goto err;//fixme
-               }
-               tsync_pcr_start();
-       }
        /* init thread write. */
        if (!(vdec_get_debug_flags() & 1) &&
                !codec_mm_video_tvp_enabled() &&
@@ -172,11 +150,6 @@ static void stream_buffer_release(struct stream_buf_s *stbuf)
        if (stbuf->write_thread)
                threadrw_release(stbuf);
 
-       if (stbuf->use_ptsserv) {
-               pts_stop(type_to_pts(stbuf->type));
-               tsync_pcr_stop();
-       }
-
        if (stbuf->flag & BUF_FLAG_ALLOC && stbuf->buf_start) {
                if (!stbuf->ext_buf_addr)
                        codec_mm_free_for_dma(MEM_NAME, stbuf->buf_start);