Skip to content
This repository
Browse code

bump to 2.0.4. dropped obsolete cec-config

  • Loading branch information...
commit 0c271bd0fc05728d0dd90065a064737a979f50d3 1 parent d484304
Lars Op den Kamp opdenkamp authored
42 ChangeLog
... ... @@ -1,3 +1,45 @@
  1 +libcec (2.0.4-1) unstable; urgency=low
  2 +
  3 + * changed:
  4 + * dropped obsolete cec-config
  5 + * added CEC_CLIENT_VERSION_CURRENT and CEC_SERVER_VERSION_CURRENT. closes
  6 + #88
  7 + * support colon separated data for the 'tx' command in cec-client
  8 + * mark the adapter as (in)active source for firmware v3+
  9 + * fixed:
  10 + * only change the handler of the primary device if the tv has a quirks mode
  11 + not for other devices
  12 + * send an active source message when the route was set to the physical
  13 + address that is handled by libCEC
  14 + * default double tap timeout wasn't set for panasonic
  15 + * philips TVs sometimes keep sending key presses without key releases
  16 + * philips TVs ignore 'image view on' right after they were sent into
  17 + standby. check the power status of the tv every 5 seconds, until it
  18 + reports to have powered on
  19 + * mark a device as powered on when receiving a stream path or routing
  20 + change
  21 + * update the active source status correctly on stream path changes
  22 + * ensure that we only send 'image view on' when needed
  23 + * mark the TV as 'in transition standby -> on' after sending
  24 + 'image view on', so we don't spam the TV with 'image view on' command
  25 + while waiting for it to finish powering up. bugzid: 1603. bugzid: 1609.
  26 + bugzid: 1592
  27 + * request the active source before requesting device information in
  28 + cec-client, or it'll display incorrect information when called the first
  29 + time
  30 + * update the value of CCECProcessor::m_bMonitor when registering a client.
  31 + SetControlled() wasn't called on exit, so it took 30 seconds until it was
  32 + auto-enabled
  33 + * silence 'unused' warning properly. closes #86
  34 + * only change the type of the client to 'playback device' instead of
  35 + 'recorder' for panasonic if the TV is a panasonic. issue #84
  36 + * always poll the TV if it's marked as not present. issue #83. issue #84
  37 + * only set m_iCurrentButton when the duration isn't known yet. fixes
  38 + duplicate key press for vendor remote codes. closes #81
  39 + * delete the right registry key
  40 +
  41 + -- Pulse-Eight Packaging <packaging@pulse-eight.com> Wed, 14 Nov 2012 18:34:00 +0100
  42 +
1 43 libcec (2.0.3-1) unstable; urgency=low
2 44
3 45 * changed:
2  Makefile.am
... ... @@ -1,4 +1,4 @@
1   -SUBDIRS = src/lib src/testclient src/cec-config
  1 +SUBDIRS = src/lib src/testclient
2 2
3 3 docs:
4 4 echo "Updating documentation (if doxygen is present)"
4 configure.ac
@@ -332,7 +332,7 @@ if test "x$HAVE_UNAME" = "xyes"; then
332 332 LIB_INFO="$LIB_INFO on `uname -s` `uname -r` (`uname -m`)"
333 333 fi
334 334
335   -## redefine the LIBS, so cec-client and cec-config aren't linked against things they don't need
  335 +## redefine the LIBS, so cec-client isn't linked against things they don't need
336 336 LIBS_LIBCEC="$LIBS"
337 337 LIBS="$libs_client"
338 338
@@ -357,7 +357,7 @@ AC_SUBST([USE_P8_USB])
357 357 AC_SUBST([USE_P8_USB_DETECT])
358 358 AC_SUBST([USE_RPI_API])
359 359 AC_CONFIG_FILES([src/lib/libcec.pc])
360   -AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile])
  360 +AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile])
361 361
362 362 cat <<EOB
363 363
42 debian/changelog
... ... @@ -1,3 +1,45 @@
  1 +libcec (2.0.4-1) unstable; urgency=low
  2 +
  3 + * changed:
  4 + * dropped obsolete cec-config
  5 + * added CEC_CLIENT_VERSION_CURRENT and CEC_SERVER_VERSION_CURRENT. closes
  6 + #88
  7 + * support colon separated data for the 'tx' command in cec-client
  8 + * mark the adapter as (in)active source for firmware v3+
  9 + * fixed:
  10 + * only change the handler of the primary device if the tv has a quirks mode
  11 + not for other devices
  12 + * send an active source message when the route was set to the physical
  13 + address that is handled by libCEC
  14 + * default double tap timeout wasn't set for panasonic
  15 + * philips TVs sometimes keep sending key presses without key releases
  16 + * philips TVs ignore 'image view on' right after they were sent into
  17 + standby. check the power status of the tv every 5 seconds, until it
  18 + reports to have powered on
  19 + * mark a device as powered on when receiving a stream path or routing
  20 + change
  21 + * update the active source status correctly on stream path changes
  22 + * ensure that we only send 'image view on' when needed
  23 + * mark the TV as 'in transition standby -> on' after sending
  24 + 'image view on', so we don't spam the TV with 'image view on' command
  25 + while waiting for it to finish powering up. bugzid: 1603. bugzid: 1609.
  26 + bugzid: 1592
  27 + * request the active source before requesting device information in
  28 + cec-client, or it'll display incorrect information when called the first
  29 + time
  30 + * update the value of CCECProcessor::m_bMonitor when registering a client.
  31 + SetControlled() wasn't called on exit, so it took 30 seconds until it was
  32 + auto-enabled
  33 + * silence 'unused' warning properly. closes #86
  34 + * only change the type of the client to 'playback device' instead of
  35 + 'recorder' for panasonic if the TV is a panasonic. issue #84
  36 + * always poll the TV if it's marked as not present. issue #83. issue #84
  37 + * only set m_iCurrentButton when the duration isn't known yet. fixes
  38 + duplicate key press for vendor remote codes. closes #81
  39 + * delete the right registry key
  40 +
  41 + -- Pulse-Eight Packaging <packaging@pulse-eight.com> Wed, 14 Nov 2012 18:34:00 +0100
  42 +
