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

8287822: [macos] Remove support of duplicated formats from macOS #909

Closed
wants to merge 4 commits into from

Conversation

sashamatveev
Copy link
Member

@sashamatveev sashamatveev commented Oct 11, 2022

  • Added support for JAR and JRT protocol to AVFoundation platform.
  • Removed H.264/MP3 and AAC support from GStreamer platform, which was primary used to playback these formats for JAR and JRT protocols.
  • Added ability to FXMediaPlayer sample to generate playlist for JAR and JRT protocols for testing. See FXMedia.java for how to use it.
  • H.265/HEVC via JAR/JRT protocols should work on macOS after this change. Before it did not work because GStreamer platform did not support H.265/HEVC and AVFoundation did not support JAR/JRT protocols.
  • Minor code clean up.

After this changes:
GSTPlatform: AIFF and WAV for all protocols.
AVFoundation: MP3, AAC, HLS, H.264 and H.265 for all protocols.

This change is transparent for end user and does not affect list of supported formats by JavaFX Media.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8287822: [macos] Remove support of duplicated formats from macOS

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/909/head:pull/909
$ git checkout pull/909

Update a local copy of the PR:
$ git checkout pull/909
$ git pull https://git.openjdk.org/jfx pull/909/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 909

View PR using the GUI difftool:
$ git pr show -t 909

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/909.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 11, 2022

👋 Welcome back almatvee! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Ready for review label Oct 11, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 11, 2022

Webrevs

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Oct 11, 2022

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

isJRT = false;
uri = FXMedia.class.getResource("/fxmediaplayer/media").toURI();

if (uri.getScheme().equals("jar")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible for uri scheme to be null?
may be "jar".equals(uri.getScheme()) ?

Copy link
Member

Choose a reason for hiding this comment

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

Related question: Can uri itself be null?

Copy link
Contributor

Choose a reason for hiding this comment

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

so the logic seems to be either a "jar", or else it's a file, right?
is it possible to be something else (i.e. the resource is missing altogether)? or some other condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, when we run jar file it will be jar and if we run unpacked it will be file. If resource is missing we will not enumerate files and it is acceptable condition. We should fallback to default playlist if no files present.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

I left a few comments. I'll want to do some quick testing, but don't have time today.

I presume you have carefully tested this on macOS. Have you done some minimal testing on Windows and Linux, too (since there are platform-independent changes)?

isJRT = false;
uri = FXMedia.class.getResource("/fxmediaplayer/media").toURI();

if (uri.getScheme().equals("jar")) {
Copy link
Member

Choose a reason for hiding this comment

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

Related question: Can uri itself be null?

@sashamatveev
Copy link
Member Author

I did full testing on all three platforms and tested all formats via all protocols. Mostly to make sure that changes for FXMediaPlayer works on all platforms.

isJRT = false;
uri = FXMedia.class.getResource("/fxmediaplayer/media").toURI();

if (uri.getScheme().equals("jar")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

so the logic seems to be either a "jar", or else it's a file, right?
is it possible to be something else (i.e. the resource is missing altogether)? or some other condition?

Collections.<String, Object>emptyMap());
path = fileSystem.getPath("fxmediaplayer", "media");
} else {
path = Path.of(uri);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we explicitly check if it is a file?
if("file".equals(uri.getScheme()) { ...

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not see a point of doing it, since it should be a file.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

Finally getting back to this. The current version looks good to me.

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

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

all my comments got explained and/or resolved. thank you!

@openjdk
Copy link

openjdk bot commented Nov 30, 2022

@sashamatveev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8287822: [macos] Remove support of duplicated formats from macOS

Reviewed-by: angorya, kcr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 35 new commits pushed to the master branch:

  • 0a785ae: 8295754: PaginationSkin: memory leak when changing skin
  • 2fa9f4b: 8297414: Remove easy warnings in javafx.controls
  • 7cb408b: 8297412: Remove easy warnings in javafx.fxml, javafx.media, javafx.swing, javafx.swt and javafx.web
  • fbad15d: 8295796: ScrollPaneSkin: memory leak when changing skin
  • 4ad8582: 8265828: [TestBug] Save and restore the default Locale in javafx.base unit test LocalDateTimeStringConverterTest
  • d040c1f: 8297680: JavaDoc example for PseudoClass has minor typo
  • 3376228: 8294809: ListenerHelper for managing and disconnecting listeners
  • 67088be: 8256397: MultipleSelectionModel throws IndexOutOfBoundException
  • 4a697f1: 8297130: ComboBox popup doesn't close after selecting value that was added with 'runLater'
  • cce8580: 8254676: Alert disables Tab selection when TabDragPolicy REORDER is used
  • ... and 25 more: https://git.openjdk.org/jfx/compare/9768b5e42391e2d48aefffa3a3f6b1de6c30ef9d...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Nov 30, 2022
@sashamatveev
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 3, 2022

Going to push as commit fe81a27.
Since your change was applied there have been 39 commits pushed to the master branch:

  • 9416874: 8297362: EOS might not be delivered by progressbuffer in some cases
  • e64e129: 8295500: AccordionSkin: memory leak when changing skin
  • 6ab65a9: 8295506: ButtonBarSkin: memory leak when changing skin
  • 4a19fe7: 8295426: MenuButtonSkin: memory leak when changing skin
  • 0a785ae: 8295754: PaginationSkin: memory leak when changing skin
  • 2fa9f4b: 8297414: Remove easy warnings in javafx.controls
  • 7cb408b: 8297412: Remove easy warnings in javafx.fxml, javafx.media, javafx.swing, javafx.swt and javafx.web
  • fbad15d: 8295796: ScrollPaneSkin: memory leak when changing skin
  • 4ad8582: 8265828: [TestBug] Save and restore the default Locale in javafx.base unit test LocalDateTimeStringConverterTest
  • d040c1f: 8297680: JavaDoc example for PseudoClass has minor typo
  • ... and 29 more: https://git.openjdk.org/jfx/compare/9768b5e42391e2d48aefffa3a3f6b1de6c30ef9d...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 3, 2022
@openjdk openjdk bot closed this Dec 3, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Dec 3, 2022
@openjdk
Copy link

openjdk bot commented Dec 3, 2022

@sashamatveev Pushed as commit fe81a27.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants