summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164/saa7164-api.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2010-07-31 14:48:45 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 07:54:40 -0200
commiteafea210719067eee084c047503830c59ae2107b (patch)
tree4697eb2e011697150ab4b08d70f5a0920d7a2d16 /drivers/media/video/saa7164/saa7164-api.c
parent4a52be0faa014380b7bf15c5ca7e3dea7cb4ea52 (diff)
[media] saa7164: allow the encoder GOP structure to be configured
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-api.c')
-rw-r--r--drivers/media/video/saa7164/saa7164-api.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video/saa7164/saa7164-api.c
index 5e05723fe44..5dcdf7bb12c 100644
--- a/drivers/media/video/saa7164/saa7164-api.c
+++ b/drivers/media/video/saa7164/saa7164-api.c
@@ -24,6 +24,25 @@
#include "saa7164.h"
+int saa7164_api_set_gop_size(struct saa7164_port *port)
+{
+ struct saa7164_dev *dev = port->dev;
+ tmComResEncVideoGopStructure_t gs;
+ int ret;
+
+ dprintk(DBGLVL_ENC, "%s()\n", __func__);
+
+ gs.ucRefFrameDist = SAA7164_ENCODER_DEFAULT_GOP_DIST;
+ gs.ucGOPSize = SAA7164_ENCODER_DEFAULT_GOP_SIZE;
+ ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR,
+ EU_VIDEO_GOP_STRUCTURE_CONTROL,
+ sizeof(gs), &gs);
+ if (ret != SAA_OK)
+ printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
+
+ return ret;
+}
+
int saa7164_api_set_encoder(struct saa7164_port *port)
{
struct saa7164_dev *dev = port->dev;
@@ -31,7 +50,8 @@ int saa7164_api_set_encoder(struct saa7164_port *port)
tmComResEncAudioBitRate_t ab;
int ret;
- dprintk(DBGLVL_ENC, "%s() unitid=0x%x\n", __func__, port->hwcfg.sourceid);
+ dprintk(DBGLVL_ENC, "%s() unitid=0x%x\n", __func__,
+ port->hwcfg.sourceid);
ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR,
EU_PROFILE_CONTROL, sizeof(u8), &port->encoder_profile);
@@ -57,6 +77,7 @@ int saa7164_api_set_encoder(struct saa7164_port *port)
printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
saa7164_api_set_aspect_ratio(port);
+ saa7164_api_set_gop_size(port);
return ret;
}