Path: blob/master/drivers/media/video/cx18/cx18-streams.h
17768 views
/*1* cx18 init/start/stop/exit stream functions2*3* Derived from ivtv-streams.h4*5* Copyright (C) 2007 Hans Verkuil <[email protected]>6* Copyright (C) 2008 Andy Walls <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA21* 02111-1307 USA22*/2324u32 cx18_find_handle(struct cx18 *cx);25struct cx18_stream *cx18_handle_to_stream(struct cx18 *cx, u32 handle);26int cx18_streams_setup(struct cx18 *cx);27int cx18_streams_register(struct cx18 *cx);28void cx18_streams_cleanup(struct cx18 *cx, int unregister);2930#define CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN (3)31void cx18_stream_rotate_idx_mdls(struct cx18 *cx);3233static inline bool cx18_stream_enabled(struct cx18_stream *s)34{35return s->video_dev ||36(s->dvb && s->dvb->enabled) ||37(s->type == CX18_ENC_STREAM_TYPE_IDX &&38s->cx->stream_buffers[CX18_ENC_STREAM_TYPE_IDX] != 0);39}4041/* Related to submission of mdls to firmware */42static inline void cx18_stream_load_fw_queue(struct cx18_stream *s)43{44schedule_work(&s->out_work_order);45}4647static inline void cx18_stream_put_mdl_fw(struct cx18_stream *s,48struct cx18_mdl *mdl)49{50/* Put mdl on q_free; the out work handler will move mdl(s) to q_busy */51cx18_enqueue(s, mdl, &s->q_free);52cx18_stream_load_fw_queue(s);53}5455void cx18_out_work_handler(struct work_struct *work);5657/* Capture related */58int cx18_start_v4l2_encode_stream(struct cx18_stream *s);59int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end);6061void cx18_stop_all_captures(struct cx18 *cx);626364