Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176830
b: refs/heads/master
c: 2e535ed
h: refs/heads/master
v: v3
  • Loading branch information
Muralidharan Karicheri authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent 6d9c7c2 commit 37f2102
Show file tree
Hide file tree
Showing 3 changed files with 49 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: 579e7d60ba0035228aadad69eb2ffeb138c51311
refs/heads/master: 2e535ed5a16b8cc23301f3d26cfd49f3091aadcc
47 changes: 47 additions & 0 deletions trunk/drivers/media/video/v4l2-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,3 +1024,50 @@ void v4l_bound_align_image(u32 *w, unsigned int wmin, unsigned int wmax,
}
}
EXPORT_SYMBOL_GPL(v4l_bound_align_image);

/**
* v4l_fill_dv_preset_info - fill description of a digital video preset
* @preset - preset value
* @info - pointer to struct v4l2_dv_enum_preset
*
* drivers can use this helper function to fill description of dv preset
* in info.
*/
int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info)
{
static const struct v4l2_dv_preset_info {
u16 width;
u16 height;
const char *name;
} dv_presets[] = {
{ 0, 0, "Invalid" }, /* V4L2_DV_INVALID */
{ 720, 480, "480p@59.94" }, /* V4L2_DV_480P59_94 */
{ 720, 576, "576p@50" }, /* V4L2_DV_576P50 */
{ 1280, 720, "720p@24" }, /* V4L2_DV_720P24 */
{ 1280, 720, "720p@25" }, /* V4L2_DV_720P25 */
{ 1280, 720, "720p@30" }, /* V4L2_DV_720P30 */
{ 1280, 720, "720p@50" }, /* V4L2_DV_720P50 */
{ 1280, 720, "720p@59.94" }, /* V4L2_DV_720P59_94 */
{ 1280, 720, "720p@60" }, /* V4L2_DV_720P60 */
{ 1920, 1080, "1080i@29.97" }, /* V4L2_DV_1080I29_97 */
{ 1920, 1080, "1080i@30" }, /* V4L2_DV_1080I30 */
{ 1920, 1080, "1080i@25" }, /* V4L2_DV_1080I25 */
{ 1920, 1080, "1080i@50" }, /* V4L2_DV_1080I50 */
{ 1920, 1080, "1080i@60" }, /* V4L2_DV_1080I60 */
{ 1920, 1080, "1080p@24" }, /* V4L2_DV_1080P24 */
{ 1920, 1080, "1080p@25" }, /* V4L2_DV_1080P25 */
{ 1920, 1080, "1080p@30" }, /* V4L2_DV_1080P30 */
{ 1920, 1080, "1080p@50" }, /* V4L2_DV_1080P50 */
{ 1920, 1080, "1080p@60" }, /* V4L2_DV_1080P60 */
};

if (info == NULL || preset >= ARRAY_SIZE(dv_presets))
return -EINVAL;

info->preset = preset;
info->width = dv_presets[preset].width;
info->height = dv_presets[preset].height;
strlcpy(info->name, dv_presets[preset].name, sizeof(info->name));
return 0;
}
EXPORT_SYMBOL_GPL(v4l_fill_dv_preset_info);
2 changes: 1 addition & 1 deletion trunk/include/media/v4l2-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,5 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
unsigned int *h, unsigned int hmin,
unsigned int hmax, unsigned int halign,
unsigned int salign);

int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info);
#endif /* V4L2_COMMON_H_ */

0 comments on commit 37f2102

Please sign in to comment.