strip added smb:// shares of their user/pass when adding, and instead store that...
[vuplus_xbmc] / xbmc / cores / AudioEngine / Sinks / AESinkProfiler.cpp
1 /*
2  *      Copyright (C) 2010-2012 Team XBMC
3  *      http://www.xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, write to
17  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18  *  http://www.gnu.org/copyleft/gpl.html
19  *
20  */
21
22 #include "system.h"
23
24 #include "AESinkProfiler.h"
25 #include <stdint.h>
26 #include <limits.h>
27
28 #include "Utils/AEUtil.h"
29 #include "utils/StdString.h"
30 #include "utils/log.h"
31 #include "utils/TimeUtils.h"
32 #include "settings/GUISettings.h"
33
34 CAESinkProfiler::CAESinkProfiler()
35 {
36 }
37
38 CAESinkProfiler::~CAESinkProfiler()
39 {
40 }
41
42 bool CAESinkProfiler::Initialize(AEAudioFormat &format, std::string &device)
43 {
44   if (AE_IS_RAW(format.m_dataFormat))
45     return false;
46
47   format.m_sampleRate    = 192000;
48   format.m_channelLayout = AE_CH_LAYOUT_7_1;
49   format.m_dataFormat    = AE_FMT_S32LE;
50   format.m_frames        = 30720;
51   format.m_frameSamples  = format.m_channelLayout.Count();
52   format.m_frameSize     = format.m_frameSamples * sizeof(float);
53   return true;
54 }
55
56 void CAESinkProfiler::Deinitialize()
57 {
58 }
59
60 bool CAESinkProfiler::IsCompatible(const AEAudioFormat format, const std::string device)
61 {
62   if (AE_IS_RAW(format.m_dataFormat))
63     return false;
64
65   if (format.m_dataFormat != AE_FMT_FLOAT)
66     return false;
67
68   return true;
69 }
70
71 double CAESinkProfiler::GetDelay()
72 {
73   return 0.0f;
74 }
75
76 unsigned int CAESinkProfiler::AddPackets(uint8_t *data, unsigned int frames)
77 {
78   int64_t ts = CurrentHostCounter();
79   CLog::Log(LOGDEBUG, "CAESinkProfiler::AddPackets - latency %f ms", (float)(ts - m_ts) / 1000000.0f);
80   m_ts = ts;
81   return frames;
82 }
83
84 void CAESinkProfiler::Drain()
85 {
86 }
87
88 void CAESinkProfiler::EnumerateDevices (AEDeviceList &devices, bool passthrough)
89 {
90   devices.push_back(AEDevice("Profiler", "Profiler"));
91 }