summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-context.h
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-04-20 22:47:43 -0500
committerMike Isely <isely@pobox.com>2008-04-20 22:47:43 -0500
commit1a68129c12a81df0ef64383ac83fc4114a98b162 (patch)
treec3671a11fb887a52d48f218842abeafc145ee3bc /linux/drivers/media/video/pvrusb2/pvrusb2-context.h
parentab16d3b880be5687cb4fe4eb9f0566e57844c3a8 (diff)
downloadmediapointer-dvb-s2-1a68129c12a81df0ef64383ac83fc4114a98b162.tar.gz
mediapointer-dvb-s2-1a68129c12a81df0ef64383ac83fc4114a98b162.tar.bz2
pvrusb2: Implement input selection enforcement
From: Mike Isely <isely@pobox.com> In the pvrusb2 driver, different interfaces (e.g. V4L, DVB) have different abilities to handle various inputs. While the driver core can handle them all, the interfaces currently are not able to do this. Also, due to the fact that the DVB interface is directly touching the hardware, this limits what the V4L side can possibly do with digital reception, i.e. it has no means to control the digital tuner. This change implements a critical new feature in the driver where the interface instance can declare which inputs it is able to handle. The driver core then uses this information to narrow the list of legal input selections based on which interface(s) are active at the moment. The driver core will also perform an input switch (and consequently a mode switch) if the new narrowed list doesn't include the current mode. The overall effect of all of this is that now when a user opens the DVB interface, then the driver flips to dtv mode and likewise when the V4L video device is opened, the driver will disallow dtv selection. This also cleans up the handling of the V4L radio device - open that device and the driver will narrow to just the radio input. If the narrowing request results in the null set, e.g. attempting to narrow to dtv only while streaming analog, then the operation is disallowed and the caller gets an error. This has the effect of locking out mutually incompatible interfaces. For example, an attempt to operate a V4L interface will definitively fail when DVB is active. Thus we have locking and enforcement between the DVB and V4L sides. Hopefully at some point in the future we can expand the supported inputs in each interface, and at that point, the interface can just declare an expanded set of handled inputs and everything should continue to work itself out. This is a significant feature; it finally enables cooperative handling of pvrusb2-driven devices between DVB and V4L. Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-context.h')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-context.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-context.h b/linux/drivers/media/video/pvrusb2/pvrusb2-context.h
index 3ac224c5d..c6e25e154 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.h
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.h
@@ -70,6 +70,7 @@ struct pvr2_channel {
struct pvr2_channel *mc_prev;
struct pvr2_context_stream *stream;
struct pvr2_hdw *hdw;
+ unsigned int input_mask;
void (*check_func)(struct pvr2_channel *);
};
@@ -80,6 +81,8 @@ void pvr2_context_disconnect(struct pvr2_context *);
void pvr2_channel_init(struct pvr2_channel *,struct pvr2_context *);
void pvr2_channel_done(struct pvr2_channel *);
+int pvr2_channel_limit_inputs(struct pvr2_channel *,unsigned int);
+unsigned int pvr2_channel_get_limited_inputs(struct pvr2_channel *);
int pvr2_channel_claim_stream(struct pvr2_channel *,
struct pvr2_context_stream *);
struct pvr2_ioread *pvr2_channel_create_mpeg_stream(