Commit graph

42607 commits

Author SHA1 Message Date
Linus Groh
f01d90aa63 Lagom: Update GCC version check in CMakeLists.txt
This was forgotten in bc2ebcadc0.
2022-10-31 14:08:39 +00:00
Zaggy1024
f99d356a17 VideoPlayer: Start fleshing out the user interface
This adds player widget with working play/pause controls, a seek bar
which currently only displays the current playback position, and a
button to cycle between the scaling modes.

The player uses the new PlaybackManager class to handle demuxing,
decoding, and frame presentation timing.

Currently, the volume control is non-functional.
2022-10-31 14:47:13 +01:00
Zaggy1024
353e1c2b4d LibVideo: Add PlaybackManager to load and decode videos
This file will be the basis for abstracting away the out-of-thread or
later out-of-process decoding from applications displaying videos. For
now, the demuxer is hardcoded to be MatroskaParser, since that is all
we support so far. The demuxer should later be selected based on the
file header.

The playback and decoding are currently all done on one thread using
timers. The design of the code is such that adding threading should
be trivial, at least based on an earlier version of the code. For now,
though, it's better that this runs in one thread, as the multithreaded
approach causes the Video Player to lock up permanently after a few
frames are decoded.
2022-10-31 14:47:13 +01:00
Zaggy1024
0a4def1208 LibVideo: Abstract media container format demuxing
This creates an abstract Demuxer class to allow multiple container
container formats to be easily used by video playback systems.
2022-10-31 14:47:13 +01:00
Zaggy1024
3a2f6c700d LibVideo: Parse the duration of Matroska files 2022-10-31 14:47:13 +01:00
Zaggy1024
2b4b6c5613 LibVideo: Make VP9::Decoder a subclass of a new abstract VideoDecoder
This will allow other decoders to be used in place of VP9::Decoder when
new video decoders are implemented, such as AV1.
2022-10-31 14:47:13 +01:00
Zaggy1024
3720f66bb1 LibVideo: Set CodingIndependentCodePoints in its member functions
This moves the setting of code points in CICP structs to member
functions completely so that the code having to set these code points
can be much cleaner.
2022-10-31 14:47:13 +01:00
Zaggy1024
074f771b59 LibVideo: Add VideoFrame class for decoded video frames
The class is virtual and has one subclass, SubsampledYUVFrame, which
is used by the VP9 decoder to return a single frame. The
output_to_bitmap(Bitmap&) function can be used to set pixels on an
existing bitmap of the correct size to the RGB values that
should be displayed. The to_bitmap() function will allocate a new bitmap
and fill it using output_to_bitmap.

This new class also implements bilinear scaling of the subsampled U and
V planes so that subsampled videos' colors will appear smoother.
2022-10-31 14:47:13 +01:00
Beckett Normington
30189186e9 Utilities: Add nologin application
This adds the `nologin` application to the system. This application
will look for `/etc/nologin`. If it is present, it will display the
message in the file. Otherwise, it will display an error about the
current account being unavailable.
2022-10-31 10:54:00 +00:00
premek
429bd32016 Base: Add Scissors & arrows emoji
✂️ - U+2702 Scissors
➡️ - U+27A1 Right Arrow
⤴️ - U+2934 Right Arrow Curving Up
⤵️ - U+2935 Right Arrow Curving Down
⬅️ - U+2B05 Left Arrow
⬆️ - U+2B06 Up Arrow
⬇️ - U+2B07 Down Arrow
2022-10-31 10:39:42 +00:00
Zaggy1024
91fbfe1773 LibVideo: Make DecoderError getters const 2022-10-31 00:02:52 +01:00
implicitfield
cea7386ea8 Base: Set PATH in text mode 2022-10-31 00:02:34 +01:00
Zaggy1024
81b0b232e1 LibThreading: Set BackgroundAction's thread name correctly
Previously, init() in BackgroundAction.cpp was calling
Core::Object::set_name, which does not affect the displayed thread name
which is displayed by the system monitor. This changes it to pass the
name to the thread constructor.
2022-10-31 00:02:13 +01:00
Oleg Kosenkov
0c27d95e76 Userland: Use Threading::MutexLocker to lock/unlock mutexes 2022-10-31 00:00:52 +01:00
Gunnar Beutner
466000e05f Meta: Make YCM work when the current dir is not the root of the tree
Previously we'd incorrectly use a relative path for the compilation
database.
2022-10-30 23:57:25 +01:00
Gunnar Beutner
084fad2aca Meta: Remove debug code in the YCM config file 2022-10-30 23:57:25 +01:00
Zaggy1024
e20756f9f7 LibGUI: Update buttons' text/tooltips in Action::set_text
This allows Actions that change based on some state to update their
associated buttons' text and tooltips to match their new text. The
play/pause button in SoundPlayer (and VideoPlayer if it's merged)
will now change tooltips when the playback changes state, rather than
always displaying "Play (Space)".
2022-10-30 23:54:12 +01:00
Linus Groh
1de1d6423b LibWeb: Implement the fetch() method :^)
With so much infrastructure implemented, we can finally add the last
piece of this puzzle - the fetch() method itself!

This contains a few hundred lines of generated code as handling the
RequestInfo and RequestInfo parameter types manually is not feasible,
but we can't use the IDL definition as the Window object is handwritten
code at the moment.
It's neatly tucked away in Bindings/ and will be removed eventually.
2022-10-30 20:10:29 +00:00
Linus Groh
c8d121fa32 LibWeb: Implement most of the 'Fetching' AOs
This implements the following operations from section 4 of the Fetch
spec (https://fetch.spec.whatwg.org/#fetching):

- Fetch
- Main fetch
- Fetch response handover
- Scheme fetch
- HTTP fetch
- HTTP-redirect fetch
- HTTP-network-or-cache fetch (without caching)

It does *not* implement:

- HTTP-network fetch
- CORS-preflight fetch

Instead, we let ResourceLoader handle the actual networking for now,
which isn't ideal, but certainly enough to get enough functionality up
and running for most websites to not complain.
2022-10-30 20:10:29 +00:00
Linus Groh
4db85493e8 AK+Meta: Add WEB_FETCH_DEBUG macro 2022-10-30 20:10:29 +00:00
Linus Groh
32e0f0aec8 LibWeb: Require error message for Response::network_error()
There will be a lot of different cases where we'll return an error
response, and having a customized Promise rejection message seems quite
useful.

Note that this has to be distinct from the existing 'status message',
which is required to be empty in those cases.
2022-10-30 20:10:29 +00:00
Linus Groh
d8ebdef010 LibWeb: Partially implement 'relative high resolution time' AOs 2022-10-30 20:10:29 +00:00
Linus Groh
caa13bf41d LibWeb: Fix URL parsing in Response::location_url()
We need to use URLParser in order to provide a base URL. This makes it
work for the common case of `Location: /some/path`.
2022-10-30 20:10:29 +00:00
Linus Groh
fd042dce55 LibWeb: Actually extract Location header in Response::location_url() 2022-10-30 20:10:29 +00:00
Linus Groh
455aa34011 LibWeb: Partially implement 'Extract header (list) values' AOs
The header-specific ABNF rules are completely ignored for now, but we
can at least extract a single header value, which at least works for
simple cases like `Location`-based redirects.
2022-10-30 20:10:29 +00:00
Linus Groh
14e722617c LibWeb: Implement 'Queue a fetch task' AO 2022-10-30 20:10:29 +00:00
Linus Groh
6deb5ce9b5 LibWeb: Implement 'Default User-Agent value' AO 2022-10-30 20:10:29 +00:00
Linus Groh
5ee9feb9cf LibWeb: Implement 'Append a request Origin header' AO 2022-10-30 20:10:29 +00:00
Linus Groh
c93e6ea0d9 LibWeb: Implement 'Appropriate network error' AO 2022-10-30 20:10:29 +00:00
Linus Groh
361ab205fa LibWeb: Implement 'CORS check' / 'TAO check' AOs 2022-10-30 20:10:29 +00:00
Linus Groh
8db64a8704 LibWeb: Implement 'Is non-secure context' AO 2022-10-30 20:10:29 +00:00
Linus Groh
4baf0a4486 LibWeb: Implement 'Is secure context' AO 2022-10-30 20:10:29 +00:00
Linus Groh
5d86eae119 LibWeb: Implement 'fetch params' struct 2022-10-30 20:10:29 +00:00
Linus Groh
ba31547fa0 LibWeb: Implement container class for fetch algorithms 2022-10-30 20:10:29 +00:00
Linus Groh
dd5d3e2f4f LibWeb: Implement 'fetch controller' struct 2022-10-30 20:10:29 +00:00
Linus Groh
fef331a03f LibWeb: Implement 'fetch timing info' struct 2022-10-30 20:10:29 +00:00
Linus Groh
1f8ed8fca7 LibWeb: Implement 'connection timing info' struct 2022-10-30 20:10:29 +00:00
Linus Groh
cc6eaafe6b LibWeb: Implement 'Byte sequence as body' AO 2022-10-30 20:10:29 +00:00
Linus Groh
dcded8d39f LibWeb: Implement 'Safely extract BodyInit' AO 2022-10-30 20:10:29 +00:00
Linus Groh
1e1fbb93fb LibWeb: Implement 'Determine request’s Referrer' AO 2022-10-30 20:10:29 +00:00
Linus Groh
1e5cac9e9c LibWeb: Implement 'Strip url for use as a referrer' AO 2022-10-30 20:10:29 +00:00
Linus Groh
6c1a9b28f1 LibWeb: Implement 'Is url potentially trustworthy?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
d56a6eb508 LibWeb: Implement 'Is origin potentially trustworthy?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
58ad6de954 LibWeb: Implement 'Should response be blocked due to nosniff?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
7e46150a71 LibWeb: Implement 'Should response be blocked due to its MIME type?' AO 2022-10-30 20:10:29 +00:00
Linus Groh
62228f0870 LibWeb: Implement 'Should request be blocked due to a bad port' AO 2022-10-30 20:10:29 +00:00
Linus Groh
7fd4c7b0c6 LibWeb: Implement 'host is domain' concept from the URL spec 2022-10-30 20:10:29 +00:00
Linus Groh
55315d72f7 LibWeb: Explain the use-URL-credentials flag
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/a388348
2022-10-30 14:51:58 +00:00
Linus Groh
d2deb8fa6d LibWeb: Add has-cross-origin-redirects flag to Fetch::Infra::Response
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/7c30987
2022-10-30 14:51:58 +00:00
Linus Groh
793a1f5994 LibWeb: Actually define Blob-to-ReadableStream conversion
This is a change in the Fetch spec.

See: https://github.com/whatwg/fetch/commit/4cd70cf
2022-10-30 14:48:32 +00:00