Skip to content

Commit

Permalink
Merge pull request #18 from zshahaf/master
Browse files Browse the repository at this point in the history
Tree restructure + Context load file
  • Loading branch information
dorodnic authored and GitHub Enterprise committed Jul 23, 2017
2 parents 6a32417 + a10716c commit 744ccde
Show file tree
Hide file tree
Showing 60 changed files with 3,167 additions and 2,347 deletions.
106 changes: 48 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ set(REALSENSE_CPP
src/mock/sql.cpp
src/mock/recorder.cpp

src/recording/record_device.cpp
src/recording/record_sensor.cpp
src/recording/playback_device.cpp
src/recording/playback_sensor.cpp
src/media/record/record_device.cpp
src/media/record/record_sensor.cpp
src/media/playback/playback_device.cpp
src/media/playback/playback_sensor.cpp
)

set(REALSENSE_HPP
Expand Down Expand Up @@ -211,38 +211,33 @@ set(REALSENSE_HPP
src/core/advanced_mode.h
src/core/serialization.h

src/recording/record_device.h
src/recording/record_sensor.h
src/recording/playback_device.h
src/recording/playback_sensor.h
src/recording/device_snapshot.h
src/recording/ros/ros_device_serializer.h
src/recording/ros/ros_reader.h
src/recording/ros/ros_device_serializer_writer.h
src/media/record/record_device.h
src/media/record/record_sensor.h
src/media/playback/playback_device.h
src/media/playback/playback_sensor.h
src/media/device_snapshot.h
src/media/ros/ros_reader.h
src/media/ros/ros_writer.h

third-party/easyloggingpp/src/easylogging++.h
third-party/sqlite/sqlite3.h
src/mock/sql.h
src/mock/recorder.h

src/recording/ros/data_objects/pose.h
src/recording/ros/data_objects/vendor_data.h
src/recording/ros/data_objects/image.h
src/recording/ros/data_objects/motion_stream_info.h
src/recording/ros/data_objects/property.h
src/recording/ros/data_objects/motion_sample.h
src/recording/ros/data_objects/time_sample.h
src/recording/ros/data_objects/compressed_image.h
src/recording/ros/data_objects/occupancy_map.h
src/recording/ros/data_objects/stream_data.h
src/recording/ros/data_objects/image_stream_info.h
src/recording/ros/stream_playback.h
src/recording/ros/file_types.h
src/recording/ros/status.h
src/recording/ros/stream_playback.h
src/recording/ros/ros_writer.h
src/recording/ros/stream_playback.cpp
src/recording/ros/topic.h
src/media/ros/data_objects/pose.h
src/media/ros/data_objects/vendor_data.h
src/media/ros/data_objects/image.h
src/media/ros/data_objects/motion_stream_info.h
src/media/ros/data_objects/property.h
src/media/ros/data_objects/motion_sample.h
src/media/ros/data_objects/time_sample.h
src/media/ros/data_objects/compressed_image.h
src/media/ros/data_objects/occupancy_map.h
src/media/ros/data_objects/stream_data.h
src/media/ros/data_objects/image_stream_info.h
src/media/ros/file_types.h
src/media/ros/status.h
src/media/ros/topic.h
)

# Add additional include directories to allow file to include rosbag headers
Expand Down Expand Up @@ -271,11 +266,10 @@ if(WIN32)
)

source_group("Source Files\\Media" FILES
src/recording/record_device.cpp
src/recording/record_sensor.cpp
src/recording/playback_device.cpp
src/recording/playback_sensor.cpp
src/recording/ros/stream_playback.cpp
src/media/record/record_device.cpp
src/media/record/record_sensor.cpp
src/media/playback/playback_device.cpp
src/media/playback/playback_sensor.cpp
)

source_group("Header Files\\Backend" FILES
Expand Down Expand Up @@ -313,31 +307,27 @@ if(WIN32)
)

