Commit Graph
55 Commits
Author SHA1 Message Date
Alex T 85e68ce06b Bug 1634192 - Implement Seek and SetPosition for MPRIS r=media-playback-reviewers,stransky,alwu,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D212939
2024-08-09 16:39:25 +00:00
Chun-Min Chang 363a0d7e2b Bug 1886057 - Replace ToMediaControlKeyStr by GetEnumString r=media-playback-reviewers,padenot
The `ToMediaControlKeyStr` can be replaced by `GetEnumString` since
`GetEnumString` is able to access the enum mapping strings of the
`MediaControlKey` generated by the dom binding in
`EnumStrings<MediaControlKey>::Values`

Differential Revision: https://phabricator.services.mozilla.com/D205006
2024-03-21 18:19:12 +00:00
Cristian Tuns dbeb8af991 Backed out 6 changesets (bug 1886057) for causing build bustages in MFCDMSession.cpp CLOSED TREE
Backed out changeset 4e4e5d843fc3 (bug 1886057)
Backed out changeset eee295a109f8 (bug 1886057)
Backed out changeset deeb4d41a8ed (bug 1886057)
Backed out changeset 93dcd5c56c14 (bug 1886057)
Backed out changeset 3daba4b63121 (bug 1886057)
Backed out changeset ce3a6cf698ec (bug 1886057)
2024-03-20 15:16:54 -04:00
Chun-Min Chang 7b1ad1988f Bug 1886057 - Replace ToMediaControlKeyStr by GetEnumString r=media-playback-reviewers,padenot
The `ToMediaControlKeyStr` can be replaced by `GetEnumString` since
`GetEnumString` is able to access the enum mapping strings of the
`MediaControlKey` generated by the dom binding in
`EnumStrings<MediaControlKey>::Values`

Differential Revision: https://phabricator.services.mozilla.com/D205006
2024-03-20 18:12:02 +00:00
Nerixyz 6d1c15d1c8 Bug 1689538 - Provide timeline information and handle SeekTo on Windows. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D198850
2024-02-23 07:20:20 +00:00
Norisz Fay 962a80abc7 Backed out 4 changesets (bug 1689538) for causing build bustage on TestPositionState.cpp CLOSED TREE
Backed out changeset f81cf9bd7b9f (bug 1689538)
Backed out changeset 0ab5cd414ce9 (bug 1689538)
Backed out changeset 3b2c031481cb (bug 1689538)
Backed out changeset f94f409282ad (bug 1689538)
2024-02-22 02:07:45 +02:00
Nerixyz 29f25898b7 Bug 1689538 - Provide timeline information and handle SeekTo on Windows. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D198850
2024-02-21 21:11:13 +00:00
Masatoshi Kimura 1ffc0764f4 Bug 1852806 - Remove macros for older Windows SDK from widget/windows/. r=handyman
Depends on D188031

Differential Revision: https://phabricator.services.mozilla.com/D188032
2023-09-15 03:19:28 +00:00
Cosmin Sabou eab17df623 Backed out 15 changesets (bug 1852806) for causing mda failures on test_video_low_power_telemetry.html. CLOSED TREE
Backed out changeset faea1f4cb9a9 (bug 1852806)
Backed out changeset 4db93c374f9b (bug 1852806)
Backed out changeset 7e40e0e04921 (bug 1852806)
Backed out changeset b0a66c4269ce (bug 1852806)
Backed out changeset 4ff3545936f9 (bug 1852806)
Backed out changeset 02c0a8eb3fd6 (bug 1852806)
Backed out changeset ae2c7b33acfb (bug 1852806)
Backed out changeset 2b89ba254a1a (bug 1852806)
Backed out changeset dfa4f73fc548 (bug 1852806)
Backed out changeset daffcc4c1877 (bug 1852806)
Backed out changeset 33855bcdf15e (bug 1852806)
Backed out changeset 694f29707f3e (bug 1852806)
Backed out changeset 1891eda22a59 (bug 1852806)
Backed out changeset 1b854941389c (bug 1852806)
Backed out changeset 2f7cfe04be59 (bug 1852806)
2023-09-15 09:48:27 +03:00
Masatoshi Kimura 22c1cfabaa Bug 1852806 - Remove macros for older Windows SDK from widget/windows/. r=handyman
Depends on D188031

Differential Revision: https://phabricator.services.mozilla.com/D188032
2023-09-15 03:19:28 +00:00
Masatoshi Kimura a3e419385e Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-26 08:52:54 +00:00
Natalia Csoregi 42e803a2dd Backed out 19 changesets (bug 1844908) for causing win bustage on AvailableMemoryTracker.cpp. CLOSED TREE
Backed out changeset 44c66f2233cf (bug 1844908)
Backed out changeset a8010ff534bf (bug 1844908)
Backed out changeset 225dc3aeb220 (bug 1844908)
Backed out changeset a1414db64e33 (bug 1844908)
Backed out changeset 7f1e0a527839 (bug 1844908)
Backed out changeset 6dc7646d1ffa (bug 1844908)
Backed out changeset 8d715131510f (bug 1844908)
Backed out changeset 4b6fe8a4e7db (bug 1844908)
Backed out changeset 2b419fabf1e8 (bug 1844908)
Backed out changeset af84e701d616 (bug 1844908)
Backed out changeset 2fa203969ec5 (bug 1844908)
Backed out changeset 2b3d2df94db3 (bug 1844908)
Backed out changeset 7eca452f5fd7 (bug 1844908)
Backed out changeset 3d961cf25afe (bug 1844908)
Backed out changeset 3c59143f8dd7 (bug 1844908)
Backed out changeset ab50c6c5425a (bug 1844908)
Backed out changeset b2c5636df673 (bug 1844908)
Backed out changeset e9a0f1c6760c (bug 1844908)
Backed out changeset 945ccbedde0b (bug 1844908)
2023-07-25 19:55:35 +03:00
Masatoshi Kimura 4182954d50 Bug 1844908 - Remove pre-Win10-specific codepath from widget/. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D184307
2023-07-25 14:41:05 +00:00
Paul Adenot 757b5a6d55 Bug 1767412 - Don't set the AlbumArtist property on IMusicDisplayProperties. r=chunmin
The Album Artist field when talking about musical metadata is the
artist under which a particular release is classified under. Artist is
the people that are on a specific track, including thing like featurings, etc.

Here we only want to set Artist (the most generic item). Album Artist
overrides artist, and has nothing to do with the album name.

Windows doesn't have an API or a location in the UI to display the album
name.

Differential Revision: https://phabricator.services.mozilla.com/D145339
2022-05-06 13:36:20 +00:00
Mike Hommey 45b9f403ab Bug 1766561 - Use %lu for Windows Error types (DWORD). r=rkraesig,xpcom-reviewers,application-update-reviewers,mhowell,bobowen,necko-reviewers,keeler,media-playback-reviewers,bytesized,barret,alwu,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D144914
2022-05-03 20:49:07 +00:00
alwu 07ceaae7f6 Bug 1715415 - part1 : enable the stop button on Windows. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D117955
2021-07-08 21:28:47 +00:00
alwu 0087ab4a1a Bug 1663128 - part4 : enable SMTC after finishing other initializations. r=chunmin
In order to only call `EnableControl()` twice, once in in `Open()` and another one in `Close()`, so reduce other necessary call of `EnableControl()`.

Differential Revision: https://phabricator.services.mozilla.com/D92118
2020-10-07 09:23:05 +00:00
alwu 5ec42a5b96 Bug 1663128 - part3 : the event source should do the cleanup when it closes. r=chunmin
When close the event source, it should be responsible to clear up and reset the virtual control interface, rather than doing so by `Media Control Server` via setting some empty results.

Differential Revision: https://phabricator.services.mozilla.com/D92116
2020-10-07 09:23:08 +00:00
Razvan Maries 7db3cfd294 Backed out 4 changesets (bug 1663128) for perma failures on browser_control_page_with_audible_and_inaudible_media.js. CLOSED TREE
Backed out changeset c9bd215fdafa (bug 1663128)
Backed out changeset 0ea9bcad0ff8 (bug 1663128)
Backed out changeset 6791eacd4868 (bug 1663128)
Backed out changeset 1f6e8e343055 (bug 1663128)
2020-10-07 12:14:56 +03:00
alwu be1526d18e Bug 1663128 - part4 : enable SMTC after finishing other initializations. r=chunmin
In order to only call `EnableControl()` twice, once in in `Open()` and another one in `Close()`, so reduce other necessary call of `EnableControl()`.

Differential Revision: https://phabricator.services.mozilla.com/D92118
2020-10-06 18:15:06 +00:00
alwu ddfa3704d6 Bug 1663128 - part3 : the event source should do the cleanup when it closes. r=chunmin
When close the event source, it should be responsible to clear up and reset the virtual control interface, rather than doing so by `Media Control Server` via setting some empty results.

Differential Revision: https://phabricator.services.mozilla.com/D92116
2020-10-06 21:43:25 +00:00
Simon Giesecke ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Chun-Min Chang f38a7edcbb Bug 1665225 - Remove unnecessary to-main-thread dispatch r=alwu
The SMTC-thumbnail-update task is dispatched to main-thread from the
on-complete callback of the async image storing operation. However, the
callback is actually on the main-thread itself so the
thumbnail-update-task can be executed in that callback directly instead
of being dispatched. The task should be finished slightly faster if the
task dispatch is replaced by executing the task.

Differential Revision: https://phabricator.services.mozilla.com/D90331
2020-09-16 16:06:09 +00:00
Chun-Min Chang 65a8a047a2 Bug 1635209 - Implement SetSupportedMediaKeys on Windows r=alwu
Enable the media keys on the SMTC UI panel only when their key-press
handlers are set

Differential Revision: https://phabricator.services.mozilla.com/D86226
2020-08-18 18:28:19 +00:00
Chun-Min Chang ef80b2c15c Bug 1642729 - P3: Only fetch image from http(s) URL r=ckerschb
The URL specifying the track image is only valid if its scheme is http
or https.

Differential Revision: https://phabricator.services.mozilla.com/D83694
2020-07-29 15:59:46 +00:00
Chun-Min Chang 5602b68637 Bug 1642729 - P2: Move same utils in SMTC and MPRIS backend to MediaControlUtils.h r=alwu
The duplicated util helpers between WindowsSMTCProvider and
MPRISServiceHandler could be merged and moved to MediaControlUtils

Differential Revision: https://phabricator.services.mozilla.com/D82806
2020-07-29 15:59:44 +00:00
alwu 0ae2e315c1 Bug 1621403 - part2 : implement seekto action. r=chunmin,emilio
Implement `Seekto` action [1]. In addtion, as `seekto` can go with additional properties, we create a new structure `MediaControlAction` to wrap `MediaControlKey` and `SeekDetails`, which can be sent with `seekto`.

[1] https://w3c.github.io/mediasession/#dom-mediasessionaction-seekto

Differential Revision: https://phabricator.services.mozilla.com/D82816
2020-07-16 00:16:33 +00:00
Chun-Min Chang 252d9cd07b Bug 1649970 - Correct the index for fetching next available image r=alwu
Suppose the current artwork is <img A, img B, img C> and Firefox is
currently fetching img B, whose index is 1 in the artwork. If the
artwork is updated to <img D, img B> before img B is fetched, then
Firefox will skip fetching a new image since img B is also an acceptable
choice in the new artwork. However, if Firefox fails to fetch img B, in
the current implementation, a new image at (previous index + 1) would be
fetched, as a fallback plan. In the above case, the index is 2, which is
out of the bound of the new artwork.

Instead of caching the previous index of an image in the artwork and
using the the previous index plus 1 as the index of the next available
image, the index of the next available image should be reset every time
when artwork is updated

Differential Revision: https://phabricator.services.mozilla.com/D81960
2020-07-06 17:53:28 +00:00
Simon Giesecke a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Chun-Min Chang 95cb7b6df0 Bug 1647434 - P3: Set mThumbnailUrl in {Clear, Set}Thumbnail r=alwu
`mThumbnailUrl` is always reset after `ClearThubnamil` or `SetThumbnail`
is called. Setting `mThumbnailUrl` in these functions makes sure it
always has the correct value.

Differential Revision: https://phabricator.services.mozilla.com/D81572
2020-06-29 22:55:15 +00:00
Chun-Min Chang a343cd912b Bug 1647434 - P2: Remove RefreshDisplay() r=alwu
`RefreshDisplay` always comes after `SetMusicMetadata`, `SetThumbnail`,
or `ClearThumbnail`. Merging the `RefreshDisplay` into these functions
makes sure the the code in `RefreshDisplay` and those functions will be
executed together.

Differential Revision: https://phabricator.services.mozilla.com/D81571
2020-06-29 22:55:13 +00:00
Chun-Min Chang 6116590bae Bug 1647434 - P1: Rework image cache mechanism for SMTC r=alwu
The current image cache mechanism fails in the following example:

Suppose the artwork for track 1, 2 are <img A, img B> and <img C, img A>
respectively. If the initial metadata in a media session is for track 1
and the current active image is img A, when switching the metadata of
the media session from track 1 to 2, the image will be reset to img C in
the current implementation. However, there is no need to update the
active image since img A is also an acceptable choice for track 2.

This patch reduce the image reset for above case. The image will only be
updated if the request one is different from the one in use.

Differential Revision: https://phabricator.services.mozilla.com/D80524
2020-06-29 22:55:17 +00:00
Chun-Min Chang d39a507fe4 Bug 1623971 - P18: Fetch next available image if fetching fails r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D79222
2020-06-19 00:21:23 +00:00
Chun-Min Chang 7faadaf13c Bug 1623971 - P17: Set media-session's MediaImage to the SMTC interface r=alwu,thomasmo
This patch does the following things:
1. Use `FetchImageHelper` to fetch the MediaImage defined in
   media-session
2. Upon the above image is fetched, set it to the SMTC's thumbnail

Differential Revision: https://phabricator.services.mozilla.com/D77893
2020-06-19 00:21:21 +00:00
Chun-Min Chang bd0f986338 Bug 1623971 - P16: Add a method to set image to SMTC thumbnail r=alwu,thomasmo
Add a method to set an image to SMTC's thumbmail asynchronously

Differential Revision: https://phabricator.services.mozilla.com/D77892
2020-06-19 00:21:13 +00:00
Chun-Min Chang b3664fac85 Bug 1623971 - P15: Move Maybe.h from .h to .cpp r=alwu
`Maybe` is used in the .cpp file only.

Differential Revision: https://phabricator.services.mozilla.com/D77891
2020-06-19 00:21:09 +00:00
Chun-Min Chang d90486cd49 Bug 1623971 - P12: Reorganize member functions r=alwu
- Group related functions together
- Sync the function order in .cpp and .h (except destructor)
- Rename `Update` to `RefreshDisplay`

Differential Revision: https://phabricator.services.mozilla.com/D77888
2020-06-19 00:20:52 +00:00
Chun-Min Chang 419385a292 Bug 1623971 - P10: Assert mDisplay instead of mInitialized r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D77886
2020-06-19 00:20:40 +00:00
Chun-Min Chang 11358b55fb Bug 1623971 - P9: Assert mControls instead of mInitialized r=alwu
By assert mConrols instread of mInitialized in SetControlAttributes, we
no longer need to call SetControlAttributes after setting mInitialized
to true. Also, this patch change the timing to set mInitialized to true
so we can call SetControlAttributes before RegisterEvent. By doing so,
we no longer need to call UnregisterEvents when SetControlAttributes
fails.

