Skip to content

Commit

Permalink
implemented heif_property_add_clock_info()
Browse files Browse the repository at this point in the history
  • Loading branch information
dukesook committed Oct 27, 2023
1 parent bd5de49 commit 1d43250
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion libheif/heif_properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,26 @@ struct heif_error heif_property_add_clock_info(const struct heif_context* contex
const struct heif_property_clock_info* clock_info,
heif_property_id* out_propertyId)
{
return {heif_error_Unsupported_feature, heif_suberror_Unsupported_data_version, "not yet implemented"};
if (!context) {
return {heif_error_Usage_error, heif_suberror_Null_pointer_argument, "NULL passed"};
}

auto taic = std::make_shared<Box_taic>();
taic->set_version(clock_info->version);
taic->set_flags(clock_info->flags);
taic->set_time_uncertainty(clock_info->time_uncertainty);
taic->set_correction_offset(clock_info->correction_offset);
taic->set_clock_drift_rate(clock_info->clock_drift_rate);
taic->set_clock_source(clock_info->clock_source);

bool essential = false;
heif_property_id id = context->context->add_property(itemId, taic, essential);

if (out_propertyId) {
*out_propertyId = id;
}

return heif_error_success;
}

struct heif_error heif_property_get_clock_info(const struct heif_context* context,
Expand Down

0 comments on commit 1d43250

Please sign in to comment.