summaryrefslogtreecommitdiff
path: root/libgscaler/libgscaler_media.h
blob: 40925869f32c3915d71992ed0234735a1d9b6743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
 * Copyright@ Samsung Electronics Co. LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

#ifndef LIBGSCALER_MEDIA_H_
#define LIBGSCALER_MEDIA_H_

/* V4L2_SUBDEV */
#include <linux/v4l2-subdev.h>

#ifdef __GNUC__
#  define __UNUSED__ __attribute__((__unused__))
#else
#  define __UNUSED__
#endif

__BEGIN_DECLS

/*! \ingroup exynos_v4l2 */
int exynos_subdev_open(const char *filename, int oflag, ...);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_get_node_num(const char *devname, int oflag, ...);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_open_devname(const char *devname, int oflag, ...);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_close(int fd);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_enum_frame_size(int fd, struct v4l2_subdev_frame_size_enum *frame_size_enum);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_g_fmt(int fd, struct v4l2_subdev_format *fmt);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_s_fmt(int fd, struct v4l2_subdev_format *fmt);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_g_crop(int fd, struct v4l2_subdev_crop *crop);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_s_crop(int fd, struct v4l2_subdev_crop *crop);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_enum_frame_interval(int fd, struct v4l2_subdev_frame_interval_enum *frame_internval_enum);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_g_frame_interval(int fd, struct v4l2_subdev_frame_interval *frame_internval_enum);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_s_frame_interval(int fd, struct v4l2_subdev_frame_interval *frame_internval_enum);
/*! \ingroup exynos_v4l2 */
int exynos_subdev_enum_mbus_code(int fd, struct v4l2_subdev_mbus_code_enum *mbus_code_enum);
/* MEDIA CONTORLLER */
#include <linux/media.h>

/*! media_link
 * \ingroup exynos_v4l2
 */
struct media_link {
    struct media_pad *source;
    struct media_pad *sink;
    struct media_link *twin;
    __u32 flags;
    __u32 padding[3];
};

/*! media_link
 * \ingroup exynos_v4l2
 */
struct media_pad {
    struct media_entity *entity;
    __u32 index;
    __u32 flags;
    __u32 padding[3];
};

/*! media_link
 * \ingroup exynos_v4l2
 */
struct media_entity {
    struct media_device *media;
    struct media_entity_desc info;
    struct media_pad *pads;
    struct media_link *links;
    unsigned int max_links;
    unsigned int num_links;

    char devname[32];
    int fd;
    __u32 padding[6];
};

/*! media_link
 * \ingroup exynos_v4l2
 */
struct media_device {
    int fd;
    struct media_entity *entities;
    unsigned int entities_count;
    void (*debug_handler)(void *, ...);
    void *debug_priv;
    __u32 padding[6];
};

__END_DECLS

#endif /* LIBGSCALER_MEDIA_H_  */