vdr
2.0.4
Main Page
Namespaces
Classes
Files
File List
File Members
PLUGINS
src
dvbhddevice
libhdffcmd
hdffcmd_mux.c
Go to the documentation of this file.
1
/**********************************************************************
2
*
3
* HDFF firmware command interface library
4
*
5
* Copyright (C) 2011 Andreas Regel
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the
19
* Free Software Foundation, Inc.,
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
*
22
*********************************************************************/
23
24
#include <stdint.h>
25
#include <string.h>
26
#include <sys/ioctl.h>
27
28
#include "
hdffcmd.h
"
29
#include "
hdffcmd_base.h
"
30
#include "
hdffcmd_defs.h
"
31
32
33
int
HdffCmdMuxSetVideoOut
(
int
OsdDevice,
HdffVideoOut_t
VideoOut)
34
{
35
uint8_t cmdData[8];
36
BitBuffer_t
cmdBuf;
37
osd_raw_cmd_t
osd_cmd;
38
39
BitBuffer_Init
(&cmdBuf, cmdData,
sizeof
(cmdData));
40
memset(&osd_cmd, 0,
sizeof
(
osd_raw_cmd_t
));
41
osd_cmd.
cmd_data
= cmdData;
42
HdffCmdBuildHeader
(&cmdBuf,
HDFF_MSG_TYPE_COMMAND
,
HDFF_MSG_GROUP_AV_MUX
,
43
HDFF_MSG_MUX_SET_VIDEO_OUT
);
44
BitBuffer_SetBits
(&cmdBuf, 4, VideoOut);
45
BitBuffer_SetBits
(&cmdBuf, 4, 0);
// reserved
46
osd_cmd.
cmd_len
=
HdffCmdSetLength
(&cmdBuf);
47
return
ioctl(OsdDevice,
OSD_RAW_CMD
, &osd_cmd);
48
}
49
50
int
HdffCmdMuxSetVolume
(
int
OsdDevice, uint8_t Volume)
51
{
52
uint8_t cmdData[8];
53
BitBuffer_t
cmdBuf;
54
osd_raw_cmd_t
osd_cmd;
55
56
BitBuffer_Init
(&cmdBuf, cmdData,
sizeof
(cmdData));
57
memset(&osd_cmd, 0,
sizeof
(
osd_raw_cmd_t
));
58
osd_cmd.
cmd_data
= cmdData;
59
HdffCmdBuildHeader
(&cmdBuf,
HDFF_MSG_TYPE_COMMAND
,
HDFF_MSG_GROUP_AV_MUX
,
60
HDFF_MSG_MUX_SET_VOLUME
);
61
BitBuffer_SetBits
(&cmdBuf, 8, Volume);
62
osd_cmd.
cmd_len
=
HdffCmdSetLength
(&cmdBuf);
63
return
ioctl(OsdDevice,
OSD_RAW_CMD
, &osd_cmd);
64
}
65
66
int
HdffCmdMuxMuteAudio
(
int
OsdDevice,
int
Mute)
67
{
68
uint8_t cmdData[8];
69
BitBuffer_t
cmdBuf;
70
osd_raw_cmd_t
osd_cmd;
71
72
BitBuffer_Init
(&cmdBuf, cmdData,
sizeof
(cmdData));
73
memset(&osd_cmd, 0,
sizeof
(
osd_raw_cmd_t
));
74
osd_cmd.
cmd_data
= cmdData;
75
HdffCmdBuildHeader
(&cmdBuf,
HDFF_MSG_TYPE_COMMAND
,
HDFF_MSG_GROUP_AV_MUX
,
76
HDFF_MSG_MUX_SET_AUDIO_MUTE
);
77
BitBuffer_SetBits
(&cmdBuf, 1, Mute);
78
BitBuffer_SetBits
(&cmdBuf, 7, 0);
// reserved
79
osd_cmd.
cmd_len
=
HdffCmdSetLength
(&cmdBuf);
80
return
ioctl(OsdDevice,
OSD_RAW_CMD
, &osd_cmd);
81
}
82
Generated by
1.8.3.1