mirror of
https://github.com/niellun/FastCarPlay.git
synced 2026-07-21 23:10:51 +02:00
fix headers
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
#ifndef SRC_PCM_AUDIO
|
#ifndef SRC_PCM_AUDIO
|
||||||
#define SRC_PCM_AUDIO
|
#define SRC_PCM_AUDIO
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <thread>
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <string>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "common/status.h"
|
|
||||||
|
|
||||||
class AESCipher
|
class AESCipher
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -20,11 +19,11 @@ public:
|
|||||||
bool decrypt(uint8_t *data, uint32_t length, char *err) const;
|
bool decrypt(uint8_t *data, uint32_t length, char *err) const;
|
||||||
|
|
||||||
uint32_t seed() const { return _seed; }
|
uint32_t seed() const { return _seed; }
|
||||||
const std::string& key() const { return _baseKey; }
|
const std::string &key() const { return _baseKey; }
|
||||||
|
|
||||||
static bool error(char* error, const char* message)
|
static bool error(char *error, const char *message)
|
||||||
{
|
{
|
||||||
if(error)
|
if (error)
|
||||||
strcpy(error, message);
|
strcpy(error, message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <ctime>
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
#include "libavcodec/defs.h"
|
#include "libavcodec/defs.h"
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ void Connection::readLoop()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != LIBUSB_SUCCESS || transferred != message->headerSize())
|
if (result != LIBUSB_SUCCESS || transferred != static_cast<int>(message->headerSize()))
|
||||||
{
|
{
|
||||||
if (result != LIBUSB_ERROR_TIMEOUT)
|
if (result != LIBUSB_ERROR_TIMEOUT)
|
||||||
log_w("Header read failed > transfered %d / %d status %d", transferred, message->headerSize(), result);
|
log_w("Header read failed > transfered %d / %d status %d", transferred, message->headerSize(), result);
|
||||||
@@ -310,7 +310,6 @@ void Connection::processLoop()
|
|||||||
{
|
{
|
||||||
if (!_processQueue.wait(_connected))
|
if (!_processQueue.wait(_connected))
|
||||||
continue;
|
continue;
|
||||||
;
|
|
||||||
|
|
||||||
std::unique_ptr<Message> message = _processQueue.pop();
|
std::unique_ptr<Message> message = _processQueue.pop();
|
||||||
if (!message)
|
if (!message)
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <mutex>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "struct/atomic_queue.h"
|
#include "struct/atomic_queue.h"
|
||||||
#include "protocol/aes_cipher.h"
|
#include "protocol/aes_cipher.h"
|
||||||
@@ -23,7 +21,6 @@
|
|||||||
#define AUDIO_QUEUE_SIZE 128
|
#define AUDIO_QUEUE_SIZE 128
|
||||||
#define PROCESS_QUEUE_SIZE 128
|
#define PROCESS_QUEUE_SIZE 128
|
||||||
|
|
||||||
|
|
||||||
#define ENCRYPTION_BASE "SkBRDy3gmrw1ieH0"
|
#define ENCRYPTION_BASE "SkBRDy3gmrw1ieH0"
|
||||||
|
|
||||||
class Connection
|
class Connection
|
||||||
|
|||||||
@@ -4,10 +4,6 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "protocol/protocol_const.h"
|
#include "protocol/protocol_const.h"
|
||||||
#include "common/functions.h"
|
|
||||||
#include "settings.h"
|
|
||||||
#include "protocol/message.h"
|
|
||||||
|
|
||||||
|
|
||||||
Recorder::Recorder()
|
Recorder::Recorder()
|
||||||
: _queue(nullptr), _active(false), _device(0)
|
: _queue(nullptr), _active(false), _device(0)
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,6 @@
|
|||||||
#ifndef SRC_RECORDER
|
#ifndef SRC_RECORDER
|
||||||
#define SRC_RECORDER
|
#define SRC_RECORDER
|
||||||
|
|
||||||
#include <thread>
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
@@ -20,11 +19,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void AudioCallback(void *userdata, Uint8 *stream, int len);
|
static void AudioCallback(void *userdata, Uint8 *stream, int len);
|
||||||
void runner();
|
|
||||||
|
|
||||||
AtomicQueue<Message> *_queue;
|
AtomicQueue<Message> *_queue;
|
||||||
std::atomic<bool> _active;
|
std::atomic<bool> _active;
|
||||||
SDL_AudioDeviceID _device;
|
SDL_AudioDeviceID _device;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SRC_RECORDER */
|
#endif /* SRC_RECORDER */
|
||||||
|
|||||||
Reference in New Issue
Block a user