1 43 libcec (2.0.3-1) unstable; urgency=low
2 44
3 45 * changed:
6 include/cectypes.h
@@ -1377,7 +1377,8 @@ typedef enum cec_client_version
1377 1377 CEC_CLIENT_VERSION_2_0_1 = 0x2001,
1378 1378 CEC_CLIENT_VERSION_2_0_2 = 0x2002,
1379 1379 CEC_CLIENT_VERSION_2_0_3 = 0x2003,
1380   - CEC_CLIENT_VERSION_CURRENT = 0x2003
  1380 + CEC_CLIENT_VERSION_2_0_4 = 0x2004,
  1381 + CEC_CLIENT_VERSION_CURRENT = 0x2004
1381 1382 } cec_client_version;
1382 1383
1383 1384 typedef enum cec_server_version
@@ -1403,7 +1404,8 @@ typedef enum cec_server_version
1403 1404 CEC_SERVER_VERSION_2_0_1 = 0x2001,
1404 1405 CEC_SERVER_VERSION_2_0_2 = 0x2002,
1405 1406 CEC_SERVER_VERSION_2_0_3 = 0x2003,
1406   - CEC_SERVER_VERSION_CURRENT = 0x2003
  1407 + CEC_SERVER_VERSION_2_0_4 = 0x2004,
  1408 + CEC_SERVER_VERSION_CURRENT = 0x2004
