Skip to content

Commit

Permalink
Resolve review comments for xml clips
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatherly committed Dec 18, 2024
1 parent dafa22c commit 6795dfc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
30 changes: 7 additions & 23 deletions src/modules/xml/producer_xml-clip.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* producer_xml-native.c -- A wrapper for mlt XML in native profile
* producer_xml-clip.c -- A wrapper for mlt XML in native profile
* Copyright (C) 2024 Meltytech, LLC
*
* This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -39,9 +39,8 @@ static int producer_get_audio(mlt_frame frame,
return 1;
}
mlt_properties xml_frame_properties = MLT_FRAME_PROPERTIES(xml_frame);
mlt_properties_set(xml_frame_properties,
"consumer.channel_layout",
mlt_properties_get(frame_properties, "consumer.channel_layout"));
mlt_properties_copy(xml_frame_properties, frame_properties, "consumer.");

int error = mlt_frame_get_audio(xml_frame, audio, format, frequency, channels, samples);
if (error) {
mlt_log_error(MLT_PRODUCER_SERVICE(self), "No audio\n");
Expand Down Expand Up @@ -78,22 +77,7 @@ static int producer_get_image(mlt_frame frame,
return 1;
}
mlt_properties xml_frame_properties = MLT_FRAME_PROPERTIES(xml_frame);
mlt_properties_set(xml_frame_properties,
"consumer.rescale",
mlt_properties_get(frame_properties, "consumer.rescale"));
mlt_properties_set_int(xml_frame_properties, "consumer.progressive", profile->progressive);
mlt_properties_set(xml_frame_properties,
"consumer.deinterlacer",
mlt_properties_get(frame_properties, "consumer.rescale"));
mlt_properties_set_int(xml_frame_properties,
"consumer.top_field_first",
mlt_properties_get_int(frame_properties, "consumer.top_field_first"));
mlt_properties_set(xml_frame_properties,
"consumer.color_trc",
mlt_properties_get(frame_properties, "consumer.color_trc"));
mlt_properties_set(xml_frame_properties,
"consumer.color_range",
mlt_properties_get(frame_properties, "consumer.color_range"));
mlt_properties_copy(xml_frame_properties, frame_properties, "consumer.");

// Force the dimension request to match the profile
*width = profile->width;
Expand All @@ -108,9 +92,9 @@ static int producer_get_image(mlt_frame frame,
mlt_properties_set_int(frame_properties, "format", *format);
mlt_properties_set_int(frame_properties, "width", *width);
mlt_properties_set_int(frame_properties, "height", *height);
mlt_properties_pass(frame_properties,
xml_frame_properties,
"colorspace aspect_ratio progressive");
mlt_properties_pass_list(frame_properties,
xml_frame_properties,
"colorspace aspect_ratio progressive");

return error;
}
Expand Down
13 changes: 12 additions & 1 deletion src/modules/xml/producer_xml-clip.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema_version: 0.1
schema_version: 7.0
type: producer
identifier: xml-clip
title: An XML clip producer
Expand All @@ -16,3 +16,14 @@ description: >
and will use a profile generated from the XML.
This producer is only suitible in a project that has an exact match for the
XML profile, or encapsulated in a chain where the frame rate can be adapted.
parameters:
- identifier: resource
argument: yes
title: File
type: string
description: An XML text file containing MLT XML.
readonly: no
required: yes
mutable: no
widget: fileopen

0 comments on commit 6795dfc

Please sign in to comment.