Commit Graph

33 Commits

Author SHA1 Message Date
Arkadiusz Hiler
818cdb7e79 media-converter: Avoid holding state lock. 2023-09-12 14:55:34 +03:00
Arkadiusz Hiler
64465e595f media-converter: Don't hold state lock during pull_range 2023-09-12 14:55:34 +03:00
Sergev ₱
a76c324c30 media-converter: Update bumpalo to avoid use-after-free.
In affected project of this crate, the lifetime of the iterator produced
by Vec::into_iter() is not constrained to the lifetime of the Bump that
allocated the vector's memory. Using the iterator after the Bump is
dropped causes use-after-free accesses.

Link: https://github.com/ValveSoftware/Proton/pull/6792
2023-09-12 14:55:34 +03:00
Arkadiusz Hiler
8e67412fcc media-converter: Use the test pattern video even without dump/transcoded files.
So the game won't trip over lack of media when shader pre-cacheing is
disabled in Steam.

CW-Bug-Id: #21524
2023-02-14 16:07:43 +02:00
Shaun Ren
e2493e2dfd media-converter: Set stream ID as the video hash.
If a stream ID is not set, gstreamer will generate random stream IDs for
the streams in downstream elements. This can cause decodebin to generate
its source pads in a non-deterministic order, as decodebin takes into
account the stream IDs when sorting the source pads.

This patch includes some changes from Arek Hiler.

CW-Bug-Id: #21192
2023-02-14 16:07:43 +02:00
Arkadiusz Hiler
6d138f5e96 media-converter: Create a tag file when placeholder media are used.
CW-Bug-Id: #21473
2023-02-14 16:07:43 +02:00
Arkadiusz Hiler
eca48bb93f media-converter: Apply cargo clippy suggestions. 2023-02-14 16:07:43 +02:00
Arkadiusz Hiler
e36a9ba96a media-converter: Update to the newest gst bindings.
1. ElementImpl trait requires GstObjectImpl

2. gst logging macros are no longer globals prefixed with gst_, they
   live inside gst:: instead

3. element is not longer passed around in many places, it can be
   accessed as self.obj() or self.instance()

4. query_default is now a part of gst::Pad and takes the pad as an argument

5. some constructors were changed to use from_$type()

6. query.view_mut() returns QueryViewMut

7. ElementFactory::make now returns a builder that we have to .build()

There are some extra cleanups as well:

1. spurious 'mut' and '&' are removed, a lot of that can be infered or
   were turned into a dereference by the compiler anyway

2. !bla.is_ok() are now bla.is_err()

3. some unneeded imports were removed
2023-02-14 16:07:43 +02:00
Arkadiusz Hiler
66e57462c1 media-converter: Use crates.io version of the gstreamer crates. 2022-10-14 18:21:56 +03:00
Arkadiusz Hiler
d957ff7c35 Use GitHub mirrors for gstreamer rust repos.
Those are the original repos that were later moved to freedesktop.org.
The author recently started updating them as mirrors.

Freedesktop.org goes down much more often than GitHub and we fetch
everything else from GitHub anyway.

It's better to depend on fewer hosting services to have fewer
interruptions.
2022-08-03 13:40:46 +03:00
Andrew Eikum
7195a2c542 media-converter: Fix read-only DB detection 2022-04-05 18:13:11 +03:00
Derek Lesho
aafc2191a2 mediaconvert: Classify protonvideoconv as Codec/Demuxer.
When classified as Codec/Demuxer, it is prioritised alongside actual demuxers.

Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
2022-01-24 22:53:20 +02:00
Rémi Bernon
2ad85256a3 media-converter: Add format=S16LE to audioconv caps.
As opusdec will only output that format, and we want to be able to
filter the elements from their capabilities early.

CW-Bug-Id: #19854
2022-01-24 16:03:39 +02:00
Rémi Bernon
f0a10371c9 media-converter: Classify proton audioconv as Codec/Decoder/Audio.
Required to match it when enumerating audio decoders.

CW-Bug-Id: #19854
2022-01-24 16:03:39 +02:00
Andrew Eikum
18f4555528 Update copyright dates 2022-01-19 11:39:44 +02:00
Andrew Eikum
bf8ee8e554 media-converter: Add MEDIACONV_DONT_DISCARD 2022-01-19 11:29:55 +02:00
Andrew Eikum
725dd255fc media-converter: Update dependencies 2022-01-19 11:29:54 +02:00
Andrew Eikum
f002efd808 media-converter: Fall back to OGV if no MKV is available
CW-Bug-Id: #19516
2022-01-19 11:29:54 +02:00
Andrew Eikum
f1893068c3 media-converter: Don't panic on unknown tags for read-only DBs
CW-Bug-Id: #19516
2022-01-19 11:29:54 +02:00
Andrew Eikum
e190c26058 media-converter: Use AV1/Opus instead of Theora/Vorbis
CW-Bug-Id: #19516
2022-01-19 11:29:54 +02:00
Andrew Eikum
48196af449 media-converter: Query upstream duration if needed
CW-Bug-Id: #19516
2022-01-19 11:29:54 +02:00
Andrew Eikum
e3a12c2f18 media-converter: Clean up already-converted entries
CW-Bug-Id: #19614
2022-01-19 11:29:54 +02:00
Andrew Eikum
4aac973ecf media-converter: Add an option to disable dumping audio to disk
CW-Bug-Id: #19009
2021-11-11 18:36:07 +02:00
Andrew Eikum
ac2caa3e54 media-converter: Remove audio data repeat logic 2021-11-11 18:36:07 +02:00
Andrew Eikum
905fc8ef44 media-converter: Don't pad filler audio data
Fixes corrupt streams when dumping audio to disk. Relies on the client
(e.g. FAudio) to fill in blank data when a buffer results in a short
decode.
2021-11-11 18:36:07 +02:00
legendofmiracles
9845a94d1c media-converter: Make Rust more idiomatic 2021-11-11 18:36:07 +02:00
Andrew Eikum
d02b5dc9ce media-converter: Always set write offset past header 2021-11-11 18:36:07 +02:00
Andrew Eikum
d7b47f9d53 media-converter: Pin our dependencies 2021-03-31 14:08:11 -05:00
Andrew Eikum
31161ce979 update gstreamer to 1.18.4 2021-03-31 14:08:10 -05:00
Andrew Eikum
8a6964bb3c media-converter: Also support video/quicktime 2020-11-09 13:43:05 -06:00
Arseniy Kucher
370dc01d07 media-converter: Simplify array copy 2020-10-19 13:52:04 -05:00
Andrew Eikum
40299a69e4 media-converter: Add an audio stream to the blank video file 2020-09-29 14:29:06 -05:00
Andrew Eikum
f21922d970 media-converter: Add media-converter gstreamer plugin 2020-09-29 14:29:05 -05:00