本文整理匯總了C++中DEB_D函數的典型用法代碼示例。如果您正苦於以下問題:C++ DEB_D函數的具體用法?C++ DEB_D怎麽用?C++ DEB_D使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DEB_D函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: vidioc_streamoff
static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type)
{
struct saa7146_fh *fh = __fh;
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
int err;
DEB_D("VIDIOC_STREAMOFF, type:%d\n", type);
/* ugly: we need to copy some checks from video_end(),
because videobuf_streamoff() relies on the capture running.
check and fix this */
if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) {
DEB_S("not capturing\n");
return 0;
}
if (vv->video_fh != fh) {
DEB_S("capturing, but in another open\n");
return -EBUSY;
}
err = -EINVAL;
if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
err = videobuf_streamoff(&fh->video_q);
else if (type == V4L2_BUF_TYPE_VBI_CAPTURE)
err = videobuf_streamoff(&fh->vbi_q);
if (0 != err) {
DEB_D("warning: videobuf_streamoff() failed\n");
video_end(fh, file);
} else {
err = video_end(fh, file);
}
return err;
}
示例2: saa7146_res_get
int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
if (fh->resources & bit) {
DEB_D("already allocated! want: 0x%02x, cur:0x%02x\n",
bit, vv->resources);
return 1;
}
if (vv->resources & bit) {
DEB_D("locked! vv->resources:0x%02x, we want:0x%02x\n",
vv->resources, bit);
return 0;
}
fh->resources |= bit;
vv->resources |= bit;
DEB_D("res: get 0x%02x, cur:0x%02x\n", bit, vv->resources);
return 1;
}
示例3: std_callback
static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *standard)
{
struct mxb *mxb = (struct mxb *)dev->ext_priv;
if (V4L2_STD_PAL_I == standard->id) {
v4l2_std_id std = V4L2_STD_PAL_I;
DEB_D("VIDIOC_S_STD: setting mxb for PAL_I\n");
saa7146_write(dev, GPIO_CTRL, 0x00404050);
saa7111a_call(mxb, core, s_gpio, 0);
tuner_call(mxb, core, s_std, std);
} else {
v4l2_std_id std = V4L2_STD_PAL_BG;
DEB_D("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM\n");
saa7146_write(dev, GPIO_CTRL, 0x00404050);
saa7111a_call(mxb, core, s_gpio, 1);
tuner_call(mxb, core, s_std, std);
}
return 0;
}
示例4: std_callback
static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *standard)
{
struct mxb *mxb = (struct mxb *)dev->ext_priv;
if (V4L2_STD_PAL_I == standard->id) {
v4l2_std_id std = V4L2_STD_PAL_I;
DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n"));
/* set the 7146 gpio register -- I don't know what this does exactly */
saa7146_write(dev, GPIO_CTRL, 0x00404050);
/* unset the 7111 gpio register -- I don't know what this does exactly */
saa7111a_call(mxb, core, s_gpio, 0);
tuner_call(mxb, core, s_std, std);
} else {
v4l2_std_id std = V4L2_STD_PAL_BG;
DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n"));
/* set the 7146 gpio register -- I don't know what this does exactly */
saa7146_write(dev, GPIO_CTRL, 0x00404050);
/* set the 7111 gpio register -- I don't know what this does exactly */
saa7111a_call(mxb, core, s_gpio, 1);
tuner_call(mxb, core, s_std, std);
}
return 0;
}
示例5: saa7146_stop_preview
int saa7146_stop_preview(struct saa7146_fh *fh)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
DEB_EE(("dev:%p, fh:%p\n",dev,fh));
/* check if streaming capture is running */
if (IS_CAPTURE_ACTIVE(fh) != 0) {
DEB_D(("streaming capture is active.\n"));
return -EBUSY;
}
/* check if overlay is running at all */
if ((vv->video_status & STATUS_OVERLAY) == 0) {
DEB_D(("no active overlay.\n"));
return 0;
}
if (vv->video_fh != fh) {
DEB_D(("overlay is active, but in another open.\n"));
return -EBUSY;
}
vv->video_status = 0;
vv->video_fh = NULL;
saa7146_disable_overlay(fh);
saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
return 0;
}
示例6: saa7146_res_get
int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
if (fh->resources & bit) {
DEB_D(("already allocated! want: 0x%02x, cur:0x%02x\n",bit,vv->resources));
/* have it already allocated */
return 1;
}
/* is it free? */
mutex_lock(&dev->lock);
if (vv->resources & bit) {
DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));
/* no, someone else uses it */
mutex_unlock(&dev->lock);
return 0;
}
/* it's free, grab it */
fh->resources |= bit;
vv->resources |= bit;
DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources));
mutex_unlock(&dev->lock);
return 1;
}
示例7: vidioc_try_fmt_vid_overlay
static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct saa7146_vv *vv = dev->vv_data;
struct v4l2_window *win = &f->fmt.win;
enum v4l2_field field;
int maxw, maxh;
DEB_EE("dev:%p\n", dev);
if (NULL == vv->ov_fb.base) {
DEB_D("no fb base set\n");
return -EINVAL;
}
if (NULL == vv->ov_fmt) {
DEB_D("no fb fmt set\n");
return -EINVAL;
}
if (win->w.width < 48 || win->w.height < 32) {
DEB_D("min width/height. (%d,%d)\n",
win->w.width, win->w.height);
return -EINVAL;
}
if (win->clipcount > 16) {
DEB_D("clipcount too big\n");
return -EINVAL;
}
field = win->field;
maxw = vv->standard->h_max_out;
maxh = vv->standard->v_max_out;
if (V4L2_FIELD_ANY == field) {
field = (win->w.height > maxh / 2)
? V4L2_FIELD_INTERLACED
: V4L2_FIELD_TOP;
}
switch (field) {
case V4L2_FIELD_TOP:
case V4L2_FIELD_BOTTOM:
case V4L2_FIELD_ALTERNATE:
maxh = maxh / 2;
break;
case V4L2_FIELD_INTERLACED:
break;
default:
DEB_D("no known field mode '%d'\n", field);
return -EINVAL;
}
win->field = field;
if (win->w.width > maxw)
win->w.width = maxw;
if (win->w.height > maxh)
win->w.height = maxh;
return 0;
}
示例8: try_win
static int try_win(struct saa7146_dev *dev, struct v4l2_window *win)
{
struct saa7146_vv *vv = dev->vv_data;
enum v4l2_field field;
int maxw, maxh;
DEB_EE(("dev:%p\n",dev));
if (NULL == vv->ov_fb.base) {
DEB_D(("no fb base set.\n"));
return -EINVAL;
}
if (NULL == vv->ov_fmt) {
DEB_D(("no fb fmt set.\n"));
return -EINVAL;
}
if (win->w.width < 48 || win->w.height < 32) {
DEB_D(("min width/height. (%d,%d)\n",win->w.width,win->w.height));
return -EINVAL;
}
if (win->clipcount > 16) {
DEB_D(("clipcount too big.\n"));
return -EINVAL;
}
field = win->field;
maxw = vv->standard->h_max_out;
maxh = vv->standard->v_max_out;
if (V4L2_FIELD_ANY == field) {
field = (win->w.height > maxh/2)
? V4L2_FIELD_INTERLACED
: V4L2_FIELD_TOP;
}
switch (field) {
case V4L2_FIELD_TOP:
case V4L2_FIELD_BOTTOM:
case V4L2_FIELD_ALTERNATE:
maxh = maxh / 2;
break;
case V4L2_FIELD_INTERLACED:
break;
default: {
DEB_D(("no known field mode '%d'.\n",field));
return -EINVAL;
}
}
win->field = field;
if (win->w.width > maxw)
win->w.width = maxw;
if (win->w.height > maxh)
win->w.height = maxh;
return 0;
}
示例9: vidioc_s_std
static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct saa7146_vv *vv = dev->vv_data;
int found = 0;
int err, i;
DEB_EE(("VIDIOC_S_STD\n"));
if ((vv->video_status & STATUS_CAPTURE) == STATUS_CAPTURE) {
DEB_D(("cannot change video standard while streaming capture is active\n"));
return -EBUSY;
}
if ((vv->video_status & STATUS_OVERLAY) != 0) {
vv->ov_suspend = vv->video_fh;
err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */
if (0 != err) {
DEB_D(("suspending video failed. aborting\n"));
return err;
}
}
mutex_lock(&dev->lock);
for (i = 0; i < dev->ext_vv_data->num_stds; i++)
if (*id & dev->ext_vv_data->stds[i].id)
break;
if (i != dev->ext_vv_data->num_stds) {
vv->standard = &dev->ext_vv_data->stds[i];
if (NULL != dev->ext_vv_data->std_callback)
dev->ext_vv_data->std_callback(dev, vv->standard);
found = 1;
}
mutex_unlock(&dev->lock);
if (vv->ov_suspend != NULL) {
saa7146_start_preview(vv->ov_suspend);
vv->ov_suspend = NULL;
}
if (!found) {
DEB_EE(("VIDIOC_S_STD: standard not found.\n"));
return -EINVAL;
}
DEB_EE(("VIDIOC_S_STD: set to standard to '%s'\n", vv->standard->name));
return 0;
}
示例10: vidioc_s_frequency
static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency *f)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct mxb *mxb = (struct mxb *)dev->ext_priv;
struct saa7146_vv *vv = dev->vv_data;
if (f->tuner)
return -EINVAL;
if (V4L2_TUNER_ANALOG_TV != f->type)
return -EINVAL;
if (mxb->cur_input) {
DEB_D(("VIDIOC_S_FREQ: channel %d does not have a tuner!\n", mxb->cur_input));
return -EINVAL;
}
mxb->cur_freq = *f;
DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n", mxb->cur_freq.frequency));
/* tune in desired frequency */
tuner_call(mxb, tuner, s_frequency, &mxb->cur_freq);
/* hack: changing the frequency should invalidate the vbi-counter (=> alevt) */
spin_lock(&dev->slock);
vv->vbi_fieldcount = 0;
spin_unlock(&dev->slock);
return 0;
}
示例11: vidioc_s_frequency
static int vidioc_s_frequency(struct file *file, void *fh, struct v4l2_frequency *f)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct mxb *mxb = (struct mxb *)dev->ext_priv;
struct saa7146_vv *vv = dev->vv_data;
if (f->tuner)
return -EINVAL;
if (V4L2_TUNER_ANALOG_TV != f->type)
return -EINVAL;
if (mxb->cur_input) {
DEB_D("VIDIOC_S_FREQ: channel %d does not have a tuner!\n",
mxb->cur_input);
return -EINVAL;
}
mxb->cur_freq = *f;
DEB_EE("VIDIOC_S_FREQUENCY: freq:0x%08x\n", mxb->cur_freq.frequency);
tuner_call(mxb, tuner, s_frequency, &mxb->cur_freq);
spin_lock(&dev->slock);
vv->vbi_fieldcount = 0;
spin_unlock(&dev->slock);
return 0;
}
示例12: video_begin
static int video_begin(struct saa7146_fh *fh)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
struct saa7146_format *fmt = NULL;
unsigned int resource;
int ret = 0, err = 0;
DEB_EE(("dev:%p, fh:%p\n",dev,fh));
if ((vv->video_status & STATUS_CAPTURE) != 0) {
if (vv->video_fh == fh) {
DEB_S(("already capturing.\n"));
return 0;
}
DEB_S(("already capturing in another open.\n"));
return -EBUSY;
}
if ((vv->video_status & STATUS_OVERLAY) != 0) {
DEB_S(("warning: suspending overlay video for streaming capture.\n"));
vv->ov_suspend = vv->video_fh;
err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */
if (0 != err) {
DEB_D(("suspending video failed. aborting\n"));
return err;
}
}
fmt = format_by_fourcc(dev,fh->video_fmt.pixelformat);
/* we need to have a valid format set here */
BUG_ON(NULL == fmt);
if (0 != (fmt->flags & FORMAT_IS_PLANAR)) {
resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS;
} else {
resource = RESOURCE_DMA1_HPS;
}
ret = saa7146_res_get(fh, resource);
if (0 == ret) {
DEB_S(("cannot get capture resource %d\n",resource));
if (vv->ov_suspend != NULL) {
saa7146_start_preview(vv->ov_suspend);
vv->ov_suspend = NULL;
}
return -EBUSY;
}
/* clear out beginning of streaming bit (rps register 0)*/
saa7146_write(dev, MC2, MASK_27 );
/* enable rps0 irqs */
SAA7146_IER_ENABLE(dev, MASK_27);
vv->video_fh = fh;
vv->video_status = STATUS_CAPTURE;
return 0;
}
示例13: vidiocgmbuf
static int vidiocgmbuf(struct file *file, void *__fh, struct video_mbuf *mbuf)
{
struct saa7146_fh *fh = __fh;
struct videobuf_queue *q = &fh->video_q;
int err, i;
/* fixme: number of capture buffers and sizes for v4l apps */
int gbuffers = 2;
int gbufsize = 768 * 576 * 4;
DEB_D(("VIDIOCGMBUF \n"));
q = &fh->video_q;
err = videobuf_mmap_setup(q, gbuffers, gbufsize,
V4L2_MEMORY_MMAP);
if (err < 0)
return err;
gbuffers = err;
memset(mbuf, 0, sizeof(*mbuf));
mbuf->frames = gbuffers;
mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize;
return 0;
}
示例14: saa7146_start_preview
int saa7146_start_preview(struct saa7146_fh *fh)
{
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
struct v4l2_format fmt;
int ret = 0, err = 0;
DEB_EE("dev:%p, fh:%p\n", dev, fh);
/* check if we have overlay information */
if (vv->ov.fh == NULL) {
DEB_D("no overlay data available. try S_FMT first.\n");
return -EAGAIN;
}
/* check if streaming capture is running */
if (IS_CAPTURE_ACTIVE(fh) != 0) {
DEB_D("streaming capture is active\n");
return -EBUSY;
}
/* check if overlay is running */
if (IS_OVERLAY_ACTIVE(fh) != 0) {
if (vv->video_fh == fh) {
DEB_D("overlay is already active\n");
return 0;
}
DEB_D("overlay is already active in another open\n");
return -EBUSY;
}
if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) {
DEB_D("cannot get necessary overlay resources\n");
return -EBUSY;
}
fmt.fmt.win = vv->ov.win;
err = vidioc_try_fmt_vid_overlay(NULL, fh, &fmt);
if (0 != err) {
saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
return -EBUSY;
}
vv->ov.win = fmt.fmt.win;
DEB_D("%dx%d+%d+%d %s field=%s\n",
vv->ov.win.w.width, vv->ov.win.w.height,
vv->ov.win.w.left, vv->ov.win.w.top,
vv->ov_fmt->name, v4l2_field_names[vv->ov.win.field]);
if (0 != (ret = saa7146_enable_overlay(fh))) {
DEB_D("enabling overlay failed: %d\n", ret);
saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP);
return ret;
}
vv->video_status = STATUS_OVERLAY;
vv->video_fh = fh;
return 0;
}
示例15: vidioc_default
static long vidioc_default(struct file *file, void *fh, bool valid_prio,
int cmd, void *arg)
{
struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
struct mxb *mxb = (struct mxb *)dev->ext_priv;
switch (cmd) {
case MXB_S_AUDIO_CD:
{
int i = *(int *)arg;
if (i < 0 || i >= MXB_AUDIOS) {
DEB_D("invalid argument to MXB_S_AUDIO_CD: i:%d\n", i);
return -EINVAL;
}
DEB_EE("MXB_S_AUDIO_CD: i:%d\n", i);
tea6420_route_cd(mxb, i);
return 0;
}
case MXB_S_AUDIO_LINE:
{
int i = *(int *)arg;
if (i < 0 || i >= MXB_AUDIOS) {
DEB_D("invalid argument to MXB_S_AUDIO_LINE: i:%d\n",
i);
return -EINVAL;
}
DEB_EE("MXB_S_AUDIO_LINE: i:%d\n", i);
tea6420_route_line(mxb, i);
return 0;
}
default:
/*
DEB2(pr_err("does not handle this ioctl\n"));
*/
return -ENOIOCTLCMD;
}
return 0;
}