Andrea Bondavalli 466f6b4fc4 First import of HTTP Streamer functionality in the daemon used to receive AES67 audio streams via HTTP file streaming.
The HTTP Streamer can be enabled via the _streamer_enabled_ daemon parameter.
When the Streamer is active the daemon starts capturing the configured _Sinks_ up to the maximum number of channels configured by the _streamer_channels_ parameters.

The captured PCM samples are split into _streamer_files_num_ files of _streamer_file_duration_ duration (in seconds) for each sink, compressed using AAC LC codec and served via HTTP.

The HTTP streamer requires the libfaac-dev package to compile.

Please note that since the HTTP Streamer uses the RAVENNA ALSA device for capturing it's not possible to use such device for other audio captures.
2024-07-06 17:27:49 +02:00

64 lines
2.7 KiB
C++

//
// json.hpp
//
// Copyright (c) 2019 2020 Andrea Bondavalli. All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef _JSON_HPP_
#define _JSON_HPP_
#include <list>
#include "browser.hpp"
#include "session_manager.hpp"
#include "streamer.hpp"
/* JSON serializers */
std::string config_to_json(const Config& config);
std::string source_to_json(const StreamSource& source);
std::string sink_to_json(const StreamSink& sink);
std::string sink_status_to_json(const SinkStreamStatus& status);
std::string ptp_config_to_json(const PTPConfig& config);
std::string ptp_status_to_json(const PTPStatus& status);
std::string sources_to_json(const std::list<StreamSource>& sources);
std::string sinks_to_json(const std::list<StreamSink>& sinks);
std::string streams_to_json(const std::list<StreamSource>& sources,
const std::list<StreamSink>& sinks);
std::string remote_source_to_json(const RemoteSource& source);
std::string remote_sources_to_json(const std::list<RemoteSource>& sources);
std::string streamer_info_to_json(const StreamerInfo& info);
/* JSON deserializers */
Config json_to_config(std::istream& jstream, const Config& curCconfig);
Config json_to_config(std::istream& jstream);
Config json_to_config(const std::string& json, const Config& curConfig);
Config json_to_config(const std::string& json);
StreamSource json_to_source(const std::string& id, const std::string& json);
StreamSink json_to_sink(const std::string& id, const std::string& json);
PTPConfig json_to_ptp_config(const std::string& json);
void json_to_sources(std::istream& jstream, std::list<StreamSource>& sources);
void json_to_sources(const std::string& json, std::list<StreamSource>& sources);
void json_to_sinks(std::istream& jstream, std::list<StreamSink>& sinks);
void json_to_sinks(const std::string& json, std::list<StreamSink>& sinks);
void json_to_streams(std::istream& jstream,
std::list<StreamSource>& sources,
std::list<StreamSink>& sinks);
void json_to_streams(const std::string& json,
std::list<StreamSource>& sources,
std::list<StreamSink>& sinks);
#endif