source_group("Header Files\\Media" FILES
src/recording/record_device.h
src/recording/playback_device.h
src/recording/playback_sensor.h
src/media/record/record_device.h
src/media/playback/playback_device.h
src/media/playback/playback_sensor.h
)
source_group("Header Files\\Media\\Ros_Serializer" FILES
src/recording/ros/ros_device_serializer.h
src/recording/ros/ros_reader.h
src/recording/ros/ros_device_serializer_writer.h
src/recording/ros/data_objects/pose.h
src/recording/ros/data_objects/vendor_data.h
src/recording/ros/data_objects/image.h
src/recording/ros/data_objects/motion_stream_info.h
src/recording/ros/data_objects/property.h
src/recording/ros/data_objects/motion_sample.h
src/recording/ros/data_objects/time_sample.h
src/recording/ros/data_objects/compressed_image.h
src/recording/ros/data_objects/occupancy_map.h
src/recording/ros/data_objects/stream_data.h
src/recording/ros/data_objects/image_stream_info.h
src/recording/ros/stream_playback.h
src/recording/ros/file_types.h
src/recording/ros/status.h
src/recording/ros/stream_playback.h
src/recording/ros/ros_writer.h
src/recording/ros/topic.h
src/media/ros/ros_reader.h
src/media/ros/ros_writer.h
src/media/ros/data_objects/pose.h
src/media/ros/data_objects/vendor_data.h
src/media/ros/data_objects/image.h
src/media/ros/data_objects/motion_stream_info.h
src/media/ros/data_objects/property.h
src/media/ros/data_objects/motion_sample.h
src/media/ros/data_objects/time_sample.h
src/media/ros/data_objects/compressed_image.h
src/media/ros/data_objects/occupancy_map.h
src/media/ros/data_objects/stream_data.h
src/media/ros/data_objects/image_stream_info.h
src/media/ros/file_types.h
src/media/ros/status.h
src/media/ros/topic.h
)

