1 /* 2 * drivers/amlogic/media/stream_input/parser/thread_rw.h 3 * 4 * Copyright (C) 2016 Amlogic, Inc. All rights reserved. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 */ 17 18 #ifndef THREAD_RW_H 19 #define THREAD_RW_H 20 #include "../../stream_input/amports/streambuf_reg.h" 21 #include "../../stream_input/amports/streambuf.h" 22 #include "../../stream_input/parser/esparser.h" 23 #include "../../stream_input/amports/amports_priv.h" 24 25 ssize_t threadrw_write(struct file *file, 26 struct stream_buf_s *stbuf, 27 const char __user *buf, 28 size_t count); 29 30 void *threadrw_alloc(int num, 31 int block_size, 32 ssize_t (*write)(struct file *, 33 struct stream_buf_s *, 34 const char __user *, 35 size_t, int), 36 int flags);/*flags &1: manual mode*/ 37 38 void threadrw_release(struct stream_buf_s *stbuf); 39 40 int threadrw_buffer_level(struct stream_buf_s *stbuf); 41 int threadrw_buffer_size(struct stream_buf_s *stbuf); 42 int threadrw_datafifo_len(struct stream_buf_s *stbuf); 43 int threadrw_freefifo_len(struct stream_buf_s *stbuf); 44 int threadrw_passed_len(struct stream_buf_s *stbuf); 45 int threadrw_flush_buffers(struct stream_buf_s *stbuf); 46 int threadrw_dataoffset(struct stream_buf_s *stbuf); 47 int threadrw_alloc_more_buffer_size( 48 struct stream_buf_s *stbuf, 49 int size); 50 int threadrw_support_more_buffers(struct stream_buf_s *stbuf); 51 void threadrw_update_buffer_level(struct stream_buf_s *stbuf, 52 int parsed_size); 53 #endif 54