Skip to content

Commit

Permalink
add API to add custom compatible brands (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 1, 2023
1 parent 628862c commit 2b0c2ab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions libheif/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class HeifFile

Error get_compressed_image_data(heif_item_id ID, std::vector<uint8_t>* out_data) const;

std::shared_ptr<Box_ftyp> get_ftyp_box() { return m_ftyp_box; }

std::shared_ptr<Box_infe> get_infe_box(heif_item_id imageID)
{
Expand Down
7 changes: 7 additions & 0 deletions libheif/heif.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,13 @@ struct heif_error heif_context_write(struct heif_context* ctx,
}


void heif_context_add_compatible_brand(struct heif_context* ctx,
heif_brand2 compatible_brand)
{
ctx->context->get_heif_file()->get_ftyp_box()->add_compatible_brand(compatible_brand);
}


int heif_context_get_encoder_descriptors(struct heif_context* ctx,
enum heif_compression_format format,
const char* name,
Expand Down
4 changes: 4 additions & 0 deletions libheif/heif.h
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,10 @@ struct heif_error heif_context_write(struct heif_context*,
struct heif_writer* writer,
void* userdata);

// Add a compatible brand that is now added automatically by libheif when encoding images (e.g. some application brands like 'geo1').
LIBHEIF_API
void heif_context_add_compatible_brand(struct heif_context* ctx,
heif_brand2 compatible_brand);

// ----- encoder -----

Expand Down

0 comments on commit 2b0c2ab

Please sign in to comment.