source_group("Source Files\\Devices" FILES
Expand Down
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ namespace rs2
assert(live_subdevices.size() == subdevices.size());
for(int i=0; i< live_subdevices.size(); i++)
{
//TODO: change this
//TODO: Ziv, change this
subdevices[i]->selected_res_id = live_subdevices[i]->selected_res_id;
subdevices[i]->selected_shared_fps_id = live_subdevices[i]->selected_shared_fps_id;
subdevices[i]->selected_format_id = live_subdevices[i]->selected_format_id;
Expand Down
115 changes: 100 additions & 15 deletions include/librealsense/rs2.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,22 @@ typedef enum rs2_timestamp_domain

typedef enum rs2_extension
{
RS2_EXTENSION_TYPE_UNKNOWN,
RS2_EXTENSION_TYPE_DEBUG,
RS2_EXTENSION_TYPE_INFO,
RS2_EXTENSION_TYPE_MOTION,
RS2_EXTENSION_TYPE_OPTIONS,
RS2_EXTENSION_TYPE_VIDEO,
RS2_EXTENSION_TYPE_ROI,
RS2_EXTENSION_TYPE_DEPTH_SENSOR,
RS2_EXTENSION_TYPE_VIDEO_FRAME,
RS2_EXTENSION_TYPE_MOTION_FRAME,
RS2_EXTENSION_TYPE_COMPOSITE_FRAME,
RS2_EXTENSION_TYPE_POINTS,
RS2_EXTENSION_TYPE_ADVANCED_MODE,
RS2_EXTENSION_TYPE_COUNT
RS2_EXTENSION_UNKNOWN,
RS2_EXTENSION_DEBUG,
RS2_EXTENSION_INFO,
RS2_EXTENSION_MOTION,
RS2_EXTENSION_OPTIONS,
RS2_EXTENSION_VIDEO,
RS2_EXTENSION_ROI,
RS2_EXTENSION_DEPTH_SENSOR,
RS2_EXTENSION_VIDEO_FRAME,
RS2_EXTENSION_MOTION_FRAME,
RS2_EXTENSION_COMPOSITE_FRAME,
RS2_EXTENSION_POINTS,
RS2_EXTENSION_ADVANCED_MODE,
RS2_EXTENSION_RECORD,
RS2_EXTENSION_PLAYBACK,
RS2_EXTENSION_COUNT
} rs2_extension;

/** \brief Video stream intrinsics */
Expand Down Expand Up @@ -1083,7 +1085,6 @@ void rs2_record_device_pause(const rs2_device* device, rs2_error** error);
*/
void rs2_record_device_resume(const rs2_device* device, rs2_error** error);


/**
* Creates a playback device to play the content of the given file
* \param[in] file Path to the file to play
Expand All @@ -1092,6 +1093,90 @@ void rs2_record_device_resume(const rs2_device* device, rs2_error** error);
*/
rs2_device* rs2_create_playback_device(const char* file, rs2_error** error);

/**
* Gets the path of the file used by the playback device
* \param[in] device A playback device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
* \return Path to the file used by the playback device
*/
const char* rs2_playback_device_get_file_path(const rs2_device* device, rs2_error** error);

/**
* Create a new device and add it to the context
* \param ctx The context to which the new device will be added
* \param file The file from which the device should be created
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
* @return A pointer to a device that plays data from the file, or null in case of failure
*/
rs2_device* rs2_context_add_device(rs2_context* ctx, const char* file, rs2_error** error);

/**
* Removes a playback device from the context, if exists
* \param[in] ctx The context from which the device should be removed
* \param[in] file The file name that was used to add the device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
void rs2_context_remove_device(rs2_context* ctx, const char* file, rs2_error** error);

/**
* Gets the total duration of the file in units of nanoseconds
* \param[in] device A playback device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
* \return Total duration of the file in units of nanoseconds
*/
unsigned long long int rs2_playback_get_duration(const rs2_device* device, rs2_error** error);

/**
* Set the playback to a specified time point of the played data
* \param[in] device A playback device.
* \param[in] time The time point to which playback should seek, expressed in units of nanoseconds (zero value = start)
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
void rs2_playback_seek(const rs2_device* device, unsigned long long int time, rs2_error** error);

/**
* Gets the current position of the playback in the file in terms of time. Units are expressed in nanoseconds
* \param[in] device A playback device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
unsigned long long int rs2_playback_get_position(const rs2_device* device, rs2_error** error);

/**
* Pauses the playback
* Calling pause() in "Paused" status does nothing
* If pause() is called while "Playing" or "Stopped", the playback will not play until resume() is called
* \param[in] device A playback device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
void rs2_playback_device_resume(const rs2_device* device, rs2_error** error);

/**
* Un-pauses the playback
* Calling resume(), when in "Playing" or "Stopped" status, does nothing
* \param[in] device A playback device
* \param[out] error If non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
void rs2_playback_device_pause(const rs2_device* device, rs2_error** error);

/**
* Set the playback to work in real time or non real time
*
* In real time mode, playback will play the same way the file was recorded.
* In real time mode if the application takes too long to handle the callback, frames may be dropped.
* In non real time mode, playback will wait for each callback to finish handling the data before
* reading the next frame. In this mode no frames will be dropped, and the application controls the
* frame rate of the playback (according to the callback handler duration).
* \param real_time Indicates if real time is requested, 0 means false, otherwise true
* \return True on successfully setting the requested mode
*/
void rs2_playback_device_set_real_time(const rs2_device* device, int real_time, rs2_error** error);

/**
* Indicates if playback is in real time mode or non real time
* \return True iff playback is in real time mode. 0 means false, otherwise true
*/
int rs2_playback_device_is_real_time(const rs2_device* device, rs2_error** error);

rs2_frame* rs2_allocate_synthetic_video_frame(rs2_source* source, rs2_stream new_stream, rs2_frame* original,
rs2_format new_format, int new_bpp, int new_width, int new_height, int new_stride, rs2_error** error);

Expand Down
Loading

0 comments on commit 744ccde

Please sign in to comment.