Skip to content

Commit

Permalink
Bug
Browse files Browse the repository at this point in the history
[XSTUDIO-1267] - xStudio : scrubbing on viewer has lag
[XSTUDIO-1527] - Repeated spam when broken media selected ?
[XSTUDIO-1576] - Mute and sound settings
[XSTUDIO-1622] - Default Compare Mode preference is broken
[XSTUDIO-1623] - Up/Down hotkeys break sometimes
[XSTUDIO-1626] - Media Info Bar metadata is missing for ProRes files
[XSTUDIO-1636] - xStudio Crashes when adding .gif to Playlists
[XSTUDIO-1649] - Text caption notes & bugs
[XSTUDIO-1659] - Notes panel : "Note Type" dropdown menu is transparent - hard to read
[XSTUDIO-1678] - Resolve playhead-video refresh sync
[XSTUDIO-1682] - Display Settings not change from sRGB
[XSTUDIO-1687] - Primary grade that is just saturation change has no effect
[XSTUDIO-1690] - Viewport launch on EIZO display but frame displayed actually is sRGB
[XSTUDIO-1713] - Pipeline Step filter shananigans
[XSTUDIO-1715] - Loading from commandline always selects
[XSTUDIO-1716] - Snapshot doesn't render strokes correctly
[XSTUDIO-1719] - View lut error in xstudio release candidate
[XSTUDIO-1723] - xstudio save session file path issue

New Feature
[XSTUDIO-1315] - Add "Align And Trim" option to compare modes
[XSTUDIO-1386] - First Pass Text labels - Mouse keyboard interactions with caption
[XSTUDIO-1450] - Python methods to get and set metadata for a media source
[XSTUDIO-1691] - Make march configurable in CMakeFiles

Improvement
[XSTUDIO-1575] - UI minor tweaks
[XSTUDIO-1609] - Improve stability of preference saving
[XSTUDIO-1663] - Update CMAKE files so we can use DNEGs version..
[XSTUDIO-1688] - Add "Note Type" text into the Note Type dropdown box if empty

Signed-off-by: Al Crate <al@dneg.com>
  • Loading branch information
alatdneg committed Mar 1, 2023
1 parent 356714f commit 18466e2
Show file tree
Hide file tree
Showing 148 changed files with 4,942 additions and 3,534 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@










2 changes: 1 addition & 1 deletion cmake/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ macro(create_test PATH DEPS)
)
set_target_properties(${NAME} PROPERTIES LINK_DEPENDS_NO_SHARED true)

add_test(${PARENT}_tests ${NAME})
add_test(${PARENT}_${NAME} ${NAME})

endmacro()

Expand Down
2 changes: 2 additions & 0 deletions include/xstudio/atoms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ CAF_BEGIN_TYPE_ID_BLOCK(xstudio_playback_atoms, xstudio_session_atoms_last_type_
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::playhead, viewport_events_group_atom)

// **************** add new entries here ******************
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::playhead, last_frame_media_pointer_atom)
CAF_ADD_ATOM(xstudio_playback_atoms, xstudio::colour_pipeline, display_colour_transform_hash_atom)

CAF_END_TYPE_ID_BLOCK(xstudio_playback_atoms)

Expand Down
2 changes: 2 additions & 0 deletions include/xstudio/colour_pipeline/colour_pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ namespace colour_pipeline {
virtual thumbnail::ThumbnailBufferPtr process_thumbnail(
const media::AVFrameID &media_ptr, const thumbnail::ThumbnailBufferPtr &buf) = 0;

virtual std::string fast_display_transform_hash(const media::AVFrameID &media_ptr) = 0;

protected:
utility::Uuid uuid_;
};
Expand Down
29 changes: 28 additions & 1 deletion include/xstudio/colour_pipeline/colour_pipeline_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ namespace colour_pipeline {
get_cached_colour_pipeline_data(rp, media_ptr);
return rp;
},
[=](display_colour_transform_hash_atom,
const media::AVFrameID &media_ptr) -> std::string {
return colour_pipeline_->fast_display_transform_hash(media_ptr);
},
[=](media_reader::process_thumbnail_atom,
const media::AVFrameID &mptr,
const thumbnail::ThumbnailBufferPtr &buf)
Expand Down Expand Up @@ -198,6 +202,16 @@ namespace colour_pipeline {
},
caf::actor_pool::round_robin());
link_to(pool_);

thumbnail_processor_pool_ = caf::actor_pool::make(
system().dummy_execution_unit(),
colour_pipeline_worker_count,
[&] {
return system().template spawn<ColourPipelineWorkerActor<T>>(
init_settings, &colour_pipeline_, cache_);
},
caf::actor_pool::round_robin());
link_to(thumbnail_processor_pool_);
}

~ColourPipelineActor() override = default;
Expand All @@ -213,6 +227,7 @@ namespace colour_pipeline {
caf::actor cache_;
caf::actor event_group_;
caf::actor pool_;
caf::actor thumbnail_processor_pool_;
utility::Uuid uuid_;
T colour_pipeline_;
};
Expand All @@ -228,6 +243,14 @@ namespace colour_pipeline {
[=](get_colour_pipe_data_atom atom, const media::AVFrameID &media_ptr) {
delegate(pool_, atom, media_ptr);
},
[=](get_colour_pipe_data_atom atom,
const media::AVFrameID &media_ptr,
bool use_thumbnail_pool) {
delegate(thumbnail_processor_pool_, atom, media_ptr);
},
[=](display_colour_transform_hash_atom atom, const media::AVFrameID &media_ptr) {
delegate(thumbnail_processor_pool_, atom, media_ptr);
},
[=](get_colour_pipe_data_atom,
const media::AVFrameIDsAndTimePoints &mptr_and_timepoints)
-> caf::result<std::vector<ColourPipelineDataPtr>> {
Expand Down Expand Up @@ -298,7 +321,11 @@ namespace colour_pipeline {
[=](media_reader::process_thumbnail_atom,
const media::AVFrameID &mptr,
const thumbnail::ThumbnailBufferPtr &buf) {
delegate(pool_, media_reader::process_thumbnail_atom_v, mptr, buf);
delegate(
thumbnail_processor_pool_,
media_reader::process_thumbnail_atom_v,
mptr,
buf);
},
[=](json_store::update_atom,
const utility::JsonStore & /*change*/,
Expand Down
3 changes: 3 additions & 0 deletions include/xstudio/global/global_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <caf/behavior.hpp>
#include <caf/event_based_actor.hpp>

#include "xstudio/global/enums.hpp"
#include "xstudio/utility/exports.hpp"
#include "xstudio/utility/remote_session_file.hpp"
#include "xstudio/utility/logging.hpp"
Expand Down Expand Up @@ -57,6 +58,8 @@ namespace global {
caf::uri session_autosave_path_{};
int session_autosave_interval_{300};
size_t session_autosave_hash_{0};
StatusType status_{StatusType::ST_NONE};
std::set<caf::actor_addr> busy_;
};
} // namespace global
} // namespace xstudio
15 changes: 15 additions & 0 deletions include/xstudio/media_reader/image_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "xstudio/media/media.hpp"
#include "xstudio/media_reader/buffer.hpp"
#include "xstudio/media_reader/audio_buffer.hpp"
#include "xstudio/media_reader/pixel_info.hpp"
#include "xstudio/ui/viewport/shader.hpp"
#include "xstudio/colour_pipeline/colour_pipeline.hpp"

Expand Down Expand Up @@ -57,6 +58,17 @@ namespace media_reader {
[[nodiscard]] int decoder_frame_number() const { return frame_num_; }
void set_decoder_frame_number(const int f) { frame_num_ = f; }

typedef std::function<PixelInfo(
const ImageBuffer &buf, const Imath::V2i &pixel_location)>
PixelPickerFunc;
void set_pixel_picker_func(PixelPickerFunc func) { pixel_picker_ = func; }

PixelInfo pixel_info(const Imath::V2i &pixel_location) const {
if (pixel_picker_)
return pixel_picker_(*this, pixel_location);
return PixelInfo(pixel_location);
}

AudioBufPtr audio_;

private:
Expand All @@ -69,6 +81,7 @@ namespace media_reader {
double frame_duration_ = {1.0};
int frame_num_ = -1;
ui::viewport::GPUShaderPtr shader_;
PixelPickerFunc pixel_picker_;
};

/* Extending std::shared_ptr<ImageBuffer> by adding a pointer to colour pipe
Expand Down Expand Up @@ -111,6 +124,8 @@ namespace media_reader {

bool operator<(const timebase::flicks &t) const { return tts_ < t; }

bool operator>(const timebase::flicks &t) const { return tts_ > t; }

colour_pipeline::ColourPipelineDataPtr colour_pipe_data_;
utility::time_point when_to_display_;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <caf/all.hpp>

#include <queue>

#include "xstudio/media/media.hpp"
#include "xstudio/media_reader/media_reader.hpp"
#include "xstudio/utility/uuid.hpp"
Expand Down Expand Up @@ -77,15 +79,19 @@ namespace media_reader {
private:
inline static const std::string NAME = "MediaDetailAndThumbnailReaderActor";
caf::behavior behavior_;
std::vector<MediaDetailRequest> media_detail_request_queue_;

int num_detail_requests_since_thumbnail_request_ = {0};

std::queue<MediaDetailRequest> media_detail_request_queue_;
std::queue<ThumbnailRequest> thumbnail_request_queue_;

std::map<caf::uri, media::MediaDetail> media_detail_cache_;
std::map<caf::uri, utility::time_point> media_detail_cache_age_;

utility::Uuid uuid_;
std::vector<ThumbnailRequest> thumbnail_request_queue_;
caf::actor colour_pipe_manager_;
std::vector<caf::actor> plugins_;
std::map<utility::Uuid, caf::actor> plugins_map_;
std::map<caf::uri, media::MediaDetail> media_detail_cache_;
std::map<caf::uri, utility::time_point> media_detail_cache_age_;
int num_detail_requests_since_thumbnail_request_ = {0};
};
} // namespace media_reader
} // namespace xstudio
20 changes: 20 additions & 0 deletions include/xstudio/media_reader/media_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "xstudio/media_reader/audio_buffer.hpp"
#include "xstudio/media_reader/frame_request_queue.hpp"
#include "xstudio/media_reader/image_buffer.hpp"
#include "xstudio/media_reader/pixel_info.hpp"
#include "xstudio/plugin_manager/plugin_factory.hpp"
#include "xstudio/thumbnail/thumbnail.hpp"
#include "xstudio/utility/helpers.hpp"
Expand All @@ -53,7 +54,17 @@ namespace media_reader {
[[nodiscard]] std::string name() const;

virtual void update_preferences(const utility::JsonStore &prefs);

virtual ImageBufPtr image(const media::AVFrameID &mptr);

virtual ImageBufPtr partial_image(
const media::AVFrameID &mptr,
ImageBufPtr &current_loaded,
const Imath::Box2f &viewport_visible_area,
const Imath::V2i &viewport_size_screen_pixels,
const Imath::M44f &image_transform) {
return image(mptr);
}
virtual AudioBufPtr audio(const media::AVFrameID &mptr);

virtual std::shared_ptr<thumbnail::ThumbnailBuffer>
Expand All @@ -62,12 +73,20 @@ namespace media_reader {
[[nodiscard]] virtual uint8_t maximum_readers(const caf::uri &uri) const;
[[nodiscard]] virtual bool prefer_sequential_access(const caf::uri &uri) const;
[[nodiscard]] virtual bool can_decode_audio() const;
[[nodiscard]] virtual bool can_do_partial_frames() const;
[[nodiscard]] virtual utility::Uuid plugin_uuid() const = 0;
[[nodiscard]] virtual ImageBuffer::PixelPickerFunc pixel_picker_func() const {
return &MediaReader::default_pixel_picker;
}

virtual MRCertainty
supported(const caf::uri &uri, const std::array<uint8_t, 16> &signature);

private:
static PixelInfo
default_pixel_picker(const ImageBuffer &buf, const Imath::V2i &pixel_location) {
return PixelInfo(pixel_location);
}
const std::string name_;
};

Expand Down Expand Up @@ -132,6 +151,7 @@ namespace media_reader {
mb = media_reader_.image(mptr);
if (mb) {
mb->set_media_key(mptr.key_);
mb->set_pixel_picker_func(media_reader_.pixel_picker_func());
if (mb->audio_) {
mb->audio_->set_media_key(mptr.key_);
}
Expand Down
42 changes: 42 additions & 0 deletions include/xstudio/media_reader/pixel_info.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#include <Imath/ImathVec.h>

namespace xstudio {
namespace media_reader {

/**
* @brief PixelInfo class. A simple class to hold colour information about some pixel
* in the image.
*
*/
class PixelInfo {

public:
PixelInfo(const Imath::V2i &location_in_image) : location_(location_in_image) {}

PixelInfo(const PixelInfo &o) = default;

~PixelInfo() = default;

void add_pixel_channel_info(const std::string &channel_name, const float pixel_value) {
data_.push_back(PixelChannelInfo{channel_name, pixel_value});
}

struct PixelChannelInfo {
std::string channel_name;
float pixel_value;
};

typedef std::vector<PixelChannelInfo> PixelChannelsData;

[[nodiscard]] const PixelChannelsData &data() const { return data_; }
[[nodiscard]] const Imath::V2i &location_in_image() const { return location_; }

private:
PixelChannelsData data_;
Imath::V2i location_;
};
} // namespace media_reader
} // namespace xstudio
2 changes: 2 additions & 0 deletions include/xstudio/playhead/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace playhead {
CM_OFF
} CompareMode;

typedef enum { AAM_ALIGN_OFF = 0, AAM_ALIGN_FRAMES, AAM_ALIGN_TRIM } AutoAlignMode;

typedef enum { LM_PLAY_ONCE = 0, LM_LOOP, LM_PING_PONG } LoopMode;

typedef enum {
Expand Down
13 changes: 10 additions & 3 deletions include/xstudio/playhead/playhead.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace playhead {

[[nodiscard]] bool playing() const { return playing_->value(); }
[[nodiscard]] bool forward() const { return forward_->value(); }
[[nodiscard]] bool auto_align() const { return auto_align_->value(); }
[[nodiscard]] AutoAlignMode auto_align_mode() const;
[[nodiscard]] LoopMode loop() const { return loop_; }
[[nodiscard]] CompareMode compare_mode() const;
[[nodiscard]] float velocity() const { return velocity_->value(); }
Expand Down Expand Up @@ -77,7 +77,7 @@ namespace playhead {
}
void set_playhead_rate(const utility::FrameRate &rate) { playhead_rate_ = rate; }
void set_source(const utility::Uuid &uuid) { source_uuid_ = uuid; }
void set_duration(const timebase::flicks duration) { duration_ = duration; }
void set_duration(const timebase::flicks duration);
void set_compare_mode(const CompareMode mode);

bool set_use_loop_range(const bool use_loop_range);
Expand Down Expand Up @@ -106,6 +106,13 @@ namespace playhead {
{CM_GRID, "Grid", "Grid", false},
{CM_OFF, "Off", "Off", true}};

inline static const std::vector<
std::tuple<AutoAlignMode, std::string, std::string, bool>>
auto_align_mode_names = {
{AAM_ALIGN_OFF, "Off", "Off", true},
{AAM_ALIGN_FRAMES, "On", "On", true},
{AAM_ALIGN_TRIM, "On (Trim)", "Trim", true}};

LoopMode loop_{LM_LOOP};
utility::TimeSourceMode play_rate_mode_{utility::TimeSourceMode::DYNAMIC};
utility::FrameRate playhead_rate_;
Expand Down Expand Up @@ -138,7 +145,7 @@ namespace playhead {
module::FloatAttribute *velocity_multiplier_;
module::BooleanAttribute *playing_;
module::BooleanAttribute *forward_;
module::BooleanAttribute *auto_align_;
module::StringChoiceAttribute *auto_align_mode_;

module::IntegerAttribute *max_compare_sources_;
module::BooleanAttribute *restore_play_state_after_scrub_;
Expand Down
3 changes: 1 addition & 2 deletions include/xstudio/playhead/playhead_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ namespace playhead {
void rebuild_bookmark_frames_ranges();
void
select_media(const utility::UuidList &selection, caf::typed_response_promise<bool> &rp);
void align_clip_frame_numbers(caf::typed_response_promise<bool> rp);
void equalise_clip_lengths();
void align_clip_frame_numbers();
void move_playhead_to_last_viewed_frame_of_current_source();
void
move_playhead_to_last_viewed_frame_of_given_source(const utility::Uuid &source_uuid);
Expand Down
3 changes: 2 additions & 1 deletion include/xstudio/playhead/retime_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace playhead {
int frames_offset_;
utility::Uuid uuid_;
utility::EditList source_edit_list_, retime_edit_list_;
OverflowMode overflow_mode_ = {OM_HOLD};
OverflowMode overflow_mode_ = {OM_HOLD};
timebase::flicks forced_duration_ = {timebase::k_flicks_zero_seconds};
};
} // namespace playhead
} // namespace xstudio
1 change: 1 addition & 0 deletions include/xstudio/playhead/sub_playhead.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ namespace playhead {
const media::MediaType media_type_;
std::shared_ptr<const media::AVFrameID> previous_frame_;

std::map<timebase::flicks, int> timeline_logical_frame_pts_;
media::FrameTimeMap full_timeline_frames_;
media::FrameTimeMap::iterator in_frame_, out_frame_, first_frame_, last_frame_;

Expand Down
Loading

0 comments on commit 18466e2

Please sign in to comment.