Skip to content

Commit

Permalink
streaming.h is no more!
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Nov 5, 2023
1 parent 4f93c83 commit 36bf9bd
Show file tree
Hide file tree
Showing 57 changed files with 234 additions and 151 deletions.
2 changes: 2 additions & 0 deletions src/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "core/pose-frame.h"
#include "core/motion-frame.h"
#include "core/disparity-frame.h"
#include "composite-frame.h"
#include "points.h"


namespace librealsense
Expand Down
7 changes: 4 additions & 3 deletions src/archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

#pragma once

#include "types.h"
#include "core/streaming.h"
#include "core/stream-profile.h"
#include "core/frame-additional-data.h"
#include "callback-invocation.h"


namespace librealsense
{
struct frame_additional_data;
class frame_interface;
class sensor_interface;

class archive_interface
{
Expand Down
5 changes: 3 additions & 2 deletions src/auto-calibrated-device.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2019 Intel Corporation. All Rights Reserved.

#pragma once

#include "types.h"
#include "core/streaming.h"
#include "core/extension.h"
#include <vector>


namespace librealsense
{
Expand Down
3 changes: 3 additions & 0 deletions src/backend-device-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include "fw-update/fw-update-factory.h"
#include "platform-camera.h"

#include <librealsense2/h/rs_context.h>

#include <rsutils/easylogging/easyloggingpp.h>
#include <rsutils/shared-ptr-singleton.h>
#include <rsutils/signal.h>
#include <rsutils/json.h>
Expand Down
4 changes: 3 additions & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Copyright(c) 2019 Intel Corporation. All Rights Reserved.
target_sources(${LRS_TARGET}
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/streaming.h"
"${CMAKE_CURRENT_LIST_DIR}/debug.h"
"${CMAKE_CURRENT_LIST_DIR}/advanced_mode.h"
"${CMAKE_CURRENT_LIST_DIR}/enum-helpers.h"
Expand Down Expand Up @@ -31,8 +30,11 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/processing.h"
"${CMAKE_CURRENT_LIST_DIR}/processing-block-interface.h"
"${CMAKE_CURRENT_LIST_DIR}/recommended-proccesing-blocks-interface.h"
"${CMAKE_CURRENT_LIST_DIR}/recommended-proccesing-blocks-base.h"
"${CMAKE_CURRENT_LIST_DIR}/sensor-interface.h"
"${CMAKE_CURRENT_LIST_DIR}/serialization.h"
"${CMAKE_CURRENT_LIST_DIR}/stream-interface.h"
"${CMAKE_CURRENT_LIST_DIR}/stream-profile.h"
"${CMAKE_CURRENT_LIST_DIR}/stream-profile-interface.h"
"${CMAKE_CURRENT_LIST_DIR}/tagged-profile.h"
)
3 changes: 1 addition & 2 deletions src/core/advanced_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

#include "ds/ds-private.h"
#include "hw-monitor.h"
#include "streaming.h"
#include "option.h"
#include "ds/advanced_mode/presets.h"
#include "../../include/librealsense2/h/rs_advanced_mode_command.h"
#include <librealsense2/h/rs_advanced_mode_command.h>
#include "serializable-interface.h"
#include <rsutils/lazy.h>

Expand Down
1 change: 1 addition & 0 deletions src/core/disparity-frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "depth-frame.h"
#include "sensor-interface.h"
#include "depth-sensor.h"
#include "extension.h"


Expand Down
1 change: 1 addition & 0 deletions src/core/matcher-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "matcher-factory.h"
#include "frame-holder.h"
#include "stream-interface.h"

#include <src/sync.h>

Expand Down
3 changes: 2 additions & 1 deletion src/core/motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// Copyright(c) 2015 Intel Corporation. All Rights Reserved.
#pragma once

#include "stream-profile-interface.h"
#include <src/types.h>

#include "streaming.h"

namespace librealsense
{
Expand Down
32 changes: 32 additions & 0 deletions src/core/recommended-proccesing-blocks-base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.
#pragma once

#include "recommended-proccesing-blocks-interface.h"
#include "extension.h"


namespace librealsense
{
class recommended_proccesing_blocks_base : public virtual recommended_proccesing_blocks_interface, public virtual recordable<recommended_proccesing_blocks_interface>
{
public:
recommended_proccesing_blocks_base(recommended_proccesing_blocks_interface* owner)
:_owner(owner)
{}

virtual processing_blocks get_recommended_processing_blocks() const override { return _owner->get_recommended_processing_blocks(); };

virtual void create_snapshot(std::shared_ptr<recommended_proccesing_blocks_interface>& snapshot) const override
{
snapshot = std::make_shared<recommended_proccesing_blocks_snapshot>(get_recommended_processing_blocks());
}

virtual void enable_recording(std::function<void(const recommended_proccesing_blocks_interface&)> recording_function) override {}

private:
recommended_proccesing_blocks_interface* _owner;
};


}
4 changes: 3 additions & 1 deletion src/core/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
#include <vector>
#include "../types.h"
#include "extension.h"
#include "streaming.h"
#include "frame-holder.h"
#include "stream-profile-interface.h"


namespace librealsense
{
class option;

namespace device_serializer
{
struct sensor_identifier
Expand Down
33 changes: 33 additions & 0 deletions src/core/stream-interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.
#pragma once

#include <librealsense2/h/rs_sensor.h>
#include <memory>
#include <vector>


namespace librealsense {


class stream_interface : public std::enable_shared_from_this< stream_interface >
{
public:
virtual ~stream_interface() = default;

virtual int get_stream_index() const = 0;
virtual void set_stream_index( int index ) = 0;

virtual int get_unique_id() const = 0;
virtual void set_unique_id( int uid ) = 0;

virtual rs2_stream get_stream_type() const = 0;
virtual void set_stream_type( rs2_stream stream ) = 0;
};


// TODO this should be find_stream
stream_interface * find_profile( rs2_stream stream, int index, std::vector< stream_interface * > const & profiles );


} // namespace librealsense
51 changes: 51 additions & 0 deletions src/core/stream-profile-interface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.
#pragma once

#include "stream-interface.h"
#include "extension.h"

#include <librealsense2/h/rs_sensor.h>
#include <functional>
#include <memory>
#include <vector>
#include <ostream>


namespace librealsense {


class stream_profile_interface
: public stream_interface
, public recordable< stream_profile_interface >
{
public:
virtual rs2_format get_format() const = 0;
virtual void set_format( rs2_format format ) = 0;

virtual uint32_t get_framerate() const = 0;
virtual void set_framerate( uint32_t val ) = 0;

virtual int get_tag() const = 0;
virtual void tag_profile( int tag ) = 0;

virtual std::shared_ptr< stream_profile_interface > clone() const = 0;
virtual rs2_stream_profile * get_c_wrapper() const = 0;
virtual void set_c_wrapper( rs2_stream_profile * wrapper ) = 0;
};


using stream_profiles = std::vector< std::shared_ptr< stream_profile_interface > >;


inline std::ostream & operator<<( std::ostream & os, const stream_profiles & profiles )
{
for( auto & p : profiles )
{
os << rs2_format_to_string( p->get_format() ) << " " << rs2_stream_to_string( p->get_stream_type() ) << ", ";
}
return os;
}


} // namespace librealsense
97 changes: 0 additions & 97 deletions src/core/streaming.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright(c) 2015 Intel Corporation. All Rights Reserved.
#pragma once

#include "streaming.h"
#include "stream-profile-interface.h"

namespace librealsense
{
Expand Down
1 change: 1 addition & 0 deletions src/dds/rs-dds-color-sensor-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include "rs-dds-sensor-proxy.h"
#include <src/color-sensor.h>


namespace librealsense {
Expand Down
1 change: 1 addition & 0 deletions src/dds/rs-dds-depth-sensor-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include "rs-dds-sensor-proxy.h"
#include <src/depth-sensor.h>


namespace librealsense {
Expand Down
5 changes: 3 additions & 2 deletions src/debug-stream-sensor.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2020 Intel Corporation. All Rights Reserved.

#pragma once

#include "core/streaming.h"
#include "core/extension.h"
#include "core/stream-profile-interface.h"


namespace librealsense
{
Expand Down
Loading

0 comments on commit 36bf9bd

Please sign in to comment.