Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved EBU-TT-D encoding, including better tests and denester #523

Open
wants to merge 21 commits into
base: release/3.0
Choose a base branch
from

Conversation

nigelmegitt
Copy link
Collaborator

Add detailed conversion tests to improve the EBU-TT Live to EBU-TT-D conversion.

This also adds a Denester node that flattens nested div and span elements, which meets a requirement of EBU-TT-D.

This work represents contributions from a number of BBC engineers - thank you!

@coveralls
Copy link

coveralls commented Nov 14, 2019

Coverage Status

Coverage increased (+0.6%) to 85.776% when pulling 5d0c24b on bbc-python3-staging into 599252f on release/3.0.

This was added accidentally in error, and has no meaningful effect except to cause some downstream problems. No tests seem to be missing that would use this functionality, and all tests pass without it, so we think it is unnecessary.
@@ -192,6 +192,20 @@ def __init__(self, config, local_config):
self._create_input(config)
self._create_output(config)

class Denester(ConsumerMixin, ProducerMixin, NodeBase):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class has to be referenced further down in nodes_by_type, in order to be used e.g. in a config file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I think we have some updates to make to this pull request based on further work, and this is one of them.

)

def __init__(self, config, local_config):
super(RetimingDelay, self).__init__(config, local_config)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Denester instead of RetimingDelay ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! Good spot, thanks for that. Weird python, I wonder what it actually does when we write it like this?!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python then aborts with a type error:

TypeError: super(type, obj): obj must be an instance or subtype of type

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, fair enough. Weird that we never hit that bug.

unnested_divs = DenesterNode.combine_divs(unnested_divs)
unnested_divs = DenesterNode.check_p_regions(unnested_divs)
document.binding.body.div = unnested_divs
return document
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing the Denester, no output documents are generated at all here. As far as I can see, returning the document is not enough but instead self.producer_carriage.emit_data has to be called to forward the processed document.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I see that I have some changes made on the BBC fork that include a fix for that, so I will push an update to this pull request.

@@ -125,6 +125,9 @@ Node type dependent options for [nodeN] : ::

type="distributor" : No options

type="denester"
└─sequence_identifier : sequence identifier, default "Denester1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is not (yet) supported by the Denester.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, to be fixed by pushing more commits here - we have this fixed in the BBC fork. Apologies!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no problem! So I will put my review on hold, until I get news from you regarding this MR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants