Mediatext test program for request API tests
cover Mediatext test program for request API tests
Hi folks,
Here's a refreshed RFC set to add the mediatext test program. It is well suited for testing requests, as it can work with multiple devices simultaneously as well as is easy to control through a bash script.
Only buffers are supported with requests, controls are not yet; still adding support for controls wouldn't be much of work. I'm posting this as RFC as the API coverage isn't great. What works now (as in this test program) is requests with vim2m --- two bash scripts are included in the last patch for that. The request API set v9 requires some adjusting, I haven't tested v10 yet.
I'd say this is much closer being a meaningful part of v4l-utils, assuming more test programs are seen to fit there.
Comments would be welcome.
Sakari Ailus (6):
Linux kernel header update
Make v4l-utils compile with request-related changes
libmediactl: Add open, close and fd to public API
mediatext: Extract list of V4L2 pixel format strings and 4cc codes
mediatext: Add library
mediatext: Add vivid tests
include/linux/cec-funcs.h | 300 ++-- include/linux/cec.h | 40 +- include/linux/media.h | 8 + include/linux/v4l2-dv-timings.h | 979 ++++++++++++ include/linux/videodev2.h | 14 +- lib/libv4l2/libv4l2.c | 4 +- libmediatext.pc.in | 10 + utils/media-ctl/Makefile.am | 18 +- utils/media-ctl/libmediactl.c | 9 +- utils/media-ctl/libmediatext.pc.in | 10 + utils/media-ctl/mediactl.h | 4 + utils/media-ctl/mediatext-test.c | 127 ++ utils/media-ctl/mediatext.c | 2176 ++++++++++++++++++++++++++ utils/media-ctl/mediatext.h | 33 + utils/media-ctl/tests/test-vivid-mc.bash | 86 + utils/media-ctl/tests/test-vivid.bash | 59 + utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +- utils/v4l2-compliance/v4l2-test-controls.cpp | 4 - 18 files changed, 3699 insertions(+), 184 deletions(-) create mode 100644 include/linux/v4l2-dv-timings.h create mode 100644 libmediatext.pc.in create mode 100644 utils/media-ctl/libmediatext.pc.in create mode 100644 utils/media-ctl/mediatext-test.c create mode 100644 utils/media-ctl/mediatext.c create mode 100644 utils/media-ctl/mediatext.h create mode 100755 utils/media-ctl/tests/test-vivid-mc.bash create mode 100755 utils/media-ctl/tests/test-vivid.bash
Signature · 1 line
2.7.4
RFC 2/6 Make v4l-utils compile with request-related changes
Mostly remove zero reserved field checks.
--- lib/libv4l2/libv4l2.c | 4 ++-- utils/v4l2-compliance/v4l2-test-buffers.cpp | 2 +- utils/v4l2-compliance/v4l2-test-controls.cpp | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-)
lib/libv4l2/libv4l2.c +2 -2
@@ -190,7 +190,7 @@ static int v4l2_map_buffers(int index) buf.type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; buf.memory =V4L2_MEMORY_MMAP ; buf.index = i; - buf.reserved = buf.reserved2 =0 ; + buf.reserved = buf.request_fd =0 ; result = devices[index].dev_ops->ioctl ( devices[index].dev_ops_priv, devices[index].fd,VIDIOC_QUERYBUF , &buf);
@@ -579,7 +579,7 @@ static int v4l2_buffers_mapped(int index) buf.type =V4L2_BUF_TYPE_VIDEO_CAPTURE ; buf.memory =V4L2_MEMORY_MMAP ; buf.index = i; - buf.reserved = buf.reserved2 =0 ; + buf.reserved = buf.request_fd =0 ; if (devices[index].dev_ops->ioctl( devices[index].dev_ops_priv, devices[index].fd, VIDIOC_QUERYBUF,
utils/v4l2-compliance/v4l2-test-buffers.cpp +1 -1
@@ -196,7 +196,7 @@ int buffer::check(unsigned type, unsigned memory, unsigned index, fail_on_test(g_memory() != memory); fail_on_test(g_index() >= VIDEO_MAX_FRAME); fail_on_test(g_index() != index); - fail_on_test(buf.reserved2 || buf.reserved); + fail_on_test(buf.request_fd || buf.reserved); fail_on_test(timestamp != V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC && timestamp != V4L2_BUF_FLAG_TIMESTAMP_COPY); fail_on_test(timestamp_src != V4L2_BUF_FLAG_TSTAMP_SRC_SOE &&
utils/v4l2-compliance/v4l2-test-controls.cpp +0 -4
@@ -589,8 +589,6 @@ int testExtendedControls(struct node *node) return fail("field which changed\n"); if (ctrls.count) return fail("field count changed\n"); - if (check_0(ctrls.reserved, sizeof(ctrls.reserved))) - return fail("reserved not zeroed\n"); memset(&ctrls, 0, sizeof(ctrls)); ret = doioctl(node, VIDIOC_TRY_EXT_CTRLS, &ctrls);
@@ -602,8 +600,6 @@ int testExtendedControls(struct node *node) return fail("field which changed\n"); if (ctrls.count) return fail("field count changed\n"); - if (check_0(ctrls.reserved, sizeof(ctrls.reserved))) - return fail("reserved not zeroed\n"); for (iter = node->controls.begin(); iter != node->controls.end(); ++iter) { test_query_ext_ctrl &qctrl = iter->second;
Signature · 1 line
2.7.4
RFC 3/6 libmediactl: Add open, close and fd to public API
In reply to Sakari AilusAdd functions to open and close the media device as well as to obtain its fd.
--- utils/media-ctl/libmediactl.c | 9 +++++++-- utils/media-ctl/mediactl.h | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-)
utils/media-ctl/libmediactl.c +7 -2
@@ -175,7 +175,7 @@ const struct media_entity_desc *media_entity_get_info(struct media_entity *entit* Open/close */ -static int media_device_open (struct media_device *media) +int media_device_open (struct media_device *media) {int ret;
@@ -195,7 +195,12 @@ static int media_device_open(struct media_device *media)return 0 ; } -static void media_device_close (struct media_device *media) +int media_device_fd (struct media_device *media) +{ +return media->fd; +} + +void media_device_close (struct media_device *media) {if (media->fd !=-1 ) {close (media->fd);
utils/media-ctl/mediactl.h +4 -0
@@ -59,6 +59,10 @@ struct media_entity;*/ struct media_device *media_device_new (const char *devnode); +int media_device_open (struct media_device *media); +int media_device_fd (struct media_device *media); +void media_device_close (struct media_device *media); +/** * @brief Create a new emulated media device. * @param info - device information.
Signature · 1 line
2.7.4
RFC 4/6 mediatext: Extract list of V4L2 pixel format strings and 4cc codes
In reply to Sakari AilusExtract the list of V4L2 pixel format strings and 4cc codes from videodev2.h for use in mediatext in order to convert user given format names to 4cc codes that IOCTLs use.
--- utils/media-ctl/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
utils/media-ctl/Makefile.am +6 -1
@@ -12,7 +12,12 @@ media-bus-format-codes.h: ../../include/linux/media-bus-format.h sed -e '/#define MEDIA_BUS_FMT/ ! d; s/.*#define //; /FIXED/ d; s/\t.*//; s/.*/ &,/;' \ < $< > $@ -BUILT_SOURCES = media-bus-format-names.h media-bus-format-codes.h +v4l2-pix-formats.h: ../../include/linux/videodev2.h + sed -e '/#define V4L2_PIX_FMT_/ ! d; s/.*FMT_//; s/[\t ].*//; s/.*/{ \"&\", V4L2_PIX_FMT_& },/;' \ + < $< > $@ + +BUILT_SOURCES = media-bus-format-names.h media-bus-format-codes.h \ + v4l2-pix-formats.h CLEANFILES = $(BUILT_SOURCES) nodist_libv4l2subdev_la_SOURCES = $(BUILT_SOURCES)
Signature · 1 line
2.7.4
RFC 1/6 Linux kernel header update
In reply to Sakari AilusThis includes kernel headers up to Hans's request API v9 patchset.
--- include/linux/cec-funcs.h | 300 ++++++------ include/linux/cec.h | 40 +- include/linux/media.h | 8 + include/linux/v4l2-dv-timings.h | 979 ++++++++++++++++++++++++++++++++++++++++ include/linux/videodev2.h | 14 +- 5 files changed, 1169 insertions(+), 172 deletions(-) create mode 100644 include/linux/v4l2-dv-timings.h
include/linux/cec-funcs.h +150 -150
@@ -11,7 +11,7 @@#include <linux/cec.h> /* One Touch Play Feature */ -static inline void cec_msg_active_source (struct cec_msg *msg,__u16 phys_addr) +static __inline__void cec_msg_active_source (struct cec_msg *msg,__u16 phys_addr) { msg->len =4 ; msg->msg[0 ] |=0xf ;/* broadcast */
@@ -20,19 +20,19 @@ static inline void cec_msg_active_source(struct cec_msg *msg, __u16 phys_addr) msg->msg[3 ] = phys_addr &0xff ; } -static inline void cec_ops_active_source (const struct cec_msg *msg, +static __inline__void cec_ops_active_source (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; } -static inline void cec_msg_image_view_on (struct cec_msg *msg) +static __inline__void cec_msg_image_view_on (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_IMAGE_VIEW_ON ; } -static inline void cec_msg_text_view_on (struct cec_msg *msg) +static __inline__void cec_msg_text_view_on (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_TEXT_VIEW_ON ;
@@ -40,7 +40,7 @@ static inline void cec_msg_text_view_on(struct cec_msg *msg)/* Routing Control Feature */ -static inline void cec_msg_inactive_source (struct cec_msg *msg, +static __inline__void cec_msg_inactive_source (struct cec_msg *msg,__u16 phys_addr) { msg->len =4 ;
@@ -49,13 +49,13 @@ static inline void cec_msg_inactive_source(struct cec_msg *msg, msg->msg[3 ] = phys_addr &0xff ; } -static inline void cec_ops_inactive_source (const struct cec_msg *msg, +static __inline__void cec_ops_inactive_source (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; } -static inline void cec_msg_request_active_source (struct cec_msg *msg, +static __inline__void cec_msg_request_active_source (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -64,7 +64,7 @@ static inline void cec_msg_request_active_source(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_ACTIVE_SOURCE :0 ; } -static inline void cec_msg_routing_information (struct cec_msg *msg, +static __inline__void cec_msg_routing_information (struct cec_msg *msg,__u16 phys_addr) { msg->len =4 ;
@@ -74,13 +74,13 @@ static inline void cec_msg_routing_information(struct cec_msg *msg, msg->msg[3 ] = phys_addr &0xff ; } -static inline void cec_ops_routing_information (const struct cec_msg *msg, +static __inline__void cec_ops_routing_information (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; } -static inline void cec_msg_routing_change (struct cec_msg *msg, +static __inline__void cec_msg_routing_change (struct cec_msg *msg,int reply,__u16 orig_phys_addr,__u16 new_phys_addr)
@@ -95,7 +95,7 @@ static inline void cec_msg_routing_change(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_ROUTING_INFORMATION :0 ; } -static inline void cec_ops_routing_change (const struct cec_msg *msg, +static __inline__void cec_ops_routing_change (const struct cec_msg *msg,__u16 *orig_phys_addr,__u16 *new_phys_addr) {
@@ -103,7 +103,7 @@ static inline void cec_ops_routing_change(const struct cec_msg *msg, *new_phys_addr = (msg->msg[4 ] <<8 ) | msg->msg[5 ]; } -static inline void cec_msg_set_stream_path (struct cec_msg *msg,__u16 phys_addr) +static __inline__void cec_msg_set_stream_path (struct cec_msg *msg,__u16 phys_addr) { msg->len =4 ; msg->msg[0 ] |=0xf ;/* broadcast */
@@ -112,7 +112,7 @@ static inline void cec_msg_set_stream_path(struct cec_msg *msg, __u16 phys_addr) msg->msg[3 ] = phys_addr &0xff ; } -static inline void cec_ops_set_stream_path (const struct cec_msg *msg, +static __inline__void cec_ops_set_stream_path (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ];
@@ -120,7 +120,7 @@ static inline void cec_ops_set_stream_path(const struct cec_msg *msg,/* Standby Feature */ -static inline void cec_msg_standby (struct cec_msg *msg) +static __inline__void cec_msg_standby (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_STANDBY ;
@@ -128,7 +128,7 @@ static inline void cec_msg_standby(struct cec_msg *msg)/* One Touch Record Feature */ -static inline void cec_msg_record_off (struct cec_msg *msg,int reply) +static __inline__void cec_msg_record_off (struct cec_msg *msg,int reply) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_RECORD_OFF ;
@@ -187,7 +187,7 @@ struct cec_op_record_src { }; }; -static inline void cec_set_digital_service_id (__u8 *msg, +static __inline__void cec_set_digital_service_id (__u8 *msg,const struct cec_op_digital_service_id *digital) { *msg++ = (digital->service_id_method <<7 ) | digital->dig_bcast_system;
@@ -224,7 +224,7 @@ static inline void cec_set_digital_service_id(__u8 *msg, } } -static inline void cec_get_digital_service_id (const __u8 *msg, +static __inline__void cec_get_digital_service_id (const __u8 *msg,struct cec_op_digital_service_id *digital) { digital->service_id_method = msg[0 ] >>7 ;
@@ -240,14 +240,14 @@ static inline void cec_get_digital_service_id(const __u8 *msg, digital->dvb.orig_network_id = (msg[5 ] <<8 ) | msg[6 ]; } -static inline void cec_msg_record_on_own (struct cec_msg *msg) +static __inline__void cec_msg_record_on_own (struct cec_msg *msg) { msg->len =3 ; msg->msg[1 ] =CEC_MSG_RECORD_ON ; msg->msg[2 ] =CEC_OP_RECORD_SRC_OWN ; } -static inline void cec_msg_record_on_digital (struct cec_msg *msg, +static __inline__void cec_msg_record_on_digital (struct cec_msg *msg,const struct cec_op_digital_service_id *digital) { msg->len =10 ;
@@ -256,7 +256,7 @@ static inline void cec_msg_record_on_digital(struct cec_msg *msg,cec_set_digital_service_id (msg->msg +3 , digital); } -static inline void cec_msg_record_on_analog (struct cec_msg *msg, +static __inline__void cec_msg_record_on_analog (struct cec_msg *msg,__u8 ana_bcast_type,__u16 ana_freq,__u8 bcast_system)
@@ -270,7 +270,7 @@ static inline void cec_msg_record_on_analog(struct cec_msg *msg, msg->msg[6 ] = bcast_system; } -static inline void cec_msg_record_on_plug (struct cec_msg *msg, +static __inline__void cec_msg_record_on_plug (struct cec_msg *msg,__u8 plug) { msg->len =4 ;
@@ -279,7 +279,7 @@ static inline void cec_msg_record_on_plug(struct cec_msg *msg, msg->msg[3 ] = plug; } -static inline void cec_msg_record_on_phys_addr (struct cec_msg *msg, +static __inline__void cec_msg_record_on_phys_addr (struct cec_msg *msg,__u16 phys_addr) { msg->len =5 ;
@@ -289,7 +289,7 @@ static inline void cec_msg_record_on_phys_addr(struct cec_msg *msg, msg->msg[4 ] = phys_addr &0xff ; } -static inline void cec_msg_record_on (struct cec_msg *msg, +static __inline__void cec_msg_record_on (struct cec_msg *msg,int reply,const struct cec_op_record_src *rec_src) {
@@ -317,7 +317,7 @@ static inline void cec_msg_record_on(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_RECORD_STATUS :0 ; } -static inline void cec_ops_record_on (const struct cec_msg *msg, +static __inline__void cec_ops_record_on (const struct cec_msg *msg,struct cec_op_record_src *rec_src) { rec_src->type = msg->msg[2 ];
@@ -343,20 +343,20 @@ static inline void cec_ops_record_on(const struct cec_msg *msg, } } -static inline void cec_msg_record_status (struct cec_msg *msg,__u8 rec_status) +static __inline__void cec_msg_record_status (struct cec_msg *msg,__u8 rec_status) { msg->len =3 ; msg->msg[1 ] =CEC_MSG_RECORD_STATUS ; msg->msg[2 ] = rec_status; } -static inline void cec_ops_record_status (const struct cec_msg *msg, +static __inline__void cec_ops_record_status (const struct cec_msg *msg,__u8 *rec_status) { *rec_status = msg->msg[2 ]; } -static inline void cec_msg_record_tv_screen (struct cec_msg *msg, +static __inline__void cec_msg_record_tv_screen (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -366,7 +366,7 @@ static inline void cec_msg_record_tv_screen(struct cec_msg *msg,/* Timer Programming Feature */ -static inline void cec_msg_timer_status(struct cec_msg *msg, +static __inline__ void cec_msg_timer_status(struct cec_msg *msg, __u8 timer_overlap_warning, __u8 media_info, __u8 prog_info,
@@ -389,7 +389,7 @@ static inline void cec_msg_timer_status(struct cec_msg *msg, } } -static inline void cec_ops_timer_status(const struct cec_msg *msg, +static __inline__ void cec_ops_timer_status(const struct cec_msg *msg, __u8 *timer_overlap_warning, __u8 *media_info, __u8 *prog_info,
@@ -416,7 +416,7 @@ static inline void cec_ops_timer_status(const struct cec_msg *msg, } } -static inline void cec_msg_timer_cleared_status (struct cec_msg *msg, +static __inline__void cec_msg_timer_cleared_status (struct cec_msg *msg,__u8 timer_cleared_status) { msg->len =3 ;
@@ -424,13 +424,13 @@ static inline void cec_msg_timer_cleared_status(struct cec_msg *msg, msg->msg[2 ] = timer_cleared_status; } -static inline void cec_ops_timer_cleared_status (const struct cec_msg *msg, +static __inline__void cec_ops_timer_cleared_status (const struct cec_msg *msg,__u8 *timer_cleared_status) { *timer_cleared_status = msg->msg[2 ]; } -static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg, +static __inline__ void cec_msg_clear_analogue_timer(struct cec_msg *msg, int reply, __u8 day, __u8 month,
@@ -460,7 +460,7 @@ static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_TIMER_CLEARED_STATUS :0 ; } -static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg, +static __inline__ void cec_ops_clear_analogue_timer(const struct cec_msg *msg, __u8 *day, __u8 *month, __u8 *start_hr,
@@ -485,7 +485,7 @@ static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg, *bcast_system = msg->msg[12 ]; } -static inline void cec_msg_clear_digital_timer(struct cec_msg *msg, +static __inline__ void cec_msg_clear_digital_timer(struct cec_msg *msg, int reply, __u8 day, __u8 month,
@@ -510,7 +510,7 @@ static inline void cec_msg_clear_digital_timer(struct cec_msg *msg,cec_set_digital_service_id (msg->msg +9 , digital); } -static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg, +static __inline__ void cec_ops_clear_digital_timer(const struct cec_msg *msg, __u8 *day, __u8 *month, __u8 *start_hr,
@@ -531,7 +531,7 @@ static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg,cec_get_digital_service_id (msg->msg +9 , digital); } -static inline void cec_msg_clear_ext_timer(struct cec_msg *msg, +static __inline__ void cec_msg_clear_ext_timer(struct cec_msg *msg, int reply, __u8 day, __u8 month,
@@ -561,7 +561,7 @@ static inline void cec_msg_clear_ext_timer(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_TIMER_CLEARED_STATUS :0 ; } -static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg, +static __inline__ void cec_ops_clear_ext_timer(const struct cec_msg *msg, __u8 *day, __u8 *month, __u8 *start_hr,
@@ -586,7 +586,7 @@ static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg, *phys_addr = (msg->msg[11 ] <<8 ) | msg->msg[12 ]; } -static inline void cec_msg_set_analogue_timer(struct cec_msg *msg, +static __inline__ void cec_msg_set_analogue_timer(struct cec_msg *msg, int reply, __u8 day, __u8 month,
@@ -616,7 +616,7 @@ static inline void cec_msg_set_analogue_timer(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_TIMER_STATUS :0 ; } -static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg, +static __inline__ void cec_ops_set_analogue_timer(const struct cec_msg *msg, __u8 *day, __u8 *month, __u8 *start_hr,
@@ -641,7 +641,7 @@ static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg, *bcast_system = msg->msg[12 ]; } -static inline void cec_msg_set_digital_timer(struct cec_msg *msg, +static __inline__ void cec_msg_set_digital_timer(struct cec_msg *msg, int reply, __u8 day, __u8 month,
@@ -666,7 +666,7 @@ static inline void cec_msg_set_digital_timer(struct cec_msg *msg,cec_set_digital_service_id (msg->msg +9 , digital); } -static inline void cec_ops_set_digital_timer(const struct cec_msg *msg, +static __inline__ void cec_ops_set_digital_timer(const struct cec_msg *msg, __u8 *day, __u8 *month, __u8 *start_hr,
@@ -687,7 +687,7 @@ static inline void cec_ops_set_digital_timer(const struct cec_msg *msg,cec_get_digital_service_id (msg->msg +9 , digital); } -static inline void cec_msg_set_ext_timer(struct cec_msg *msg, +static __inline__ void cec_msg_set_ext_timer(struct cec_msg *msg, int reply, __u8 day, __u8 month,
@@ -717,7 +717,7 @@ static inline void cec_msg_set_ext_timer(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_TIMER_STATUS :0 ; } -static inline void cec_ops_set_ext_timer(const struct cec_msg *msg, +static __inline__ void cec_ops_set_ext_timer(const struct cec_msg *msg, __u8 *day, __u8 *month, __u8 *start_hr,
@@ -742,7 +742,7 @@ static inline void cec_ops_set_ext_timer(const struct cec_msg *msg, *phys_addr = (msg->msg[11 ] <<8 ) | msg->msg[12 ]; } -static inline void cec_msg_set_timer_program_title (struct cec_msg *msg, +static __inline__void cec_msg_set_timer_program_title (struct cec_msg *msg,const char *prog_title) {unsigned int len =strlen (prog_title);
@@ -754,7 +754,7 @@ static inline void cec_msg_set_timer_program_title(struct cec_msg *msg,memcpy (msg->msg +2 , prog_title, len); } -static inline void cec_ops_set_timer_program_title (const struct cec_msg *msg, +static __inline__void cec_ops_set_timer_program_title (const struct cec_msg *msg,char *prog_title) {unsigned int len = msg->len >2 ? msg->len -2 :0 ;
@@ -766,20 +766,20 @@ static inline void cec_ops_set_timer_program_title(const struct cec_msg *msg, }/* System Information Feature */ -static inline void cec_msg_cec_version (struct cec_msg *msg,__u8 cec_version) +static __inline__void cec_msg_cec_version (struct cec_msg *msg,__u8 cec_version) { msg->len =3 ; msg->msg[1 ] =CEC_MSG_CEC_VERSION ; msg->msg[2 ] = cec_version; } -static inline void cec_ops_cec_version (const struct cec_msg *msg, +static __inline__void cec_ops_cec_version (const struct cec_msg *msg,__u8 *cec_version) { *cec_version = msg->msg[2 ]; } -static inline void cec_msg_get_cec_version (struct cec_msg *msg, +static __inline__void cec_msg_get_cec_version (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -787,7 +787,7 @@ static inline void cec_msg_get_cec_version(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_CEC_VERSION :0 ; } -static inline void cec_msg_report_physical_addr (struct cec_msg *msg, +static __inline__void cec_msg_report_physical_addr (struct cec_msg *msg,__u16 phys_addr,__u8 prim_devtype) { msg->len =5 ;
@@ -798,14 +798,14 @@ static inline void cec_msg_report_physical_addr(struct cec_msg *msg, msg->msg[4 ] = prim_devtype; } -static inline void cec_ops_report_physical_addr (const struct cec_msg *msg, +static __inline__void cec_ops_report_physical_addr (const struct cec_msg *msg,__u16 *phys_addr,__u8 *prim_devtype) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; *prim_devtype = msg->msg[4 ]; } -static inline void cec_msg_give_physical_addr (struct cec_msg *msg, +static __inline__void cec_msg_give_physical_addr (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -813,7 +813,7 @@ static inline void cec_msg_give_physical_addr(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_REPORT_PHYSICAL_ADDR :0 ; } -static inline void cec_msg_set_menu_language (struct cec_msg *msg, +static __inline__void cec_msg_set_menu_language (struct cec_msg *msg,const char *language) { msg->len =5 ;
@@ -822,14 +822,14 @@ static inline void cec_msg_set_menu_language(struct cec_msg *msg,memcpy (msg->msg +2 , language,3 ); } -static inline void cec_ops_set_menu_language (const struct cec_msg *msg, +static __inline__void cec_ops_set_menu_language (const struct cec_msg *msg,char *language) {memcpy (language, msg->msg +2 ,3 ); language[3 ] ='\0' ; } -static inline void cec_msg_get_menu_language (struct cec_msg *msg, +static __inline__void cec_msg_get_menu_language (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -845,7 +845,7 @@ static inline void cec_msg_get_menu_language(struct cec_msg *msg,* in the future, then this function needs to be adapted or a new function * should be added. */ -static inline void cec_msg_report_features (struct cec_msg *msg, +static __inline__void cec_msg_report_features (struct cec_msg *msg,__u8 cec_version,__u8 all_device_types,__u8 rc_profile,__u8 dev_features) {
@@ -858,7 +858,7 @@ static inline void cec_msg_report_features(struct cec_msg *msg, msg->msg[5 ] = dev_features; } -static inline void cec_ops_report_features (const struct cec_msg *msg, +static __inline__void cec_ops_report_features (const struct cec_msg *msg,__u8 *cec_version,__u8 *all_device_types,const __u8 **rc_profile,const __u8 **dev_features) {
@@ -879,7 +879,7 @@ static inline void cec_ops_report_features(const struct cec_msg *msg, *rc_profile = *dev_features =NULL ; } -static inline void cec_msg_give_features (struct cec_msg *msg, +static __inline__void cec_msg_give_features (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -888,7 +888,7 @@ static inline void cec_msg_give_features(struct cec_msg *msg, }/* Deck Control Feature */ -static inline void cec_msg_deck_control (struct cec_msg *msg, +static __inline__void cec_msg_deck_control (struct cec_msg *msg,__u8 deck_control_mode) { msg->len =3 ;
@@ -896,13 +896,13 @@ static inline void cec_msg_deck_control(struct cec_msg *msg, msg->msg[2 ] = deck_control_mode; } -static inline void cec_ops_deck_control (const struct cec_msg *msg, +static __inline__void cec_ops_deck_control (const struct cec_msg *msg,__u8 *deck_control_mode) { *deck_control_mode = msg->msg[2 ]; } -static inline void cec_msg_deck_status (struct cec_msg *msg, +static __inline__void cec_msg_deck_status (struct cec_msg *msg,__u8 deck_info) { msg->len =3 ;
@@ -910,13 +910,13 @@ static inline void cec_msg_deck_status(struct cec_msg *msg, msg->msg[2 ] = deck_info; } -static inline void cec_ops_deck_status (const struct cec_msg *msg, +static __inline__void cec_ops_deck_status (const struct cec_msg *msg,__u8 *deck_info) { *deck_info = msg->msg[2 ]; } -static inline void cec_msg_give_deck_status (struct cec_msg *msg, +static __inline__void cec_msg_give_deck_status (struct cec_msg *msg,int reply,__u8 status_req) {
@@ -926,13 +926,13 @@ static inline void cec_msg_give_deck_status(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_DECK_STATUS :0 ; } -static inline void cec_ops_give_deck_status (const struct cec_msg *msg, +static __inline__void cec_ops_give_deck_status (const struct cec_msg *msg,__u8 *status_req) { *status_req = msg->msg[2 ]; } -static inline void cec_msg_play (struct cec_msg *msg, +static __inline__void cec_msg_play (struct cec_msg *msg,__u8 play_mode) { msg->len =3 ;
@@ -940,7 +940,7 @@ static inline void cec_msg_play(struct cec_msg *msg, msg->msg[2 ] = play_mode; } -static inline void cec_ops_play (const struct cec_msg *msg, +static __inline__void cec_ops_play (const struct cec_msg *msg,__u8 *play_mode) { *play_mode = msg->msg[2 ];
@@ -962,7 +962,7 @@ struct cec_op_tuner_device_info { }; }; -static inline void cec_msg_tuner_device_status_analog(struct cec_msg *msg, +static __inline__ void cec_msg_tuner_device_status_analog(struct cec_msg *msg, __u8 rec_flag, __u8 tuner_display_info, __u8 ana_bcast_type,
@@ -978,7 +978,7 @@ static inline void cec_msg_tuner_device_status_analog(struct cec_msg *msg, msg->msg[6 ] = bcast_system; } -static inline void cec_msg_tuner_device_status_digital (struct cec_msg *msg, +static __inline__void cec_msg_tuner_device_status_digital (struct cec_msg *msg,__u8 rec_flag,__u8 tuner_display_info,const struct cec_op_digital_service_id *digital) {
@@ -988,7 +988,7 @@ static inline void cec_msg_tuner_device_status_digital(struct cec_msg *msg,cec_set_digital_service_id (msg->msg +3 , digital); } -static inline void cec_msg_tuner_device_status (struct cec_msg *msg, +static __inline__void cec_msg_tuner_device_status (struct cec_msg *msg,const struct cec_op_tuner_device_info *tuner_dev_info) {if (tuner_dev_info->is_analog)
@@ -1005,7 +1005,7 @@ static inline void cec_msg_tuner_device_status(struct cec_msg *msg, &tuner_dev_info->digital); } -static inline void cec_ops_tuner_device_status (const struct cec_msg *msg, +static __inline__void cec_ops_tuner_device_status (const struct cec_msg *msg,struct cec_op_tuner_device_info *tuner_dev_info) { tuner_dev_info->is_analog = msg->len <10 ;
@@ -1020,7 +1020,7 @@ static inline void cec_ops_tuner_device_status(const struct cec_msg *msg,cec_get_digital_service_id (msg->msg +3 , &tuner_dev_info->digital); } -static inline void cec_msg_give_tuner_device_status (struct cec_msg *msg, +static __inline__void cec_msg_give_tuner_device_status (struct cec_msg *msg,int reply,__u8 status_req) {
@@ -1030,13 +1030,13 @@ static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_TUNER_DEVICE_STATUS :0 ; } -static inline void cec_ops_give_tuner_device_status (const struct cec_msg *msg, +static __inline__void cec_ops_give_tuner_device_status (const struct cec_msg *msg,__u8 *status_req) { *status_req = msg->msg[2 ]; } -static inline void cec_msg_select_analogue_service (struct cec_msg *msg, +static __inline__void cec_msg_select_analogue_service (struct cec_msg *msg,__u8 ana_bcast_type,__u16 ana_freq,__u8 bcast_system)
@@ -1049,7 +1049,7 @@ static inline void cec_msg_select_analogue_service(struct cec_msg *msg, msg->msg[5 ] = bcast_system; } -static inline void cec_ops_select_analogue_service (const struct cec_msg *msg, +static __inline__void cec_ops_select_analogue_service (const struct cec_msg *msg,__u8 *ana_bcast_type,__u16 *ana_freq,__u8 *bcast_system)
@@ -1059,7 +1059,7 @@ static inline void cec_ops_select_analogue_service(const struct cec_msg *msg, *bcast_system = msg->msg[5 ]; } -static inline void cec_msg_select_digital_service (struct cec_msg *msg, +static __inline__void cec_msg_select_digital_service (struct cec_msg *msg,const struct cec_op_digital_service_id *digital) { msg->len =9 ;
@@ -1067,19 +1067,19 @@ static inline void cec_msg_select_digital_service(struct cec_msg *msg,cec_set_digital_service_id (msg->msg +2 , digital); } -static inline void cec_ops_select_digital_service (const struct cec_msg *msg, +static __inline__void cec_ops_select_digital_service (const struct cec_msg *msg,struct cec_op_digital_service_id *digital) {cec_get_digital_service_id (msg->msg +2 , digital); } -static inline void cec_msg_tuner_step_decrement (struct cec_msg *msg) +static __inline__void cec_msg_tuner_step_decrement (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_TUNER_STEP_DECREMENT ; } -static inline void cec_msg_tuner_step_increment (struct cec_msg *msg) +static __inline__void cec_msg_tuner_step_increment (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_TUNER_STEP_INCREMENT ;
@@ -1087,7 +1087,7 @@ static inline void cec_msg_tuner_step_increment(struct cec_msg *msg)/* Vendor Specific Commands Feature */ -static inline void cec_msg_device_vendor_id (struct cec_msg *msg,__u32 vendor_id) +static __inline__void cec_msg_device_vendor_id (struct cec_msg *msg,__u32 vendor_id) { msg->len =5 ; msg->msg[0 ] |=0xf ;/* broadcast */
@@ -1097,13 +1097,13 @@ static inline void cec_msg_device_vendor_id(struct cec_msg *msg, __u32 vendor_id msg->msg[4 ] = vendor_id &0xff ; } -static inline void cec_ops_device_vendor_id (const struct cec_msg *msg, +static __inline__void cec_ops_device_vendor_id (const struct cec_msg *msg,__u32 *vendor_id) { *vendor_id = (msg->msg[2 ] <<16 ) | (msg->msg[3 ] <<8 ) | msg->msg[4 ]; } -static inline void cec_msg_give_device_vendor_id (struct cec_msg *msg, +static __inline__void cec_msg_give_device_vendor_id (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1111,7 +1111,7 @@ static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_DEVICE_VENDOR_ID :0 ; } -static inline void cec_msg_vendor_command (struct cec_msg *msg, +static __inline__void cec_msg_vendor_command (struct cec_msg *msg,__u8 size,const __u8 *vendor_cmd) {if (size >14 )
@@ -1121,7 +1121,7 @@ static inline void cec_msg_vendor_command(struct cec_msg *msg,memcpy (msg->msg +2 , vendor_cmd, size); } -static inline void cec_ops_vendor_command (const struct cec_msg *msg, +static __inline__void cec_ops_vendor_command (const struct cec_msg *msg,__u8 *size,const __u8 **vendor_cmd) {
@@ -1132,7 +1132,7 @@ static inline void cec_ops_vendor_command(const struct cec_msg *msg, *vendor_cmd = msg->msg +2 ; } -static inline void cec_msg_vendor_command_with_id (struct cec_msg *msg, +static __inline__void cec_msg_vendor_command_with_id (struct cec_msg *msg,__u32 vendor_id,__u8 size,const __u8 *vendor_cmd) {
@@ -1146,7 +1146,7 @@ static inline void cec_msg_vendor_command_with_id(struct cec_msg *msg,memcpy (msg->msg +5 , vendor_cmd, size); } -static inline void cec_ops_vendor_command_with_id (const struct cec_msg *msg, +static __inline__void cec_ops_vendor_command_with_id (const struct cec_msg *msg,__u32 *vendor_id,__u8 *size,const __u8 **vendor_cmd) {
@@ -1158,7 +1158,7 @@ static inline void cec_ops_vendor_command_with_id(const struct cec_msg *msg, *vendor_cmd = msg->msg +5 ; } -static inline void cec_msg_vendor_remote_button_down (struct cec_msg *msg, +static __inline__void cec_msg_vendor_remote_button_down (struct cec_msg *msg,__u8 size,const __u8 *rc_code) {
@@ -1169,7 +1169,7 @@ static inline void cec_msg_vendor_remote_button_down(struct cec_msg *msg,memcpy (msg->msg +2 , rc_code, size); } -static inline void cec_ops_vendor_remote_button_down (const struct cec_msg *msg, +static __inline__void cec_ops_vendor_remote_button_down (const struct cec_msg *msg,__u8 *size,const __u8 **rc_code) {
@@ -1180,7 +1180,7 @@ static inline void cec_ops_vendor_remote_button_down(const struct cec_msg *msg, *rc_code = msg->msg +2 ; } -static inline void cec_msg_vendor_remote_button_up (struct cec_msg *msg) +static __inline__void cec_msg_vendor_remote_button_up (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_VENDOR_REMOTE_BUTTON_UP ;
@@ -1188,7 +1188,7 @@ static inline void cec_msg_vendor_remote_button_up(struct cec_msg *msg)/* OSD Display Feature */ -static inline void cec_msg_set_osd_string (struct cec_msg *msg, +static __inline__void cec_msg_set_osd_string (struct cec_msg *msg,__u8 disp_ctl,const char *osd) {
@@ -1202,7 +1202,7 @@ static inline void cec_msg_set_osd_string(struct cec_msg *msg,memcpy (msg->msg +3 , osd, len); } -static inline void cec_ops_set_osd_string (const struct cec_msg *msg, +static __inline__void cec_ops_set_osd_string (const struct cec_msg *msg,__u8 *disp_ctl,char *osd) {
@@ -1217,7 +1217,7 @@ static inline void cec_ops_set_osd_string(const struct cec_msg *msg,/* Device OSD Transfer Feature */ -static inline void cec_msg_set_osd_name (struct cec_msg *msg,const char *name) +static __inline__void cec_msg_set_osd_name (struct cec_msg *msg,const char *name) {unsigned int len =strlen (name);
@@ -1228,7 +1228,7 @@ static inline void cec_msg_set_osd_name(struct cec_msg *msg, const char *name)memcpy (msg->msg +2 , name, len); } -static inline void cec_ops_set_osd_name (const struct cec_msg *msg, +static __inline__void cec_ops_set_osd_name (const struct cec_msg *msg,char *name) {unsigned int len = msg->len >2 ? msg->len -2 :0 ;
@@ -1239,7 +1239,7 @@ static inline void cec_ops_set_osd_name(const struct cec_msg *msg, name[len] ='\0' ; } -static inline void cec_msg_give_osd_name (struct cec_msg *msg, +static __inline__void cec_msg_give_osd_name (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1249,7 +1249,7 @@ static inline void cec_msg_give_osd_name(struct cec_msg *msg,/* Device Menu Control Feature */ -static inline void cec_msg_menu_status (struct cec_msg *msg, +static __inline__void cec_msg_menu_status (struct cec_msg *msg,__u8 menu_state) { msg->len =3 ;
@@ -1257,13 +1257,13 @@ static inline void cec_msg_menu_status(struct cec_msg *msg, msg->msg[2 ] = menu_state; } -static inline void cec_ops_menu_status (const struct cec_msg *msg, +static __inline__void cec_ops_menu_status (const struct cec_msg *msg,__u8 *menu_state) { *menu_state = msg->msg[2 ]; } -static inline void cec_msg_menu_request (struct cec_msg *msg, +static __inline__void cec_msg_menu_request (struct cec_msg *msg,int reply,__u8 menu_req) {
@@ -1273,7 +1273,7 @@ static inline void cec_msg_menu_request(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_MENU_STATUS :0 ; } -static inline void cec_ops_menu_request (const struct cec_msg *msg, +static __inline__void cec_ops_menu_request (const struct cec_msg *msg,__u8 *menu_req) { *menu_req = msg->msg[2 ];
@@ -1293,7 +1293,7 @@ struct cec_op_ui_command { }; }; -static inline void cec_msg_user_control_pressed (struct cec_msg *msg, +static __inline__void cec_msg_user_control_pressed (struct cec_msg *msg,const struct cec_op_ui_command *ui_cmd) { msg->len =3 ;
@@ -1323,7 +1323,7 @@ static inline void cec_msg_user_control_pressed(struct cec_msg *msg, } } -static inline void cec_ops_user_control_pressed (const struct cec_msg *msg, +static __inline__void cec_ops_user_control_pressed (const struct cec_msg *msg,struct cec_op_ui_command *ui_cmd) { ui_cmd->ui_cmd = msg->msg[2 ];
@@ -1352,7 +1352,7 @@ static inline void cec_ops_user_control_pressed(const struct cec_msg *msg, } } -static inline void cec_msg_user_control_released (struct cec_msg *msg) +static __inline__void cec_msg_user_control_released (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_USER_CONTROL_RELEASED ;
@@ -1361,7 +1361,7 @@ static inline void cec_msg_user_control_released(struct cec_msg *msg)/* Remote Control Passthrough Feature */ /* Power Status Feature */ -static inline void cec_msg_report_power_status (struct cec_msg *msg, +static __inline__void cec_msg_report_power_status (struct cec_msg *msg,__u8 pwr_state) { msg->len =3 ;
@@ -1369,13 +1369,13 @@ static inline void cec_msg_report_power_status(struct cec_msg *msg, msg->msg[2 ] = pwr_state; } -static inline void cec_ops_report_power_status (const struct cec_msg *msg, +static __inline__void cec_ops_report_power_status (const struct cec_msg *msg,__u8 *pwr_state) { *pwr_state = msg->msg[2 ]; } -static inline void cec_msg_give_device_power_status (struct cec_msg *msg, +static __inline__void cec_msg_give_device_power_status (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1384,7 +1384,7 @@ static inline void cec_msg_give_device_power_status(struct cec_msg *msg, }/* General Protocol Messages */ -static inline void cec_msg_feature_abort (struct cec_msg *msg, +static __inline__void cec_msg_feature_abort (struct cec_msg *msg,__u8 abort_msg,__u8 reason) { msg->len =4 ;
@@ -1393,7 +1393,7 @@ static inline void cec_msg_feature_abort(struct cec_msg *msg, msg->msg[3 ] = reason; } -static inline void cec_ops_feature_abort (const struct cec_msg *msg, +static __inline__void cec_ops_feature_abort (const struct cec_msg *msg,__u8 *abort_msg,__u8 *reason) { *abort_msg = msg->msg[2 ];
@@ -1401,7 +1401,7 @@ static inline void cec_ops_feature_abort(const struct cec_msg *msg, }/* This changes the current message into a feature abort message */ -static inline void cec_msg_reply_feature_abort (struct cec_msg *msg,__u8 reason) +static __inline__void cec_msg_reply_feature_abort (struct cec_msg *msg,__u8 reason) {cec_msg_set_reply_to (msg, msg); msg->len =4 ;
@@ -1410,7 +1410,7 @@ static inline void cec_msg_reply_feature_abort(struct cec_msg *msg, __u8 reason) msg->msg[1 ] =CEC_MSG_FEATURE_ABORT ; } -static inline void cec_msg_abort (struct cec_msg *msg) +static __inline__void cec_msg_abort (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_ABORT ;
@@ -1418,7 +1418,7 @@ static inline void cec_msg_abort(struct cec_msg *msg)/* System Audio Control Feature */ -static inline void cec_msg_report_audio_status (struct cec_msg *msg, +static __inline__void cec_msg_report_audio_status (struct cec_msg *msg,__u8 aud_mute_status,__u8 aud_vol_status) {
@@ -1427,7 +1427,7 @@ static inline void cec_msg_report_audio_status(struct cec_msg *msg, msg->msg[2 ] = (aud_mute_status <<7 ) | (aud_vol_status &0x7f ); } -static inline void cec_ops_report_audio_status (const struct cec_msg *msg, +static __inline__void cec_ops_report_audio_status (const struct cec_msg *msg,__u8 *aud_mute_status,__u8 *aud_vol_status) {
@@ -1435,7 +1435,7 @@ static inline void cec_ops_report_audio_status(const struct cec_msg *msg, *aud_vol_status = msg->msg[2 ] &0x7f ; } -static inline void cec_msg_give_audio_status (struct cec_msg *msg, +static __inline__void cec_msg_give_audio_status (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1443,7 +1443,7 @@ static inline void cec_msg_give_audio_status(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_REPORT_AUDIO_STATUS :0 ; } -static inline void cec_msg_set_system_audio_mode (struct cec_msg *msg, +static __inline__void cec_msg_set_system_audio_mode (struct cec_msg *msg,__u8 sys_aud_status) { msg->len =3 ;
@@ -1451,13 +1451,13 @@ static inline void cec_msg_set_system_audio_mode(struct cec_msg *msg, msg->msg[2 ] = sys_aud_status; } -static inline void cec_ops_set_system_audio_mode (const struct cec_msg *msg, +static __inline__void cec_ops_set_system_audio_mode (const struct cec_msg *msg,__u8 *sys_aud_status) { *sys_aud_status = msg->msg[2 ]; } -static inline void cec_msg_system_audio_mode_request (struct cec_msg *msg, +static __inline__void cec_msg_system_audio_mode_request (struct cec_msg *msg,int reply,__u16 phys_addr) {
@@ -1469,7 +1469,7 @@ static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg, } -static inline void cec_ops_system_audio_mode_request (const struct cec_msg *msg, +static __inline__void cec_ops_system_audio_mode_request (const struct cec_msg *msg,__u16 *phys_addr) {if (msg->len <4 )
@@ -1478,7 +1478,7 @@ static inline void cec_ops_system_audio_mode_request(const struct cec_msg *msg, *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; } -static inline void cec_msg_system_audio_mode_status (struct cec_msg *msg, +static __inline__void cec_msg_system_audio_mode_status (struct cec_msg *msg,__u8 sys_aud_status) { msg->len =3 ;
@@ -1486,13 +1486,13 @@ static inline void cec_msg_system_audio_mode_status(struct cec_msg *msg, msg->msg[2 ] = sys_aud_status; } -static inline void cec_ops_system_audio_mode_status (const struct cec_msg *msg, +static __inline__void cec_ops_system_audio_mode_status (const struct cec_msg *msg,__u8 *sys_aud_status) { *sys_aud_status = msg->msg[2 ]; } -static inline void cec_msg_give_system_audio_mode_status (struct cec_msg *msg, +static __inline__void cec_msg_give_system_audio_mode_status (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1500,7 +1500,7 @@ static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_SYSTEM_AUDIO_MODE_STATUS :0 ; } -static inline void cec_msg_report_short_audio_descriptor (struct cec_msg *msg, +static __inline__void cec_msg_report_short_audio_descriptor (struct cec_msg *msg,__u8 num_descriptors,const __u32 *descriptors) {
@@ -1517,7 +1517,7 @@ static inline void cec_msg_report_short_audio_descriptor(struct cec_msg *msg, } } -static inline void cec_ops_report_short_audio_descriptor (const struct cec_msg *msg, +static __inline__void cec_ops_report_short_audio_descriptor (const struct cec_msg *msg,__u8 *num_descriptors,__u32 *descriptors) {
@@ -1532,7 +1532,7 @@ static inline void cec_ops_report_short_audio_descriptor(const struct cec_msg *m msg->msg[4 + i *3 ]; } -static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, +static __inline__ void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, int reply, __u8 num_descriptors, const __u8 *audio_format_id,
@@ -1550,7 +1550,7 @@ static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, (audio_format_code[i] &0x3f ); } -static inline void cec_ops_request_short_audio_descriptor (const struct cec_msg *msg, +static __inline__void cec_ops_request_short_audio_descriptor (const struct cec_msg *msg,__u8 *num_descriptors,__u8 *audio_format_id,__u8 *audio_format_code)
@@ -1568,7 +1568,7 @@ static inline void cec_ops_request_short_audio_descriptor(const struct cec_msg */* Audio Rate Control Feature */ -static inline void cec_msg_set_audio_rate (struct cec_msg *msg, +static __inline__void cec_msg_set_audio_rate (struct cec_msg *msg,__u8 audio_rate) { msg->len =3 ;
@@ -1576,7 +1576,7 @@ static inline void cec_msg_set_audio_rate(struct cec_msg *msg, msg->msg[2 ] = audio_rate; } -static inline void cec_ops_set_audio_rate (const struct cec_msg *msg, +static __inline__void cec_ops_set_audio_rate (const struct cec_msg *msg,__u8 *audio_rate) { *audio_rate = msg->msg[2 ];
@@ -1584,13 +1584,13 @@ static inline void cec_ops_set_audio_rate(const struct cec_msg *msg,/* Audio Return Channel Control Feature */ -static inline void cec_msg_report_arc_initiated (struct cec_msg *msg) +static __inline__void cec_msg_report_arc_initiated (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_REPORT_ARC_INITIATED ; } -static inline void cec_msg_initiate_arc (struct cec_msg *msg, +static __inline__void cec_msg_initiate_arc (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1598,7 +1598,7 @@ static inline void cec_msg_initiate_arc(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_REPORT_ARC_INITIATED :0 ; } -static inline void cec_msg_request_arc_initiation (struct cec_msg *msg, +static __inline__void cec_msg_request_arc_initiation (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1606,13 +1606,13 @@ static inline void cec_msg_request_arc_initiation(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_INITIATE_ARC :0 ; } -static inline void cec_msg_report_arc_terminated (struct cec_msg *msg) +static __inline__void cec_msg_report_arc_terminated (struct cec_msg *msg) { msg->len =2 ; msg->msg[1 ] =CEC_MSG_REPORT_ARC_TERMINATED ; } -static inline void cec_msg_terminate_arc (struct cec_msg *msg, +static __inline__void cec_msg_terminate_arc (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1620,7 +1620,7 @@ static inline void cec_msg_terminate_arc(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_REPORT_ARC_TERMINATED :0 ; } -static inline void cec_msg_request_arc_termination (struct cec_msg *msg, +static __inline__void cec_msg_request_arc_termination (struct cec_msg *msg,int reply) { msg->len =2 ;
@@ -1631,7 +1631,7 @@ static inline void cec_msg_request_arc_termination(struct cec_msg *msg,/* Dynamic Audio Lipsync Feature */ /* Only for CEC 2.0 and up */ -static inline void cec_msg_report_current_latency(struct cec_msg *msg, +static __inline__ void cec_msg_report_current_latency(struct cec_msg *msg, __u16 phys_addr, __u8 video_latency, __u8 low_latency_mode,
@@ -1649,7 +1649,7 @@ static inline void cec_msg_report_current_latency(struct cec_msg *msg, msg->msg[msg->len++] = audio_out_delay; } -static inline void cec_ops_report_current_latency(const struct cec_msg *msg, +static __inline__ void cec_ops_report_current_latency(const struct cec_msg *msg, __u16 *phys_addr, __u8 *video_latency, __u8 *low_latency_mode,
@@ -1666,7 +1666,7 @@ static inline void cec_ops_report_current_latency(const struct cec_msg *msg, *audio_out_delay =0 ; } -static inline void cec_msg_request_current_latency (struct cec_msg *msg, +static __inline__void cec_msg_request_current_latency (struct cec_msg *msg,int reply,__u16 phys_addr) {
@@ -1678,7 +1678,7 @@ static inline void cec_msg_request_current_latency(struct cec_msg *msg, msg->reply = reply ?CEC_MSG_REPORT_CURRENT_LATENCY :0 ; } -static inline void cec_ops_request_current_latency (const struct cec_msg *msg, +static __inline__void cec_ops_request_current_latency (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ];
@@ -1686,7 +1686,7 @@ static inline void cec_ops_request_current_latency(const struct cec_msg *msg,/* Capability Discovery and Control Feature */ -static inline void cec_msg_cdc_hec_inquire_state (struct cec_msg *msg, +static __inline__void cec_msg_cdc_hec_inquire_state (struct cec_msg *msg,__u16 phys_addr1,__u16 phys_addr2) {
@@ -1701,7 +1701,7 @@ static inline void cec_msg_cdc_hec_inquire_state(struct cec_msg *msg, msg->msg[8 ] = phys_addr2 &0xff ; } -static inline void cec_ops_cdc_hec_inquire_state (const struct cec_msg *msg, +static __inline__void cec_ops_cdc_hec_inquire_state (const struct cec_msg *msg,__u16 *phys_addr,__u16 *phys_addr1,__u16 *phys_addr2)
@@ -1711,7 +1711,7 @@ static inline void cec_ops_cdc_hec_inquire_state(const struct cec_msg *msg, *phys_addr2 = (msg->msg[7 ] <<8 ) | msg->msg[8 ]; } -static inline void cec_msg_cdc_hec_report_state(struct cec_msg *msg, +static __inline__ void cec_msg_cdc_hec_report_state(struct cec_msg *msg, __u16 target_phys_addr, __u8 hec_func_state, __u8 host_func_state,
@@ -1737,7 +1737,7 @@ static inline void cec_msg_cdc_hec_report_state(struct cec_msg *msg, } } -static inline void cec_ops_cdc_hec_report_state(const struct cec_msg *msg, +static __inline__ void cec_ops_cdc_hec_report_state(const struct cec_msg *msg, __u16 *phys_addr, __u16 *target_phys_addr, __u8 *hec_func_state,
@@ -1757,7 +1757,7 @@ static inline void cec_ops_cdc_hec_report_state(const struct cec_msg *msg, *hec_field = *has_field ? ((msg->msg[8 ] <<8 ) | msg->msg[9 ]) :0 ; } -static inline void cec_msg_cdc_hec_set_state(struct cec_msg *msg, +static __inline__ void cec_msg_cdc_hec_set_state(struct cec_msg *msg, __u16 phys_addr1, __u16 phys_addr2, __u8 hec_set_state,
@@ -1789,7 +1789,7 @@ static inline void cec_msg_cdc_hec_set_state(struct cec_msg *msg, } } -static inline void cec_ops_cdc_hec_set_state(const struct cec_msg *msg, +static __inline__ void cec_ops_cdc_hec_set_state(const struct cec_msg *msg, __u16 *phys_addr, __u16 *phys_addr1, __u16 *phys_addr2,
@@ -1811,7 +1811,7 @@ static inline void cec_ops_cdc_hec_set_state(const struct cec_msg *msg, *phys_addr5 = (msg->msg[14 ] <<8 ) | msg->msg[15 ]; } -static inline void cec_msg_cdc_hec_set_state_adjacent (struct cec_msg *msg, +static __inline__void cec_msg_cdc_hec_set_state_adjacent (struct cec_msg *msg,__u16 phys_addr1,__u8 hec_set_state) {
@@ -1825,7 +1825,7 @@ static inline void cec_msg_cdc_hec_set_state_adjacent(struct cec_msg *msg, msg->msg[7 ] = hec_set_state; } -static inline void cec_ops_cdc_hec_set_state_adjacent (const struct cec_msg *msg, +static __inline__void cec_ops_cdc_hec_set_state_adjacent (const struct cec_msg *msg,__u16 *phys_addr,__u16 *phys_addr1,__u8 *hec_set_state)
@@ -1835,7 +1835,7 @@ static inline void cec_ops_cdc_hec_set_state_adjacent(const struct cec_msg *msg, *hec_set_state = msg->msg[7 ]; } -static inline void cec_msg_cdc_hec_request_deactivation (struct cec_msg *msg, +static __inline__void cec_msg_cdc_hec_request_deactivation (struct cec_msg *msg,__u16 phys_addr1,__u16 phys_addr2,__u16 phys_addr3)
@@ -1853,7 +1853,7 @@ static inline void cec_msg_cdc_hec_request_deactivation(struct cec_msg *msg, msg->msg[10 ] = phys_addr3 &0xff ; } -static inline void cec_ops_cdc_hec_request_deactivation(const struct cec_msg *msg, +static __inline__ void cec_ops_cdc_hec_request_deactivation(const struct cec_msg *msg, __u16 *phys_addr, __u16 *phys_addr1, __u16 *phys_addr2,
@@ -1865,7 +1865,7 @@ static inline void cec_ops_cdc_hec_request_deactivation(const struct cec_msg *ms *phys_addr3 = (msg->msg[9 ] <<8 ) | msg->msg[10 ]; } -static inline void cec_msg_cdc_hec_notify_alive (struct cec_msg *msg) +static __inline__void cec_msg_cdc_hec_notify_alive (struct cec_msg *msg) { msg->len =5 ; msg->msg[0 ] |=0xf ;/* broadcast */
@@ -1874,13 +1874,13 @@ static inline void cec_msg_cdc_hec_notify_alive(struct cec_msg *msg) msg->msg[4 ] =CEC_MSG_CDC_HEC_NOTIFY_ALIVE ; } -static inline void cec_ops_cdc_hec_notify_alive (const struct cec_msg *msg, +static __inline__void cec_ops_cdc_hec_notify_alive (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; } -static inline void cec_msg_cdc_hec_discover (struct cec_msg *msg) +static __inline__void cec_msg_cdc_hec_discover (struct cec_msg *msg) { msg->len =5 ; msg->msg[0 ] |=0xf ;/* broadcast */
@@ -1889,13 +1889,13 @@ static inline void cec_msg_cdc_hec_discover(struct cec_msg *msg) msg->msg[4 ] =CEC_MSG_CDC_HEC_DISCOVER ; } -static inline void cec_ops_cdc_hec_discover (const struct cec_msg *msg, +static __inline__void cec_ops_cdc_hec_discover (const struct cec_msg *msg,__u16 *phys_addr) { *phys_addr = (msg->msg[2 ] <<8 ) | msg->msg[3 ]; } -static inline void cec_msg_cdc_hpd_set_state (struct cec_msg *msg, +static __inline__void cec_msg_cdc_hpd_set_state (struct cec_msg *msg,__u8 input_port,__u8 hpd_state) {
@@ -1907,7 +1907,7 @@ static inline void cec_msg_cdc_hpd_set_state(struct cec_msg *msg, msg->msg[5 ] = (input_port <<4 ) | hpd_state; } -static inline void cec_ops_cdc_hpd_set_state (const struct cec_msg *msg, +static __inline__void cec_ops_cdc_hpd_set_state (const struct cec_msg *msg,__u16 *phys_addr,__u8 *input_port,__u8 *hpd_state)
@@ -1917,7 +1917,7 @@ static inline void cec_ops_cdc_hpd_set_state(const struct cec_msg *msg, *hpd_state = msg->msg[5 ] &0xf ; } -static inline void cec_msg_cdc_hpd_report_state (struct cec_msg *msg, +static __inline__void cec_msg_cdc_hpd_report_state (struct cec_msg *msg,__u8 hpd_state,__u8 hpd_error) {
@@ -1929,7 +1929,7 @@ static inline void cec_msg_cdc_hpd_report_state(struct cec_msg *msg, msg->msg[5 ] = (hpd_state <<4 ) | hpd_error; } -static inline void cec_ops_cdc_hpd_report_state (const struct cec_msg *msg, +static __inline__void cec_ops_cdc_hpd_report_state (const struct cec_msg *msg,__u16 *phys_addr,__u8 *hpd_state,__u8 *hpd_error)
include/linux/cec.h +20 -20
@@ -75,7 +75,7 @@ struct cec_msg {* cec_msg_initiator - return the initiator's logical address. * @msg: the message structure */ -static inline __u8 cec_msg_initiator (const struct cec_msg *msg) +static __inline____u8 cec_msg_initiator (const struct cec_msg *msg) {return msg->msg[0 ] >>4 ; }
@@ -84,7 +84,7 @@ static inline __u8 cec_msg_initiator(const struct cec_msg *msg)* cec_msg_destination - return the destination's logical address. * @msg: the message structure */ -static inline __u8 cec_msg_destination (const struct cec_msg *msg) +static __inline____u8 cec_msg_destination (const struct cec_msg *msg) {return msg->msg[0 ] &0xf ; }
@@ -93,7 +93,7 @@ static inline __u8 cec_msg_destination(const struct cec_msg *msg)* cec_msg_opcode - return the opcode of the message, -1 for poll * @msg: the message structure */ -static inline int cec_msg_opcode (const struct cec_msg *msg) +static __inline__int cec_msg_opcode (const struct cec_msg *msg) {return msg->len >1 ? msg->msg[1 ] :-1 ; }
@@ -102,7 +102,7 @@ static inline int cec_msg_opcode(const struct cec_msg *msg)* cec_msg_is_broadcast - return true if this is a broadcast message. * @msg: the message structure */ -static inline int cec_msg_is_broadcast (const struct cec_msg *msg) +static __inline__int cec_msg_is_broadcast (const struct cec_msg *msg) {return (msg->msg[0 ] &0xf ) ==0xf ; }
@@ -116,7 +116,7 @@ static inline int cec_msg_is_broadcast(const struct cec_msg *msg)* The whole structure is zeroed, the len field is set to 1 (i.e. a poll * message) and the initiator and destination are filled in. */ -static inline void cec_msg_init (struct cec_msg *msg, +static __inline__void cec_msg_init (struct cec_msg *msg,__u8 initiator,__u8 destination) {memset (msg,0 ,sizeof (*msg));
@@ -133,7 +133,7 @@ static inline void cec_msg_init(struct cec_msg *msg,* orig destination. Note that msg and orig may be the same pointer, in which * case the change is done in place. */ -static inline void cec_msg_set_reply_to (struct cec_msg *msg, +static __inline__void cec_msg_set_reply_to (struct cec_msg *msg,struct cec_msg *orig) {/* The destination becomes the initiator and vice versa */
@@ -157,7 +157,7 @@ static inline void cec_msg_set_reply_to(struct cec_msg *msg,#define CEC_RX_STATUS_TIMEOUT (1 << 1)#define CEC_RX_STATUS_FEATURE_ABORT (1 << 2) -static inline int cec_msg_status_is_ok (const struct cec_msg *msg) +static __inline__int cec_msg_status_is_ok (const struct cec_msg *msg) {if (msg->tx_status && !(msg->tx_status &CEC_TX_STATUS_OK ))return 0 ;
@@ -227,47 +227,47 @@ static inline int cec_msg_status_is_ok(const struct cec_msg *msg)#define CEC_LOG_ADDR_MASK_SPECIFIC (1 << CEC_LOG_ADDR_SPECIFIC)#define CEC_LOG_ADDR_MASK_UNREGISTERED (1 << CEC_LOG_ADDR_UNREGISTERED) -static inline int cec_has_tv (__u16 log_addr_mask) +static __inline__int cec_has_tv (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_TV ; } -static inline int cec_has_record (__u16 log_addr_mask) +static __inline__int cec_has_record (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_RECORD ; } -static inline int cec_has_tuner (__u16 log_addr_mask) +static __inline__int cec_has_tuner (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_TUNER ; } -static inline int cec_has_playback (__u16 log_addr_mask) +static __inline__int cec_has_playback (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_PLAYBACK ; } -static inline int cec_has_audiosystem (__u16 log_addr_mask) +static __inline__int cec_has_audiosystem (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_AUDIOSYSTEM ; } -static inline int cec_has_backup (__u16 log_addr_mask) +static __inline__int cec_has_backup (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_BACKUP ; } -static inline int cec_has_specific (__u16 log_addr_mask) +static __inline__int cec_has_specific (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_SPECIFIC ; } -static inline int cec_is_unregistered (__u16 log_addr_mask) +static __inline__int cec_is_unregistered (__u16 log_addr_mask) {return log_addr_mask &CEC_LOG_ADDR_MASK_UNREGISTERED ; } -static inline int cec_is_unconfigured (__u16 log_addr_mask) +static __inline__int cec_is_unconfigured (__u16 log_addr_mask) {return log_addr_mask ==0 ; }
@@ -999,7 +999,7 @@ struct cec_event {/* Helper functions to identify the 'special' CEC devices */ -static inline int cec_is_2nd_tv (const struct cec_log_addrs *las) +static __inline__int cec_is_2nd_tv (const struct cec_log_addrs *las) {/* * It is a second TV if the logical address is 14 or 15 and the
@@ -1010,7 +1010,7 @@ static inline int cec_is_2nd_tv(const struct cec_log_addrs *las) las->primary_device_type[0 ] ==CEC_OP_PRIM_DEVTYPE_TV ; } -static inline int cec_is_processor (const struct cec_log_addrs *las) +static __inline__int cec_is_processor (const struct cec_log_addrs *las) {/* * It is a processor if the logical address is 12-15 and the
@@ -1021,7 +1021,7 @@ static inline int cec_is_processor(const struct cec_log_addrs *las) las->primary_device_type[0 ] ==CEC_OP_PRIM_DEVTYPE_PROCESSOR ; } -static inline int cec_is_switch (const struct cec_log_addrs *las) +static __inline__int cec_is_switch (const struct cec_log_addrs *las) {/* * It is a switch if the logical address is 15 and the
@@ -1033,7 +1033,7 @@ static inline int cec_is_switch(const struct cec_log_addrs *las) !(las->flags &CEC_LOG_ADDRS_FL_CDC_ONLY ); } -static inline int cec_is_cdc_only (const struct cec_log_addrs *las) +static __inline__int cec_is_cdc_only (const struct cec_log_addrs *las) {/* * It is a CDC-only device if the logical address is 15 and the
include/linux/media.h +8 -0
@@ -323,11 +323,19 @@ struct media_v2_topology {/* ioctls */ +struct __attribute__ ((packed))media_request_alloc { +__s32 fd; +}; +#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology) +#define MEDIA_IOC_REQUEST_ALLOC _IOWR('|', 0x05, struct media_request_alloc) + +#define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80) +#define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)/*
include/linux/v4l2-dv-timings.h new file +979 -0
979 lines not on this page · raw message
include/linux/videodev2.h +12 -2
@@ -906,6 +906,7 @@ struct v4l2_plane {* @length: size in bytes of the buffer (NOT its payload) for single-plane * buffers (when type != *_MPLANE); number of elements in the * planes array for multi-plane buffers +* @request_fd: fd of the request that this buffer should use * * Contains data exchanged by application and driver using one of the Streaming * I/O methods.
@@ -930,7 +931,10 @@ struct v4l2_buffer { } m;__u32 length;__u32 reserved2; -__u32 reserved; +union { +__s32 request_fd; +__u32 reserved; + }; };/* Flags for 'flags' field */
@@ -948,6 +952,8 @@ struct v4l2_buffer {#define V4L2_BUF_FLAG_BFRAME 0x00000020/* Buffer is ready, but the data contained within is corrupted. */ #define V4L2_BUF_FLAG_ERROR 0x00000040 +/* Buffer is added to an unqueued request */ +#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080/* timecode field is valid */ #define V4L2_BUF_FLAG_TIMECODE 0x00000100/* Buffer is prepared for queuing */
@@ -966,6 +972,8 @@ struct v4l2_buffer {#define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000/* mem2mem encoder/decoder */ #define V4L2_BUF_FLAG_LAST 0x00100000 +/* request_fd is valid */ +#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000/** * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
@@ -1586,7 +1594,8 @@ struct v4l2_ext_controls { };__u32 count;__u32 error_idx; -__u32 reserved[2 ]; +__s32 request_fd; +__u32 reserved[1 ];struct v4l2_ext_control *controls; };
@@ -1597,6 +1606,7 @@ struct v4l2_ext_controls {#define V4L2_CTRL_MAX_DIMS (4)#define V4L2_CTRL_WHICH_CUR_VAL 0#define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 +#define V4L2_CTRL_WHICH_REQUEST 0x0f010000enum v4l2_ctrl_type {V4L2_CTRL_TYPE_INTEGER =1 ,
Signature · 1 line
2.7.4
RFC 5/6 mediatext: Add library
In reply to Sakari Ailuslibmediatext is a helper library for converting configurations (Media controller links, V4L2 controls and V4L2 sub-device media bus formats and selections) from text-based form into IOCTLs.
libmediatext depends on libv4l2subdev and libmediactl.
The patch includes a test program, mediatext-test, that can be used to write tests in interpreted languages such as shell scripts.
--- libmediatext.pc.in | 10 + utils/media-ctl/Makefile.am | 11 +- utils/media-ctl/libmediatext.pc.in | 10 + utils/media-ctl/mediatext-test.c | 127 +++ utils/media-ctl/mediatext.c | 2176 ++++++++++++++++++++++++++++++++++++ utils/media-ctl/mediatext.h | 33 + 6 files changed, 2365 insertions(+), 2 deletions(-) create mode 100644 libmediatext.pc.in create mode 100644 utils/media-ctl/libmediatext.pc.in create mode 100644 utils/media-ctl/mediatext-test.c create mode 100644 utils/media-ctl/mediatext.c create mode 100644 utils/media-ctl/mediatext.h
libmediatext.pc.in new file +10 -0
@@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmediatext +Description: Media controller and V4L2 text-based configuration library +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lmediatext
utils/media-ctl/Makefile.am +9 -2
@@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libmediactl.la libv4l2subdev.la +noinst_LTLIBRARIES = libmediactl.la libv4l2subdev.la libmediatext.la libmediactl_la_SOURCES = libmediactl.c mediactl-priv.h libmediactl_la_CFLAGS = -static $(LIBUDEV_CFLAGS)
@@ -26,9 +26,16 @@ libv4l2subdev_la_LIBADD = libmediactl.la libv4l2subdev_la_CFLAGS = -static libv4l2subdev_la_LDFLAGS = -static +libmediatext_la_SOURCES = mediatext.c +libmediatext_la_CFLAGS = -static $(LIBUDEV_CFLAGS) +libmediatext_la_LDFLAGS = -static $(LIBUDEV_LIBS) + mediactl_includedir=$(includedir)/mediactl noinst_HEADERS = mediactl.h v4l2subdev.h -bin_PROGRAMS = media-ctl +bin_PROGRAMS = media-ctl mediatext media_ctl_SOURCES = media-ctl.c options.c options.h tools.h media_ctl_LDADD = libmediactl.la libv4l2subdev.la +mediatext_SOURCES = mediatext-test.c +mediatext_LDFLAGS = $(STATIC_LDFLAGS) +mediatext_LDADD = libmediatext.la libmediactl.la libv4l2subdev.la
utils/media-ctl/libmediatext.pc.in new file +10 -0
@@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmediatext +Description: Media controller and V4L2 text-based configuration library +Version: @PACKAGE_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lmediatext
utils/media-ctl/mediatext-test.c new file +127 -0
127 lines not on this page · raw message
utils/media-ctl/mediatext.c new file +2176 -0
2,176 lines not on this page · raw message
utils/media-ctl/mediatext.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Media controller text-based configuration library +* +* Copyright (C) 2013--2016 Intel Corporation +* +* Contact: Sakari Ailus <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published +* by the Free Software Foundation; either version 2.1 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __MEDIATEXT_H__ +#define __MEDIATEXT_H__ + +struct media_device ; +struct media_text ; + +struct media_text *mediatext_init (struct media_device *media); +void mediatext_cleanup (struct media_text *mt); +int mediatext_poll (struct media_text *mt,int fd); +int mediatext_parse (struct media_text *mt,char *string); + +#endif /* __MEDIATEXT_H__ */
Signature · 1 line
2.7.4
RFC 6/6 mediatext: Add vivid tests
In reply to Sakari AilusAdd two scripts for vivid tests, with and without using requests.
--- utils/media-ctl/tests/test-vivid-mc.bash | 86 ++++++++++++++++++++++++++++++++ utils/media-ctl/tests/test-vivid.bash | 59 ++++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100755 utils/media-ctl/tests/test-vivid-mc.bash create mode 100755 utils/media-ctl/tests/test-vivid.bash
utils/media-ctl/tests/test-vivid-mc.bash new file +86 -0
@@ -0,0 +1,86 @@ +#!/bin/bash + +coproc mediatext -c 2>&1 + +# read initialisation +read -ru ${COPROC[0]}; eval $REPLY + +cat <<EOF >&${COPROC[1]} +verbose true + +v4l open entity="vim2m" name=vim +v4l fmt vdev=vim type=VIDEO_OUTPUT width=480 height=320 \ + pixelformat=RGB565X bytesperline=0 num_planes=1 +v4l reqbufs vdev=vim type=VIDEO_OUTPUT count=3 memory=MMAP +v4l fmt vdev=vim type=VIDEO_CAPTURE width=480 height=320 \ + pixelformat=RGB565X bytesperline=0 num_planes=1 +v4l reqbufs vdev=vim type=VIDEO_CAPTURE count=3 memory=MMAP + +media req-create req=foo +media req-create req=foo1 +media req-create req=foo2 + +v4l io vdev=vim type=VIDEO_OUTPUT fname=/bin/bash +v4l io vdev=vim type=VIDEO_OUTPUT fname=/bin/systemctl +v4l io vdev=vim type=VIDEO_OUTPUT fname=/vmlinuz + +v4l qbuf vdev=vim type=VIDEO_OUTPUT req=foo +v4l qbuf vdev=vim type=VIDEO_OUTPUT req=foo1 +v4l qbuf vdev=vim type=VIDEO_CAPTURE req=foo1 +v4l qbuf vdev=vim type=VIDEO_CAPTURE req=foo + +media req-queue req=foo + +v4l qbuf vdev=vim type=VIDEO_OUTPUT req=foo2 +v4l qbuf vdev=vim type=VIDEO_CAPTURE req=foo2 + +v4l streamon vdev=vim type=VIDEO_CAPTURE +v4l streamon vdev=vim type=VIDEO_OUTPUT + +media req-queue req=foo2 +media req-queue req=foo1 + +EOF + +queued=3 +finished=0 + +while IFS= read -ru ${COPROC[0]}; do + unset p; declare -A p + eval eval_line $REPLY + echo $REPLY + #echo ${p[event]} + case ${p[event]} in + dqbuf) + #echo seq ${p[seq]} + if [ ${p[type]} == VIDEO_CAPTURE ]; then + echo v4l io vdev=vim type=VIDEO_CAPTURE \ + sequence=${p[seq]} >&${COPROC[1]} + fi + ;; + request-complete) + finished=$(($finished+1)); + if (($queued < 10)); then + queued=$(($queued + 1)) + cat <<EOF >&${COPROC[1]} + media req-create req=${p[req]} + v4l io vdev=vim type=VIDEO_OUTPUT fname=/bin/tar + v4l qbuf vdev=vim type=VIDEO_OUTPUT req=${p[req]} + v4l qbuf vdev=vim type=VIDEO_CAPTURE req=${p[req]} + media req-queue req=${p[req]} +EOF + fi + echo $queued requests queued, $finished finished + if (($finished == 10)); then + cat <<EOF >&${COPROC[1]} + v4l streamoff vdev=vim type=VIDEO_CAPTURE + v4l streamoff vdev=vim type=VIDEO_OUTPUT + v4l reqbufs vdev=vim type=VIDEO_CAPTURE count=0 memory=MMAP + v4l reqbufs vdev=vim type=VIDEO_OUTPUT count=0 memory=MMAP + quit +EOF + exit 0 + fi + ;; + esac; +done
utils/media-ctl/tests/test-vivid.bash new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
2.7.4