Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219362
b: refs/heads/master
c: eafea21
h: refs/heads/master
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 53f4e17 commit cb5bec3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a52be0faa014380b7bf15c5ca7e3dea7cb4ea52
refs/heads/master: eafea210719067eee084c047503830c59ae2107b
23 changes: 22 additions & 1 deletion trunk/drivers/media/video/saa7164/saa7164-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,34 @@

#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;
tmComResEncVideoBitRate_t vb;
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);
Expand All @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/saa7164/saa7164-reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
#define EU_PROFILE_CONTROL 0x00
#define EU_VIDEO_FORMAT_CONTROL 0x01
#define EU_VIDEO_BIT_RATE_CONTROL 0x02
#define EU_VIDEO_GOP_STRUCTURE_CONTROL 0x04
#define EU_VIDEO_INPUT_ASPECT_CONTROL 0x0A
#define EU_AUDIO_FORMAT_CONTROL 0x0C
#define EU_AUDIO_BIT_RATE_CONTROL 0x0D
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/media/video/saa7164/saa7164-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,18 @@ typedef struct
u8 height;
} __attribute__((packed)) tmComResEncVideoInputAspectRatio_t;

/* Video Encoder GOP IBP message */
/* 1. IPPPPPPPPPPPPPP */
/* 2. IBPBPBPBPBPBPBP */
/* 3. IBBPBBPBBPBBP */
#define SAA7164_ENCODER_DEFAULT_GOP_DIST ( 1)
#define SAA7164_ENCODER_DEFAULT_GOP_SIZE (15)
typedef struct
{
u8 ucGOPSize; /* GOP Size 12, 15 */
u8 ucRefFrameDist; /* Reference Frame Distance */
} __attribute__((packed)) tmComResEncVideoGopStructure_t;

/* Encoder processor definition */
typedef struct
{
Expand Down

0 comments on commit cb5bec3

Please sign in to comment.