Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
f436e5f7
Commit
f436e5f7
authored
Nov 23, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/access/dvb/en50221.c: Implemented basic MMI support to display
the CAM error messages.
parent
7b885b9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
178 additions
and
5 deletions
+178
-5
modules/access/dvb/en50221.c
modules/access/dvb/en50221.c
+178
-5
No files found.
modules/access/dvb/en50221.c
View file @
f436e5f7
...
...
@@ -469,6 +469,36 @@ static void SessionOpen( access_t * p_access, uint8_t i_slot,
}
}
/*****************************************************************************
* SessionSendClose
*****************************************************************************/
static
void
SessionSendClose
(
access_t
*
p_access
,
int
i_session_id
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
uint8_t
p_response
[
16
];
uint8_t
i_tag
;
uint8_t
i_slot
=
p_sys
->
p_sessions
[
i_session_id
-
1
].
i_slot
;
p_response
[
0
]
=
ST_CLOSE_SESSION_REQUEST
;
p_response
[
1
]
=
0x2
;
p_response
[
2
]
=
i_session_id
>>
8
;
p_response
[
3
]
=
i_session_id
&
0xff
;
if
(
TPDUSend
(
p_access
,
i_slot
,
T_DATA_LAST
,
p_response
,
4
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_access
,
"SessionSendClose: couldn't send TPDU on slot %d"
,
i_slot
);
return
;
}
if
(
TPDURecv
(
p_access
,
i_slot
,
&
i_tag
,
NULL
,
NULL
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_access
,
"SessionSendClose: couldn't recv TPDU on slot %d"
,
i_slot
);
return
;
}
}
/*****************************************************************************
* SessionClose
*****************************************************************************/
...
...
@@ -493,13 +523,13 @@ static void SessionClose( access_t * p_access, int i_session_id )
VLC_SUCCESS
)
{
msg_Err
(
p_access
,
"Session
Open
: couldn't send TPDU on slot %d"
,
i_slot
);
"Session
Close
: couldn't send TPDU on slot %d"
,
i_slot
);
return
;
}
if
(
TPDURecv
(
p_access
,
i_slot
,
&
i_tag
,
NULL
,
NULL
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_access
,
"Session
Open
: couldn't recv TPDU on slot %d"
,
i_slot
);
"Session
Close
: couldn't recv TPDU on slot %d"
,
i_slot
);
return
;
}
}
...
...
@@ -534,6 +564,14 @@ static void SPDUHandle( access_t * p_access, uint8_t i_slot,
SessionClose
(
p_access
,
i_session_id
);
break
;
case
ST_CLOSE_SESSION_RESPONSE
:
i_session_id
=
((
int
)
p_spdu
[
2
]
<<
8
)
|
p_spdu
[
3
];
if
(
p_sys
->
p_sessions
[
i_session_id
-
1
].
pf_close
!=
NULL
)
p_sys
->
p_sessions
[
i_session_id
-
1
].
pf_close
(
p_access
,
i_session_id
);
p_sys
->
p_sessions
[
i_session_id
-
1
].
i_resource_id
=
0
;
break
;
default:
break
;
}
...
...
@@ -1251,16 +1289,151 @@ static void DateTimeOpen( access_t * p_access, int i_session_id )
* MMI
*/
/* Display Control Commands */
#define DCC_SET_MMI_MODE 0x01
#define DCC_DISPLAY_CHARACTER_TABLE_LIST 0x02
#define DCC_INPUT_CHARACTER_TABLE_LIST 0x03
#define DCC_OVERLAY_GRAPHICS_CHARACTERISTICS 0x04
#define DCC_FULL_SCREEN_GRAPHICS_CHARACTERISTICS 0x05
/* MMI Modes */
#define MM_HIGH_LEVEL 0x01
#define MM_LOW_LEVEL_OVERLAY_GRAPHICS 0x02
#define MM_LOW_LEVEL_FULL_SCREEN_GRAPHICS 0x03
/* Display Reply IDs */
#define DRI_MMI_MODE_ACK 0x01
#define DRI_LIST_DISPLAY_CHARACTER_TABLES 0x02
#define DRI_LIST_INPUT_CHARACTER_TABLES 0x03
#define DRI_LIST_GRAPHIC_OVERLAY_CHARACTERISTICS 0x04
#define DRI_LIST_FULL_SCREEN_GRAPHIC_CHARACTERISTICS 0x05
#define DRI_UNKNOWN_DISPLAY_CONTROL_CMD 0xF0
#define DRI_UNKNOWN_MMI_MODE 0xF1
#define DRI_UNKNOWN_CHARACTER_TABLE 0xF2
/* Enquiry Flags */
#define EF_BLIND 0x01
/* Answer IDs */
#define AI_CANCEL 0x00
#define AI_ANSWER 0x01
/*****************************************************************************
* MMIDisplayReply
*****************************************************************************/
static
void
MMIDisplayReply
(
access_t
*
p_access
,
int
i_session_id
)
{
uint8_t
p_response
[
2
];
p_response
[
0
]
=
DRI_MMI_MODE_ACK
;
p_response
[
1
]
=
MM_HIGH_LEVEL
;
APDUSend
(
p_access
,
i_session_id
,
AOT_DISPLAY_REPLY
,
p_response
,
2
);
msg_Dbg
(
p_access
,
"sending DisplayReply on session (%d)"
,
i_session_id
);
}
/*****************************************************************************
* MMIGetText
*****************************************************************************/
static
char
*
MMIGetText
(
access_t
*
p_access
,
char
*
psz_text
,
uint8_t
**
pp_apdu
,
int
*
pi_size
)
{
int
i_tag
=
APDUGetTag
(
*
pp_apdu
,
*
pi_size
);
int
l
;
uint8_t
*
d
;
if
(
i_tag
!=
AOT_TEXT_LAST
)
{
msg_Err
(
p_access
,
"unexpected text tag: %06x"
,
i_tag
);
psz_text
[
0
]
=
'\0'
;
*
pi_size
=
0
;
return
psz_text
;
}
d
=
APDUGetLength
(
*
pp_apdu
,
&
l
);
strncpy
(
psz_text
,
(
char
*
)
d
,
l
);
psz_text
[
l
]
=
'\0'
;
*
pp_apdu
+=
l
+
4
;
*
pi_size
-=
l
+
4
;
return
psz_text
;
}
/*****************************************************************************
* MMIHandle
*****************************************************************************/
static
void
MMIHandle
(
access_t
*
p_access
,
int
i_session_id
,
uint8_t
*
p_apdu
,
int
i_size
)
static
void
MMIHandle
(
access_t
*
p_access
,
int
i_session_id
,
uint8_t
*
p_apdu
,
int
i_size
)
{
int
i_tag
=
APDUGetTag
(
p_apdu
,
i_size
);
switch
(
i_tag
)
{
case
AOT_DISPLAY_CONTROL
:
{
int
l
;
uint8_t
*
d
=
APDUGetLength
(
p_apdu
,
&
l
);
if
(
l
>
0
)
{
switch
(
*
d
)
{
case
DCC_SET_MMI_MODE
:
if
(
l
==
2
&&
d
[
1
]
==
MM_HIGH_LEVEL
)
MMIDisplayReply
(
p_access
,
i_session_id
);
else
msg_Err
(
p_access
,
"unsupported MMI mode %02x"
,
d
[
1
]
);
break
;
default:
msg_Err
(
p_access
,
"unsupported display control command %02x"
,
*
d
);
break
;
}
}
break
;
}
case
AOT_LIST_LAST
:
case
AOT_MENU_LAST
:
{
int
l
;
uint8_t
*
d
=
APDUGetLength
(
p_apdu
,
&
l
);
char
psz_text
[
255
];
if
(
l
>
0
)
{
l
--
;
d
++
;
/* choice_nb */
if
(
l
>
0
)
msg_Info
(
p_access
,
"MMI title: %s"
,
MMIGetText
(
p_access
,
psz_text
,
&
d
,
&
l
)
);
if
(
l
>
0
)
msg_Info
(
p_access
,
"MMI subtitle: %s"
,
MMIGetText
(
p_access
,
psz_text
,
&
d
,
&
l
)
);
if
(
l
>
0
)
msg_Info
(
p_access
,
"MMI bottom: %s"
,
MMIGetText
(
p_access
,
psz_text
,
&
d
,
&
l
)
);
while
(
l
>
0
)
{
msg_Info
(
p_access
,
"MMI: %s"
,
MMIGetText
(
p_access
,
psz_text
,
&
d
,
&
l
)
);
}
}
break
;
}
case
AOT_CLOSE_MMI
:
SessionSendClose
(
p_access
,
i_session_id
);
msg_Dbg
(
p_access
,
"closing MMI session (%d)"
,
i_session_id
);
break
;
default:
msg_Err
(
p_access
,
"unexpected tag in MMIHandle (0x%x)"
,
i_tag
);
}
...
...
@@ -1269,7 +1442,7 @@ static void MMIHandle( access_t * p_access, int i_session_id,
/*****************************************************************************
* MMIOpen
*****************************************************************************/
static
void
MMIOpen
(
access_t
*
p_access
,
int
i_session_id
)
static
void
MMIOpen
(
access_t
*
p_access
,
int
i_session_id
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment