aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-follower/cec-processing.cpp
diff options
context:
space:
mode:
authorJiunn Chang <c0d1n61at3@gmail.com>2019-09-16 08:23:08 -0500
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-09-16 16:32:19 +0200
commita32b00d715f48c6aa8c889a1aabd3fcdcee22b0f (patch)
tree2feefd3370aadd608cb4d1f2a1e69edb360881f8 /utils/cec-follower/cec-processing.cpp
parent204c2bfd30f788b7d038047ef9e007f3d8fbfd14 (diff)
cec-follower: create cec-tuner.cpp
Move tuner control, one touch record, and timer programming into cec-tuner.cpp. These features are all tuner related and involve the tuner as a central feature to be able to test. Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/cec-follower/cec-processing.cpp')
-rw-r--r--utils/cec-follower/cec-processing.cpp109
1 files changed, 5 insertions, 104 deletions
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index fa7687c9..15cedddf 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -608,128 +608,29 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me)
case CEC_MSG_DECK_STATUS:
return;
+ /* Tuner Centric Messages */
- /*
- Tuner Control
-
- This is only a basic implementation.
-
- TODO: Device state should change when selecting services etc.
- */
-
- case CEC_MSG_GIVE_TUNER_DEVICE_STATUS: {
- if (!cec_has_tuner(1 << me))
- break;
-
- struct cec_op_tuner_device_info tuner_dev_info = {};
-
- cec_msg_set_reply_to(&msg, &msg);
- tuner_dev_info.rec_flag = CEC_OP_REC_FLAG_NOT_USED;
- tuner_dev_info.tuner_display_info = CEC_OP_TUNER_DISPLAY_INFO_NONE;
- tuner_dev_info.is_analog = false;
- tuner_dev_info.digital.service_id_method = CEC_OP_SERVICE_ID_METHOD_BY_CHANNEL;
- tuner_dev_info.digital.dig_bcast_system = CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_C;
- tuner_dev_info.digital.channel.channel_number_fmt = CEC_OP_CHANNEL_NUMBER_FMT_1_PART;
- tuner_dev_info.digital.channel.minor = 1;
-
- cec_msg_tuner_device_status(&msg, &tuner_dev_info);
- transmit(node, &msg);
- return;
- }
-
+ case CEC_MSG_GIVE_TUNER_DEVICE_STATUS:
case CEC_MSG_TUNER_DEVICE_STATUS:
- return;
-
case CEC_MSG_SELECT_ANALOGUE_SERVICE:
case CEC_MSG_SELECT_DIGITAL_SERVICE:
case CEC_MSG_TUNER_STEP_DECREMENT:
case CEC_MSG_TUNER_STEP_INCREMENT:
- if (!cec_has_tuner(1 << me))
- break;
- return;
-
-
- /*
- One Touch Record
-
- This is only a basic implementation.
-
- TODO:
- - If we are a TV, we should only send Record On if the
- remote end is a Recording device or Reserved. Otherwise ignore.
-
- - Device state should reflect whether we are recording, etc. In
- recording mode we should ignore Standby messages.
- */
-
- case CEC_MSG_RECORD_TV_SCREEN: {
- if (!node->has_rec_tv)
- break;
-
- struct cec_op_record_src rec_src = {};
-
- rec_src.type = CEC_OP_RECORD_SRC_OWN;
- cec_msg_set_reply_to(&msg, &msg);
- cec_msg_record_on(&msg, false, &rec_src);
- transmit(node, &msg);
- return;
- }
+ case CEC_MSG_RECORD_TV_SCREEN:
case CEC_MSG_RECORD_ON:
- if (!cec_has_record(1 << me))
- break;
- cec_msg_set_reply_to(&msg, &msg);
- cec_msg_record_status(&msg, CEC_OP_RECORD_STATUS_CUR_SRC);
- transmit(node, &msg);
- return;
case CEC_MSG_RECORD_OFF:
- if (!cec_has_record(1 << me))
- break;
- cec_msg_set_reply_to(&msg, &msg);
- cec_msg_record_status(&msg, CEC_OP_RECORD_STATUS_TERMINATED_OK);
- transmit(node, &msg);
- return;
case CEC_MSG_RECORD_STATUS:
- return;
-
-
- /*
- Timer Programming
-
- This is only a basic implementation.
-
- TODO/Ideas:
- - Act like an actual recording device; keep track of recording
- schedule and act correctly when colliding timers are set.
- - Emulate a finite storage space for recordings
- */
-
case CEC_MSG_SET_ANALOGUE_TIMER:
case CEC_MSG_SET_DIGITAL_TIMER:
case CEC_MSG_SET_EXT_TIMER:
- if (!cec_has_record(1 << me))
- break;
- cec_msg_set_reply_to(&msg, &msg);
- cec_msg_timer_status(&msg, CEC_OP_TIMER_OVERLAP_WARNING_NO_OVERLAP,
- CEC_OP_MEDIA_INFO_NO_MEDIA,
- CEC_OP_PROG_INFO_ENOUGH_SPACE, 0, 0, 0);
- transmit(node, &msg);
- return;
case CEC_MSG_CLEAR_ANALOGUE_TIMER:
case CEC_MSG_CLEAR_DIGITAL_TIMER:
case CEC_MSG_CLEAR_EXT_TIMER:
- if (!cec_has_record(1 << me))
- break;
- cec_msg_set_reply_to(&msg, &msg);
- cec_msg_timer_cleared_status(&msg, CEC_OP_TIMER_CLR_STAT_CLEARED);
- transmit(node, &msg);
- return;
case CEC_MSG_SET_TIMER_PROGRAM_TITLE:
- if (!cec_has_record(1 << me))
- break;
- return;
case CEC_MSG_TIMER_CLEARED_STATUS:
case CEC_MSG_TIMER_STATUS:
- return;
+ process_tuner_record_timer_msgs(node, msg, me);
+ break;
/* Dynamic Auto Lipsync */

Privacy Policy