1407 1409 } cec_server_version;
1408 1410
1409 1411 struct libcec_configuration
BIN  project/cec-config.rc
Binary file not shown
184 project/cec-config.vcxproj
... ... @@ -1,184 +0,0 @@
1   -<?xml version="1.0" encoding="utf-8"?>
2   -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3   - <ItemGroup Label="ProjectConfigurations">
4   - <ProjectConfiguration Include="Debug|Win32">
5   - <Configuration>Debug</Configuration>
6   - <Platform>Win32</Platform>
7   - </ProjectConfiguration>
8   - <ProjectConfiguration Include="Debug|x64">
9   - <Configuration>Debug</Configuration>
10   - <Platform>x64</Platform>
11   - </ProjectConfiguration>
12   - <ProjectConfiguration Include="Release|Win32">
13   - <Configuration>Release</Configuration>
14   - <Platform>Win32</Platform>
15   - </ProjectConfiguration>
16   - <ProjectConfiguration Include="Release|x64">
17   - <Configuration>Release</Configuration>
18   - <Platform>x64</Platform>
19   - </ProjectConfiguration>
20   - </ItemGroup>
21   - <PropertyGroup Label="Globals">
22   - <ProjectGuid>{00EE7081-9EEE-485C-B7CE-699A7BCA40C1}</ProjectGuid>
23   - <Keyword>Win32Proj</Keyword>
24   - <RootNamespace>cec-config</RootNamespace>
25   - <ProjectName>cec-config</ProjectName>
26   - </PropertyGroup>
27   - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29   - <ConfigurationType>Application</ConfigurationType>
30   - <UseDebugLibraries>true</UseDebugLibraries>
31   - <CharacterSet>MultiByte</CharacterSet>
32   - </PropertyGroup>
33   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
34   - <ConfigurationType>Application</ConfigurationType>
35   - <UseDebugLibraries>true</UseDebugLibraries>
36   - <CharacterSet>MultiByte</CharacterSet>
37   - </PropertyGroup>
38   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
39   - <ConfigurationType>Application</ConfigurationType>
40   - <UseDebugLibraries>false</UseDebugLibraries>
41   - <CharacterSet>MultiByte</CharacterSet>
42   - </PropertyGroup>
43   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
44   - <ConfigurationType>Application</ConfigurationType>
45   - <UseDebugLibraries>false</UseDebugLibraries>
46   - <CharacterSet>MultiByte</CharacterSet>
47   - </PropertyGroup>
48   - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
49   - <ImportGroup Label="ExtensionSettings">
50   - </ImportGroup>
51   - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
52   - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
53   - </ImportGroup>
54   - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
55   - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56   - </ImportGroup>
57   - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
58   - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
59   - </ImportGroup>
60   - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
61   - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62   - </ImportGroup>
63   - <PropertyGroup Label="UserMacros" />
64   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
65   - <OutDir>$(SolutionDir)..\build\</OutDir>
66   - <TargetName>cec-config</TargetName>
67   - </PropertyGroup>
68   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
69   - <OutDir>$(SolutionDir)..\build\</OutDir>
70   - <TargetName>cec-config.x64</TargetName>
71   - </PropertyGroup>
72   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
73   - <OutDir>$(SolutionDir)..\build\</OutDir>
74   - <TargetName>cec-config</TargetName>
75   - </PropertyGroup>
76   - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
77   - <OutDir>$(SolutionDir)..\build\</OutDir>
78   - <TargetName>cec-config.x64</TargetName>
79   - </PropertyGroup>
80   - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
81   - <ClCompile>
82   - <PrecompiledHeader>
83   - </PrecompiledHeader>
84   - <WarningLevel>Level4</WarningLevel>
85   - <Optimization>Disabled</Optimization>
86   - <PreprocessorDefinitions>_USE_32BIT_TIME_T;_DEBUG;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
87   - <TreatWarningAsError>true</TreatWarningAsError>
88   - <DisableSpecificWarnings>
89   - </DisableSpecificWarnings>
90   - <AdditionalIncludeDirectories>$(SolutiontDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
91   - </ClCompile>
92   - <Link>
93   - <SubSystem>Console</SubSystem>
94   - <GenerateDebugInformation>true</GenerateDebugInformation>
95   - <Version>
96   - </Version>
97   - </Link>
98   - </ItemDefinitionGroup>
99   - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
100   - <ClCompile>
101   - <PrecompiledHeader>
102   - </PrecompiledHeader>
103   - <WarningLevel>Level4</WarningLevel>
104   - <Optimization>Disabled</Optimization>
105   - <PreprocessorDefinitions>_WIN64;_DEBUG;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
106   - <TreatWarningAsError>true</TreatWarningAsError>
107   - <DisableSpecificWarnings>
108   - </DisableSpecificWarnings>
109   - <AdditionalIncludeDirectories>$(SolutiontDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
110   - </ClCompile>
111   - <Link>
112   - <SubSystem>Console</SubSystem>
113   - <GenerateDebugInformation>true</GenerateDebugInformation>
114   - <AdditionalDependencies>
115   - </AdditionalDependencies>
116   - <Version>
117   - </Version>
118   - </Link>
119   - </ItemDefinitionGroup>
120   - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
121   - <ClCompile>
122   - <WarningLevel>Level4</WarningLevel>
123   - <PrecompiledHeader>
124   - </PrecompiledHeader>
125   - <Optimization>Full</Optimization>
126   - <FunctionLevelLinking>false</FunctionLevelLinking>
127   - <IntrinsicFunctions>true</IntrinsicFunctions>
128   - <PreprocessorDefinitions>_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
129   - <TreatWarningAsError>true</TreatWarningAsError>
130   - <DisableSpecificWarnings>
131   - </DisableSpecificWarnings>
132   - <AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
133   - <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
134   - </ClCompile>
135   - <Link>
136   - <SubSystem>Console</SubSystem>
137   - <GenerateDebugInformation>false</GenerateDebugInformation>
138   - <EnableCOMDATFolding>true</EnableCOMDATFolding>
139   - <OptimizeReferences>true</OptimizeReferences>
140   - <Version>
141   - </Version>
142   - </Link>
143   - </ItemDefinitionGroup>
144   - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
145   - <ClCompile>
146   - <WarningLevel>Level4</WarningLevel>
147   - <PrecompiledHeader>
148   - </PrecompiledHeader>
149   - <Optimization>Full</Optimization>
150   - <IntrinsicFunctions>true</IntrinsicFunctions>
151   - <PreprocessorDefinitions>_WIN64;_CRT_SECURE_NO_WARNINGS;_WINSOCKAPI_;__STDC_CONSTANT_MACROS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
152   - <TreatWarningAsError>true</TreatWarningAsError>
153   - <DisableSpecificWarnings>
154   - </DisableSpecificWarnings>
155   - <AdditionalIncludeDirectories>$(SolutionDir)..\include;$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
156   - <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
157   - </ClCompile>
158   - <Link>
159   - <SubSystem>Console</SubSystem>
160   - <GenerateDebugInformation>false</GenerateDebugInformation>
161   - <EnableCOMDATFolding>true</EnableCOMDATFolding>
162   - <OptimizeReferences>true</OptimizeReferences>
163   - <AdditionalDependencies>
164   - </AdditionalDependencies>
165   - <Version>
166   - </Version>
167   - </Link>
168   - </ItemDefinitionGroup>
169   - <ItemGroup>
170   - <ClInclude Include="..\include\cec.h" />
171   - <ClInclude Include="..\include\cecloader.h" />
172   - <ClInclude Include="..\src\lib\platform\threads\mutex.h" />
173   - </ItemGroup>
174   - <ItemGroup>
175   - <ClCompile Include="..\src\cec-config\cec-config.cpp" />
176   - <ClCompile Include="..\src\lib\platform\windows\os-threads.cpp" />
177   - </ItemGroup>
178   - <ItemGroup>
179   - <ResourceCompile Include="cec-config.rc" />
180   - </ItemGroup>
181   - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
182   - <ImportGroup Label="ExtensionTargets">
183   - </ImportGroup>
184   -</Project>
31 project/cec-config.vcxproj.filters
... ... @@ -1,31 +0,0 @@
1   -<?xml version="1.0" encoding="utf-8"?>
2   -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3   - <ItemGroup>
4   - <Filter Include="exports">
5   - <UniqueIdentifier>{cc0a01c1-e1e7-4af8-9656-fa9463140613}</UniqueIdentifier>
6   - </Filter>
7   - <Filter Include="platform">
8   - <UniqueIdentifier>{f08c0a80-22d9-4bdd-90de-b9cf5fa88f99}</UniqueIdentifier>
9   - </Filter>
10   - </ItemGroup>
11   - <ItemGroup>
12   - <ClInclude Include="..\include\cec.h">
13   - <Filter>exports</Filter>
14   - </ClInclude>
15   - <ClInclude Include="..\include\cecloader.h">
16   - <Filter>exports</Filter>
17   - </ClInclude>
18   - <ClInclude Include="..\src\lib\platform\threads\mutex.h">
19   - <Filter>platform</Filter>
20   - </ClInclude>
21   - </ItemGroup>
22   - <ItemGroup>
23   - <ClCompile Include="..\src\cec-config\cec-config.cpp" />
24   - <ClCompile Include="..\src\lib\platform\windows\os-threads.cpp">
25   - <Filter>platform</Filter>
26   - </ClCompile>
27   - </ItemGroup>
28   - <ItemGroup>
29   - <ResourceCompile Include="cec-config.rc" />
30   - </ItemGroup>
31   -</Project>
BIN  project/libcec.rc
Binary file not shown
BIN  project/testclient.rc
Binary file not shown
2  src/CecSharpTester/CecSharpClient.cs
@@ -43,7 +43,7 @@ public CecSharpClient()
43 43 Config = new LibCECConfiguration();
44 44 Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice;
45 45 Config.DeviceName = "CEC Tester";
46   - Config.ClientVersion = CecClientVersion.Version2_0_3;
  46 + Config.ClientVersion = CecClientVersion.Version2_0_4;
47 47 Config.SetCallbacks(this);
48 48 LogLevel = (int)CecLogLevel.All;
49 49
4 src/CecSharpTester/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
32 32 // You can specify all the values or you can default the Build and Revision Numbers
33 33 // by using the '*' as shown below:
34 34 // [assembly: AssemblyVersion("1.0.*")]
35   -[assembly: AssemblyVersion("2.0.3.0")]
36   -[assembly: AssemblyFileVersion("2.0.3.0")]
  35 +[assembly: AssemblyVersion("2.0.4.0")]
  36 +[assembly: AssemblyFileVersion("2.0.4.0")]
2  src/LibCecSharp/AssemblyInfo.cpp
@@ -13,7 +13,7 @@ using namespace System::Security::Permissions;
13 13 [assembly:AssemblyTrademarkAttribute("")];
14 14 [assembly:AssemblyCultureAttribute("")];
15 15
16   -[assembly:AssemblyVersionAttribute("2.0.3.0")];
  16 +[assembly:AssemblyVersionAttribute("2.0.4.0")];
17 17
18 18 [assembly:ComVisible(false)];
19 19 [assembly:CLSCompliantAttribute(true)];
12 src/LibCecSharp/CecSharpTypes.h
@@ -1175,7 +1175,11 @@ namespace CecSharp
1175 1175 /// <summary>
1176 1176 /// v2.0.3
1177 1177 /// </summary>
1178   - Version2_0_3 = 0x2003
  1178 + Version2_0_3 = 0x2003,
  1179 + /// <summary>
  1180 + /// v2.0.4
  1181 + /// </summary>
  1182 + Version2_0_4 = 0x2004
1179 1183 };
1180 1184
1181 1185 /// <summary>
@@ -1266,7 +1270,11 @@ namespace CecSharp
1266 1270 /// <summary>
1267 1271 /// v2.0.3
1268 1272 /// </summary>
1269   - Version2_0_3 = 0x2003
  1273 + Version2_0_3 = 0x2003,
  1274 + /// <summary>
  1275 + /// v2.0.4
  1276 + /// </summary>
  1277 + Version2_0_4 = 0x2004
1270 1278 };
1271 1279
1272 1280 /// <summary>
4 src/LibCecTray/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
31 31 // You can specify all the values or you can default the Build and Revision Numbers
32 32 // by using the '*' as shown below:
33 33 // [assembly: AssemblyVersion("1.0.*")]
34   -[assembly: AssemblyVersion("2.0.3.0")]
35   -[assembly: AssemblyFileVersion("2.0.3.0")]
  34 +[assembly: AssemblyVersion("2.0.4.0")]
  35 +[assembly: AssemblyFileVersion("2.0.4.0")]
