linux/drivers/staging/media/av7110/av7110_av.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * driver for the SAA7146 based AV110 cards
 * - audio and video MPEG decoder stuff
 *
 * Copyright (C) 1999-2002 Ralph  Metzler
 *                       & Marcus Metzler for convergence integrated media GmbH
 *
 * originally based on code by:
 * Copyright (C) 1998,1999 Christian Theiss <[email protected]>
 *
 * the project's page is at https://linuxtv.org
 */

#include <linux/ethtool.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/fs.h>

#include "av7110.h"
#include "av7110_hw.h"
#include "av7110_av.h"
#include "av7110_ipack.h"

/* MPEG-2 (ISO 13818 / H.222.0) stream types */
#define PROG_STREAM_MAP
#define PRIVATE_STREAM1
#define PADDING_STREAM
#define PRIVATE_STREAM2
#define AUDIO_STREAM_S
#define AUDIO_STREAM_E
#define VIDEO_STREAM_S
#define VIDEO_STREAM_E
#define ECM_STREAM
#define EMM_STREAM
#define DSM_CC_STREAM
#define ISO13522_STREAM
#define PROG_STREAM_DIR

#define PTS_DTS_FLAGS

//pts_dts flags
#define PTS_ONLY
#define PTS_DTS
#define TS_SIZE
#define TRANS_ERROR
#define PAY_START
#define TRANS_PRIO
#define PID_MASK_HI
//flags
#define TRANS_SCRMBL1
#define TRANS_SCRMBL2
#define ADAPT_FIELD
#define PAYLOAD
#define COUNT_MASK

// adaptation flags
#define DISCON_IND
#define RAND_ACC_IND
#define ES_PRI_IND
#define PCR_FLAG
#define OPCR_FLAG
#define SPLICE_FLAG
#define TRANS_PRIV
#define ADAP_EXT_FLAG

// adaptation extension flags
#define LTW_FLAG
#define PIECE_RATE
#define SEAM_SPLICE

static void p_to_t(u8 const *buf, long length, u16 pid,
		   u8 *counter, struct dvb_demux_feed *feed);
static int write_ts_to_decoder(struct av7110 *av7110, int type, const u8 *buf, size_t len);

int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
{}

static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
{}

int av7110_av_start_record(struct av7110 *av7110, int av,
			   struct dvb_demux_feed *dvbdmxfeed)
{}

int av7110_av_start_play(struct av7110 *av7110, int av)
{}

int av7110_av_stop(struct av7110 *av7110, int av)
{}

int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
{}

int av7110_set_volume(struct av7110 *av7110, unsigned int volleft,
		      unsigned int volright)
{}

int av7110_set_vidmode(struct av7110 *av7110, enum av7110_video_mode mode)
{}

static enum av7110_video_mode sw2mode[16] =;

static int get_video_format(struct av7110 *av7110, u8 *buf, int count)
{}

/****************************************************************************
 * I/O buffer management and control
 ****************************************************************************/

static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf,
					 const u8 *buf, unsigned long count)
{}

static void play_video_cb(u8 *buf, int count, void *priv)
{}

static void play_audio_cb(u8 *buf, int count, void *priv)
{}

#define FREE_COND_TS

static ssize_t ts_play(struct av7110 *av7110, const char __user *buf,
		       unsigned long count, int nonblock, int type)
{}

#define FREE_COND

static ssize_t dvb_play(struct av7110 *av7110, const char __user *buf,
			unsigned long count, int nonblock, int type)
{}

static ssize_t dvb_play_kernel(struct av7110 *av7110, const u8 *buf,
			       unsigned long count, int nonblock, int type)
{}

static ssize_t dvb_aplay(struct av7110 *av7110, const char __user *buf,
			 unsigned long count, int nonblock, int type)
{}

void av7110_p2t_init(struct av7110_p2t *p, struct dvb_demux_feed *feed)
{}

static void clear_p2t(struct av7110_p2t *p)
{}

static int find_pes_header(u8 const *buf, long length, int *frags)
{}

void av7110_p2t_write(u8 const *buf, long length, u16 pid, struct av7110_p2t *p)
{}

static int write_ts_header2(u16 pid, u8 *counter, int pes_start, u8 *buf, u8 length)
{}

static void p_to_t(u8 const *buf, long length, u16 pid, u8 *counter,
		   struct dvb_demux_feed *feed)
{}

static int write_ts_to_decoder(struct av7110 *av7110, int type, const u8 *buf, size_t len)
{}

int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t len)
{}

/******************************************************************************
 * Video MPEG decoder events
 ******************************************************************************/
void dvb_video_add_event(struct av7110 *av7110, struct video_event *event)
{}

static int dvb_video_get_event(struct av7110 *av7110, struct video_event *event, int flags)
{}

/******************************************************************************
 * DVB device file operations
 ******************************************************************************/

static __poll_t dvb_video_poll(struct file *file, poll_table *wait)
{}

static ssize_t dvb_video_write(struct file *file, const char __user *buf,
			       size_t count, loff_t *ppos)
{}

static __poll_t dvb_audio_poll(struct file *file, poll_table *wait)
{}

static ssize_t dvb_audio_write(struct file *file, const char __user *buf,
			       size_t count, loff_t *ppos)
{}

static u8 iframe_header[] =;

#define MIN_IFRAME

static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len, int nonblock)
{}

#ifdef CONFIG_COMPAT
struct compat_video_still_picture {};

#define VIDEO_STILLPICTURE32

struct compat_video_event {};

#define VIDEO_GET_EVENT32

static int dvb_compat_video_get_event(struct av7110 *av7110,
				      struct compat_video_event *event, int flags)
{}
#endif

static int dvb_video_ioctl(struct file *file,
			   unsigned int cmd, void *parg)
{}

static int dvb_audio_ioctl(struct file *file,
			   unsigned int cmd, void *parg)
{}

static int dvb_video_open(struct inode *inode, struct file *file)
{}

static int dvb_video_release(struct inode *inode, struct file *file)
{}

static int dvb_audio_open(struct inode *inode, struct file *file)
{}

static int dvb_audio_release(struct inode *inode, struct file *file)
{}

/******************************************************************************
 * driver registration
 ******************************************************************************/

static const struct file_operations dvb_video_fops =;

static struct dvb_device dvbdev_video =;

static const struct file_operations dvb_audio_fops =;

static struct dvb_device dvbdev_audio =;

int av7110_av_register(struct av7110 *av7110)
{}

void av7110_av_unregister(struct av7110 *av7110)
{}

int av7110_av_init(struct av7110 *av7110)
{}

void av7110_av_exit(struct av7110 *av7110)
{}