Differential Revision: https://phabricator.services.mozilla.com/D77885
2020-06-19 00:20:33 +00:00
Chun-Min Chang 96bf0f7a9c Bug 1623971 - P8: Rework SMTP opening r=alwu
- Add error messages so it's easier to debug when the error occurs
- It's better to unregister the event listener if failed to open SMTP.
  (In release, the key-event listener may be alive when the SMTP isn't
  initialized successfully)

Differential Revision: https://phabricator.services.mozilla.com/D77884
2020-06-19 00:20:30 +00:00
Chun-Min Chang ac54a21176 Bug 1623971 - P6: No need to update metadata upon opening SMTC r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D77882
2020-06-19 00:20:15 +00:00
Chun-Min Chang 982fce8d70 Bug 1623971 - P5: The arguments to SetMusicMetadata must be non-null r=alwu
`HStringRefernece` must be constructed with a non-null `wchar_t*`. The
raw pointer returned from `nsString::get()` is a non-null address so
it's ok to add an assertion in `SetMusicMetadata`.

Differential Revision: https://phabricator.services.mozilla.com/D77881
2020-06-19 00:20:13 +00:00
Chun-Min Chang 1f364c679b Bug 1623971 - P4: No need to set default metadata when initializing r=alwu
Metadata would be reset every time when `SetMetadata` is called.

Differential Revision: https://phabricator.services.mozilla.com/D77880
2020-06-19 00:20:05 +00:00
Chun-Min Chang 31ea1573a7 Bug 1623971 - P3: Return false when SetMusicMetadata fails r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D77879
2020-06-19 00:20:03 +00:00
Chun-Min Chang 0607176393 Bug 1623971 - P2: Delete comments r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D77878
2020-06-19 00:19:55 +00:00
Chun-Min Chang ba913effd2 Bug 1623971 - P1: Replace Maybe<const wchar_t*> by const wchar_t* r=alwu
- The maybe value could be `nullptr` even it's `Some`
- `Nothing` can be replaced by `nullptr`.

Differential Revision: https://phabricator.services.mozilla.com/D77877
2020-06-19 00:19:48 +00:00
alwu 5d3e5d3f60 Bug 1640998 - part9 : use MediaControlKey to replace MediaControlKeysEvent r=chunmin,agi,geckoview-reviewers
This patch will
- remove `MediaControlKeysEvent` and use `MediaControlKey` to replace it
- rename names for all `MediaControlKey` related methods, functions, classes and descriptions

The advantage of doing so are
- remove the duplicated type so that we only need to maintain `MediaControlKey`

Differential Revision: https://phabricator.services.mozilla.com/D78140
2020-06-09 02:59:57 +00:00
Marc Streckfuss 49d2865508 Bug 1620340 - part4: Implement SetMediaMetadata() for the WindowsSMTCProvider, r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D66587
2020-03-17 01:23:43 +00:00
alwu b01e87fe28 Bug 1582508 - part5 : replace 'PlaybackState' with 'MediaSessionPlaybackState'. r=chunmin
`PlaybackState` and `MediaSessionPlaybackState` are actually quite similar, and we don't want to have to many states to confuse reader and do unnecessary tranform between two states. Therefore, replaceing  `PlaybackState` with `MediaSessionPlaybackState`.

Differential Revision: https://phabricator.services.mozilla.com/D66342
2020-03-17 00:03:55 +00:00
Marc Streckfuss 2430621ca7 Bug 1617405 - MediaControl Windows: Fix propagating the Playback State to the UI by separating asserts from method calls, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D63773
2020-02-22 20:59:21 +00:00