2  src/LibCecTray/controller/CECController.cs
@@ -438,7 +438,7 @@ private LibCECConfiguration Config
438 438 {
439 439 if (_config == null)
440 440 {
441   - _config = new LibCECConfiguration { DeviceName = "CEC Tray", ClientVersion = CecClientVersion.Version2_0_3 };
  441 + _config = new LibCECConfiguration { DeviceName = "CEC Tray", ClientVersion = CecClientVersion.Version2_0_4 };
442 442 _config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice;
443 443 _config.SetCallbacks(this);
444 444
5 src/cec-config/Makefile.am
... ... @@ -1,5 +0,0 @@
1   -bin_PROGRAMS = cec-config
2   -cec_config_SOURCES = cec-config.cpp
3   -
4   -cec_config_CPPFLAGS = -I@abs_top_srcdir@/include
5   -cec_config_LDFLAGS = @LIBS@
487 src/cec-config/cec-config.cpp
... ... @@ -1,487 +0,0 @@
1   -/*
2   - * This file is part of the libCEC(R) library.
3   - *
4   - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved.
5   - * libCEC(R) is an original work, containing original code.
6   - *
7   - * libCEC(R) is a trademark of Pulse-Eight Limited.
8   - *
9   - * This program is dual-licensed; you can redistribute it and/or modify
10   - * it under the terms of the GNU General Public License as published by
11   - * the Free Software Foundation; either version 2 of the License, or
12   - * (at your option) any later version.
13   - *
14   - * This program is distributed in the hope that it will be useful,
15   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17   - * GNU General Public License for more details.
18   - *
19   - * You should have received a copy of the GNU General Public License
20   - * along with this program; if not, write to the Free Software
21   - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22   - *
23   - *
24   - * Alternatively, you can license this library under a commercial license,
25   - * please contact Pulse-Eight Licensing for more information.
26   - *
27   - * For more information contact:
28   - * Pulse-Eight Licensing <license@pulse-eight.com>
29   - * http://www.pulse-eight.com/
30   - * http://www.pulse-eight.net/
31   - */
32   -
33   -#include "../env.h"
34   -#include "../include/cec.h"
35   -
36   -#include <cstdio>
37   -#include <fcntl.h>
38   -#include <iostream>
39   -#include <fstream>
40   -#include <string>
41   -#include <sstream>
42   -#include <signal.h>
43   -#include "../lib/platform/threads/mutex.h"
44   -#include "../lib/platform/util/timeutils.h"
45   -#include "../lib/implementations/CECCommandHandler.h"
46   -#include "../lib/platform/util/StdString.h"
47   -
48   -using namespace CEC;
49   -using namespace std;
50   -using namespace PLATFORM;
51   -
52   -#include <cecloader.h>
53   -
54   -CMutex g_outputMutex;
55   -
56   -CEvent g_responseEvent;
57   -cec_opcode g_lastCommand = CEC_OPCODE_NONE;
58   -
59   -CEvent g_keyEvent;
60   -cec_user_control_code g_lastKey = CEC_USER_CONTROL_CODE_UNKNOWN;
61   -
62   -ICECCallbacks g_callbacks;
63   -libcec_configuration g_config;
64   -ICECAdapter * g_parser;
65   -
66   -inline void PrintToStdOut(const char *strFormat, ...)
67   -{
68   - CStdString strLog;
69   -
70   - va_list argList;
71   - va_start(argList, strFormat);
72   - strLog.FormatV(strFormat, argList);
73   - va_end(argList);
74   -
75   - CLockObject lock(g_outputMutex);
76   - cout << strLog << endl;
77   -}
78   -
79   -//get the first word (separated by whitespace) from string data and place that in word
80   -//then remove that word from string data
81   -bool GetWord(string& data, string& word)
82   -{
83   - stringstream datastream(data);
84   - string end;
85   -
86   - datastream >> word;
87   - if (datastream.fail())
88   - {
89   - data.clear();
90   - return false;
91   - }
92   -
93   - size_t pos = data.find(word) + word.length();
94   -
95   - if (pos >= data.length())
96   - {
97   - data.clear();
98   - return true;
99   - }
100   -
101   - data = data.substr(pos);
102   -
103   - datastream.clear();
104   - datastream.str(data);
105   -
106   - datastream >> end;
107   - if (datastream.fail())
108   - data.clear();
109   -
110   - return true;
111   -}
112   -
113   -int CecLogMessage(void *UNUSED(cbParam), const cec_log_message message)
114   -{
115   - switch (message.level)
116   - {
117   - case CEC_LOG_ERROR:
118   - PrintToStdOut("ERROR:\t%s", message.message);
119   - break;
120   - case CEC_LOG_WARNING:
121   - PrintToStdOut("ERROR:\t%s", message.message);
122   - break;
123   - default:
124   - break;
125   - }
126   -
127   - return 0;
128   -}
129   -
130   -int CecKeyPress(void *UNUSED(cbParam), const cec_keypress key)
131   -{
132   - g_lastKey = key.keycode;
133   - g_keyEvent.Signal();
134   - return 0;
135   -}
136   -
137   -int CecCommand(void *UNUSED(cbParam), const cec_command command)
138   -{
139   - g_lastCommand = command.opcode;
140   - g_responseEvent.Signal();
141   - return 0;
142   -}
143   -
144   -bool ProcessConsoleCommand(string &input)
145   -{
146   - if (!input.empty())
147   - {
148   - string command;
149   - if (GetWord(input, command))
150   - {
151   - if (command == "q" || command == "quit")
152   - return false;
153   - }
154   - }
155   - return true;
156   -}
157   -
158   -bool OpenConnection(cec_device_type type = CEC_DEVICE_TYPE_RECORDING_DEVICE)
159   -{
160   - g_config.Clear();
161   - snprintf(g_config.strDeviceName, 13, "CEC-config");
162   - g_config.callbackParam = NULL;
163   - g_config.clientVersion = (uint32_t)CEC_CLIENT_VERSION_CURRENT;
164   - g_callbacks.CBCecLogMessage = &CecLogMessage;
165   - g_callbacks.CBCecKeyPress = &CecKeyPress;
166   - g_callbacks.CBCecCommand = &CecCommand;
167   - g_config.callbacks = &g_callbacks;
168   -
169   - g_config.deviceTypes.Add(type);
170   -
171   - g_parser = LibCecInitialise(&g_config);
172   - if (!g_parser)
173   - return false;
174   -
175   - // init video on targets that need this
176   - g_parser->InitVideoStandalone();
177   -
178   - CStdString strPort;
179   - cec_adapter devices[10];
180   - uint8_t iDevicesFound = g_parser->FindAdapters(devices, 10, NULL);
181   - if (iDevicesFound <= 0)
182   - {
183   - PrintToStdOut("autodetect FAILED");
184   - UnloadLibCec(g_parser);
185   - return false;
186   - }
187   - else
188   - {
189   - strPort = devices[0].comm;
190   - }
191   -
192   - PrintToStdOut("opening a connection to the CEC adapter...");
193   - if (!g_parser->Open(strPort.c_str()))
194   - {
195   - PrintToStdOut("unable to open the device on port %s", strPort.c_str());
196   - UnloadLibCec(g_parser);
197   - return false;
198   - }
199   -
200   - g_parser->GetCurrentConfiguration(&g_config);
201   - PrintToStdOut("CEC Parser created - libCEC version %s", g_parser->ToString((cec_server_version)g_config.serverVersion));
202   -
203   - return true;
204   -}
205   -
206   -int8_t FindPhysicalAddressPortNumber(void)
207   -{
208   - PrintToStdOut("Enter the HDMI port number to which you connected your CEC adapter, followed by <enter>. Valid ports are in the range 1-15. Anything else will cancel this wizard.");
209   - string input;
210   - getline(cin, input);
211   - cin.clear();
212   - if (input.empty())
213   - return -1;
214   -
215   - int hdmiport = atoi(input.c_str());
216   - return (hdmiport < 1 || hdmiport > 15) ? -1 : (int8_t)hdmiport;
217   -}
218   -
219   -cec_logical_address FindPhysicalAddressBaseDevice(void)
220   -{
221   - PrintToStdOut("Press 1 if your CEC adapter is connected to your TV or\nPress 2 if it's connected to an AVR, followed by <enter>. Anything else will cancel this wizard.");
222   -
223   - string input;
224   - getline(cin, input);
225   - cin.clear();
226   - if (input.empty() || (input != "1" && input != "2"))
227   - {
228   - PrintToStdOut("Exiting...");
229   - return CECDEVICE_UNKNOWN;
230   - }
231   - return (input == "2") ?
232   - CECDEVICE_AUDIOSYSTEM :
233   - CECDEVICE_TV;
234   -}
235   -
236   -uint16_t FindPhysicalAddress(void)
237   -{
238   - PrintToStdOut("=== Physical Address Configuration ===\n");
239   - uint16_t iAddress(CEC_INVALID_PHYSICAL_ADDRESS);
240   -
241   - PrintToStdOut("Do you want to let libCEC try to autodetect the address (y/n)?");
242   - string input;
243   - getline(cin, input);
244   - cin.clear();
245   - if (input == "y" || input == "Y")
246   - {
247   - cec_logical_address baseDevice = FindPhysicalAddressBaseDevice();
248   - if (baseDevice == CECDEVICE_UNKNOWN)
249   - return iAddress;
250   -
251   - int8_t iPortNumber = FindPhysicalAddressPortNumber();
252   - if (iPortNumber == -1)
253   - return iAddress;
254   -
255   - PrintToStdOut("Trying to detect the physical address...");
256   - if (!g_parser->SetHDMIPort(baseDevice, iPortNumber))
257   - PrintToStdOut("Failed. Please enter the address manually, or restart this wizard and use different settings.");
258   - else
259   - {
260   - g_parser->GetCurrentConfiguration(&g_config);
261   - iAddress = g_parser->GetDevicePhysicalAddress(g_config.logicalAddresses.primary);
262   - if (iAddress == 0 || iAddress == CEC_INVALID_PHYSICAL_ADDRESS)
263   - PrintToStdOut("Failed. Please enter the address manually, or restart this wizard and use different settings.");
264   - }
265   - }
266   -
267   - if (iAddress == 0 || iAddress == CEC_INVALID_PHYSICAL_ADDRESS)
268   - {
269   - PrintToStdOut("Please enter the physical address (0001 - FFFE), followed by <enter>.");
270   - getline(cin, input);
271   - cin.clear();
272   -
273   - int iAddressTmp;
274   - if (sscanf(input.c_str(), "%x", &iAddressTmp) == 1)
275   - {
276   - if (iAddressTmp <= CEC_PHYSICAL_ADDRESS_TV || iAddressTmp > CEC_MAX_PHYSICAL_ADDRESS)
277   - iAddressTmp = CEC_INVALID_PHYSICAL_ADDRESS;
278   - iAddress = (uint16_t)iAddressTmp;
279   - }
280   - }
281   -
282   - if (iAddress != 0)
283   - {
284   - g_parser->SetPhysicalAddress(iAddress);
285   - g_parser->SetActiveSource(g_config.deviceTypes[0]);
286   - }
287   -
288   - return iAddress;
289   -}
290   -
291   -bool PowerOnTV(uint64_t iTimeout = 60000)
292   -{
293   - cec_power_status currentTvPower(CEC_POWER_STATUS_UNKNOWN);
294   - uint64_t iNow = GetTimeMs();
295   - uint64_t iTarget = iNow + iTimeout;
296   -
297   - currentTvPower = g_parser->GetDevicePowerStatus(CECDEVICE_TV);
298   - if (currentTvPower != CEC_POWER_STATUS_ON)
299   - {
300   - PrintToStdOut("Sending 'power on' command to the TV\n=== Please wait ===");
301   - g_parser->PowerOnDevices(CECDEVICE_TV);
302   - while (iTarget > iNow)
303   - {
304   - g_responseEvent.Wait((uint32_t)(iTarget - iNow));
305   - if (g_lastCommand == CEC_OPCODE_REQUEST_ACTIVE_SOURCE)
306   - break;
307   - iNow = GetTimeMs();
308   - }
309   - }
310   -
311   - currentTvPower = g_parser->GetDevicePowerStatus(CECDEVICE_TV);
312   -
313   - if (currentTvPower != CEC_POWER_STATUS_ON)
314   - PrintToStdOut("Failed to power on the TV, or the TV does not respond properly");
315   -
316   - return currentTvPower == CEC_POWER_STATUS_ON;
317   -}
318   -
319   -void sighandler(int iSignal)
320   -{
321   - PrintToStdOut("signal caught: %d - exiting", iSignal);
322   -
323   - g_parser->Close();
324   - UnloadLibCec(g_parser);
325   -
326   - exit(1);
327   -}
328   -
329   -int main (int UNUSED(argc), char *UNUSED(argv[]))
330   -{
331   - if (signal(SIGINT, sighandler) == SIG_ERR)
332   - {
333   - PrintToStdOut("can't register sighandler");
334   - return -1;
335   - }
336   -
337   - g_callbacks.Clear();
338   - g_config.Clear();
339   - PrintToStdOut("=== USB-CEC Adapter Configuration ===\n");
340   - if (!OpenConnection())
341   - return 1;
342   -
343   - if (!PowerOnTV())
344   - return 1;
345   -
346   - bool bAddressOk(false);
347   - while (!bAddressOk)
348   - {
349   - uint16_t iAddress = FindPhysicalAddress();
350   -
351   - PrintToStdOut("Physical address: %4X", iAddress);
352   - PrintToStdOut("Is this correct (y/n)?");
353   - string input;
354   - getline(cin, input);
355   - cin.clear();
356   - bAddressOk = (input == "y" || input == "Y");
357   - }
358   -
359   - g_parser->GetCurrentConfiguration(&g_config);
360   -
361   - {
362   - cec_menu_language lang;
363   - if (g_parser->GetDeviceMenuLanguage(CECDEVICE_TV, &lang))
364   - {
365   - PrintToStdOut("TV menu language: %s", lang.language);
366   - PrintToStdOut("Do you want the application to use the menu language of the TV (y/n)?");
367   - string input;
368   - getline(cin, input);
369   - cin.clear();
370   - g_config.bUseTVMenuLanguage = (input == "y" || input == "Y") ? 1 : 0;
371   - }
372   - else
373   - {
374   - PrintToStdOut("The TV did not respond properly to the menu language request.");
375   - }
376   - }
377   -
378   - {
379   - PrintToStdOut("Do you want to make the CEC adapter the active source when starting the application (y/n)?");
380   - string input;
381   - getline(cin, input);
382   - cin.clear();
383   - g_config.bActivateSource = (input == "y" || input == "Y") ? 1 : 0;
384   - }
385   -
386   - {
387   - PrintToStdOut("Do you want to power on the TV when starting the application (y/n)?");
388   - string input;
389   - getline(cin, input);
390   - cin.clear();
391   - if (input == "y" || input == "Y")
392   - g_config.wakeDevices.Set(CECDEVICE_TV);
393   - }
394   -
395   - {
396   - PrintToStdOut("Do you want to power off CEC devices when closing the application (y/n)?");
397   - string input;
398   - getline(cin, input);
399   - cin.clear();
400   - if (input == "y" || input == "Y")
401   - g_config.powerOffDevices.Set(CECDEVICE_TV);
402   - }
403   -
404   - {
405   - PrintToStdOut("Do you want to power off CEC devices when the screensaver is activated (y/n)?");
406   - string input;
407   - getline(cin, input);
408   - cin.clear();
409   - g_config.bPowerOffScreensaver = (input == "y" || input == "Y") ? 1 : 0;
410   - }
411   -
412   - {
413   - PrintToStdOut("Do you want to put the PC in standby when the TV is put in standby mode (y/n)?");
414   - string input;
415   - getline(cin, input);
416   - cin.clear();
417   - g_config.bPowerOffOnStandby = (input == "y" || input == "Y") ? 1 : 0;
418   - }
419   -
420   - {
421   - PrintToStdOut("Do you want to send an inactive source message when stopping the application (y/n)?");
422   - string input;
423   - getline(cin, input);
424   - cin.clear();
425   - g_config.bSendInactiveSource = (input == "y" || input == "Y") ? 1 : 0;
426   - }
427   -
428   - PrintToStdOut("\n\n=== USB-CEC Adapter Configuration Summary ===");
429   - PrintToStdOut("HDMI port number: %d", g_config.iHDMIPort);
430   - PrintToStdOut("Connected to HDMI device: %X", (uint8_t)g_config.baseDevice);
431   - PrintToStdOut("Physical address: %4X", g_config.iPhysicalAddress);
432   - PrintToStdOut("Use the TV's language setting: %s", g_config.bUseTVMenuLanguage ? "yes" : "no");
433   - PrintToStdOut("Make the adapter the active source when starting XBMC: %s", g_config.bActivateSource ? "yes" : "no");
434   - PrintToStdOut("Power on the TV when starting XBMC: %s", g_config.wakeDevices.IsSet(CECDEVICE_BROADCAST) ? "yes" : "no");
435   - PrintToStdOut("Power off devices when stopping XBMC: %s", g_config.powerOffDevices.IsSet(CECDEVICE_BROADCAST) ? "yes" : "no");
436   - PrintToStdOut("Put devices in standby mode when activating screensaver: %s", g_config.bPowerOffScreensaver ? "yes" : "no");
437   - PrintToStdOut("Put this PC in standby mode when the TV is switched off: %s", g_config.bPowerOffOnStandby ? "yes" : "no");
438   - PrintToStdOut("Send an inactive source message when stopping XBMC: %s\n\n", g_config.bSendInactiveSource ? "yes" : "no");
439   -
440   - PrintToStdOut("Storing settings ...");
441   - if (g_parser->PersistConfiguration(&g_config))
442   - PrintToStdOut("Settings stored.");
443   - else
444   - PrintToStdOut("The settings could not be stored");
445   -
446   - ofstream configOutput;
447   - configOutput.open("usb_2548_1001.xml");
448   - if (configOutput.is_open())
449   - {
450   - CStdString strWakeDevices;
451   - for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
452   - if (g_config.wakeDevices[iPtr])
453   - strWakeDevices.AppendFormat(" %d", iPtr);
454   - CStdString strStandbyDevices;
455   - for (uint8_t iPtr = 0; iPtr < 16; iPtr++)
456   - if (g_config.powerOffDevices[iPtr])
457   - strStandbyDevices.AppendFormat(" %d", iPtr);
458   -
459   - configOutput <<
460   - "<settings>\n" <<
461   - "\t<setting id=\"enabled\" value=\"1\" />\n" <<
462   - "\t<setting id=\"activate_source\" value=\"" << (int)g_config.bActivateSource << "\" />\n" <<
463   - "\t<setting id=\"wake_devices\" value=\"" << strWakeDevices.c_str() << "\" />\n" <<
464   - "\t<setting id=\"standby_devices\" value=\"" << strStandbyDevices.c_str() << "\" />\n" <<
465   - "\t<setting id=\"cec_standby_screensaver\" value=\"" << (int)g_config.bPowerOffScreensaver << "\" />\n" <<
466   - "\t<setting id=\"standby_pc_on_tv_standby\" value=\"" << (int)g_config.bPowerOffOnStandby << "\" />\n" <<
467   - "\t<setting id=\"use_tv_menu_language\" value=\"" << (int)g_config.bUseTVMenuLanguage << "\" />\n" <<
468   - "\t<setting id=\"physical_address\" value=\"" << hex << g_config.iPhysicalAddress << "\" />\n" <<
469   - "\t<setting id=\"cec_hdmi_port\" value=\"" << g_config.iHDMIPort << "\" />\n" <<
470   - "\t<setting id=\"connected_device\" value=\"" << (int)g_config.baseDevice << "\" />\n" <<
471   - "\t<setting id=\"port\" value=\"\" />\n" <<
472   - "\t<setting id=\"send_inactive_source\" value=\"" << (int)g_config.bSendInactiveSource << "\" />\n" <<
473   - "</settings>";
474   - configOutput.close();
475   -
476   - PrintToStdOut("The configuration has been stored in 'usb_2548_1001.xml'. Copy this file to ~/.userdata/peripheral_data to use it in XBMC");
477   - }
478   -
479   - g_parser->StandbyDevices();
480   - g_parser->Close();
481   - UnloadLibCec(g_parser);
482   -
483   - PrintToStdOut("Press enter to close this wizard.");
484   - string input;
485   - getline(cin, input);
486   - return 0;
487   -}
4 src/lib/CECTypeUtils.h
@@ -563,6 +563,8 @@ namespace CEC
563 563 return "2.0.2";
564 564 case CEC_CLIENT_VERSION_2_0_3:
565 565 return "2.0.3";
  566 + case CEC_CLIENT_VERSION_2_0_4:
  567 + return "2.0.4";
566 568 default:
567 569 return "Unknown";
568 570 }
@@ -614,6 +616,8 @@ namespace CEC
614 616 return "2.0.2";
615 617 case CEC_SERVER_VERSION_2_0_3:
616 618 return "2.0.3";
  619 + case CEC_SERVER_VERSION_2_0_4:
  620 + return "2.0.4";
617 621 default:
618 622 return "Unknown";
619 623 }

0 comments on commit 0c271bd

Please sign in to comment.
Something went wrong with that request. Please try again.