Jan Schmidt
0962908e62
adaptivedemux2: Add start/stop vfuncs
...
Remove the can_start() vfunc, in favour of vfuncs when the stream starts/stops,
allowing the sub-class to do custom logic before (or preventing) the stream from
starting and stopping.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:23 +00:00
Jan Schmidt
fa0e9e2ec5
hlsdemux2: Remove unused function argument
...
Remove the demux argument from the
gst_hls_demux_stream_update_rendition_playlist() method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:23 +00:00
Jan Schmidt
67bc8d7cc0
adaptivedemux2: Add gst_adaptive_demux_get_loop()
...
Add an accessor function for retrieving the demuxer's scheduler thread loop.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:23 +00:00
Jan Schmidt
2082c8912d
adaptivedemux2: Add gst_adaptive_demux_period_add_stream()
...
Make a function for adding a stream to a period, for better encapsulation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:23 +00:00
Jan Schmidt
82839fb82f
adaptivedemux2: Add new flow return value for BUSY and PREPARE stream state
...
Neither are used yet, they're just placeholders.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:23 +00:00
Edward Hervey
b03e68ea8c
hlsdemux2: support old compilers
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:23 +00:00
Jan Schmidt
1cede1d0cf
hlsdemux2: Place HLS delivery directives in UTF-8 order.
...
Use new GstURI gst_uri_to_string_with_keys() API to produce the playlist URI
with query arguments in UTF-8 order.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
21cb739830
hlsdemux2: Avoid assert in _has_next_fragment()
...
gst_hls_demux_stream_has_next_fragment() can be called with a NULL
current_segment if we're past the end of the current playlist. In that case,
just return FALSE instead of hitting a critical in the playlist code.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
018a6192bd
hlsdemux2: Include skipped segments in MSN calculation
...
When a playlist has skipped segments, increment the MSN to account for them so
the remaining segments end up with the right sequence numbers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
268a25b979
hlsdemux2: Use partial segment for playlist update interval
...
When playing LL-HLS playlists in LL-HLS mode, update the playlist more often (on
the partial segment interval) or else we end up downloading them in bursts and
playing further from the live edge than intended.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
55f6cd9243
hlsdemux2: Do a full playlist reload if delta fails
...
If we do a delta playlist request but then can't merge the result with the
existing playlist, retry with a full playlist request.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
874b665710
hlsdemux2: Fill in skipped segments if possible
...
After reloading a playlist using a delta request, use the previous playlist to
fill in skipped segments if possible.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
703d29549a
hlsdemux2: Add gst_hls_media_playlist_sync_skipped_segments()
...
Add a method that transfers over skipped segments from a reference playlist,
used to repopulate a delta playlist
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
7496d2750e
hlsdemux2: Parse EXT-X-SKIP tag
...
Parse the attributes from the EXT-X-SKIP tag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
8a0190b521
hlsdemux2: Use skip and blocking playlist delivery directives
...
Detect when we can use a blocking request and delta playlist update requests and
add the required delivery directives to the request URI.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
c16366e5f3
hlsdemux2: Add gst_hls_media_playlist_get_next_msn_and_part()
...
Add a function that computes the media sequence number and/or part index that
are immediately after the end of the playlist, for use in blocking playlist
requests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
d41def562c
hlsdemux2: Use stream llhls_enabled flag
...
Use the stream's copy of the llhls_enabled flag when deciding whether to do
preload requests - the value that was cached when the stream started
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
42b0dd8c41
hlsdemux2: Split the stream object out
...
Move the stream object to a separate file to split the demux level behaviour
from the stream behaviour better.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
5baf5f4b1e
hlsdemux2: Add a timestamp to the playlist
...
Store the timestamp for this playlist. If valid it represents the monotonic time
at which the data was retrieved, minus any proxy cache Age field.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
a3770523c0
adaptivedemux2/downloadrequest: add a helper to retrieve the Age header
...
Add a method to look at HTTP response headers and parse and return any Age
header, provided by caching proxy servers if the data was provided from a cache.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
90bedcb2bc
hlsdemux2: Fix missed segment match for partial-only segment
...
Fix a case where the matching code might not select the final partial-only
segment because it has too short a duration (while it's still being created)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
9edb2f6690
hlsdemux2: In live, match buffering to the hold back distance
...
When playing a live stream, make the recommended buffering threshold at most the
hold-back distance from live. If we start 3 seconds from the live edge, there's
no point trying to buffer more - we'll just hit the live edge and have to wait
for more data to be available anyway.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
1e6550f623
hlsdemux2: Resync stream time on partial segment boundaries
...
When resyncing stream times in a playlist, support at any partial segment
position, not just at full segment boundaries.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
bdec75f9dc
hlsdemux2: Calculate / transfer timing info for preloads
...
When fulfilling data requests, transfer timing information so the stream can
calculate data bitrates.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
5192181ef5
adaptivedemux2: Add most recent data time and offset helper
...
Add a field to the DownloadRequest that reports the most recent time at which
data arrived. Update it in the DownloadHelper.
Add a method to retrieve the GST_BUFFER_OFFSET() for the DownloadRequest's data
buffer (if any).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
40938c8853
adaptivedemux2: Handle another case in download_request_take_buffer_range
...
Handle the case where we want to get a range from the available data that
doesn't start at the first available byte (and discard the bytes before that
start offset).
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
cbb9cfe987
hlsdemux2: Cancel preload before fetching something else
...
When submitting a request for fragment or header that doesn't match any preload,
make sure there's not an ongoing preload for that data type, to avoid parallel
downloads using up bandwidth.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
70bfeff35d
hlsdemux2: Fix assertion on shutdown
...
After cancelling a DownloadRequest, the download helper may not do so
immediately, so we can't assert on the in_use flag. Also, since there's no
refcount on the preload hint struct in the download request callback data, make
sure no callbacks will be dispatched when we're going to free the preload hint
struct.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
44107d0c4b
hlsdemux2: Implement the stream submit_request() vfunc
...
Implement the submit_request() vfunc for streams and fulfil requests from the
preload hint data if possible.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
a7e5236a39
hlsdemux2/preloader: Implement basic request handling
...
Implement fulfilment of HTTP requests from the active preload downloads by
finding any preload request that can provide the requested data and feeding
bytes from the internal DownloadRequest to the caller provided target
DownloadRequest.
Doesn't yet calculate timestamps to make the target request have a sensible
apparent bitrate.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
940811d593
adaptivedemux2/downloadrequest: Add new methods
...
Add download_request_take_buffer_range() and
download_request_get_bytes_available() methods.
download_request_take_buffer_range() takes bytes from the front of the request
that satisfy the requested start/end byterange, and puts any remaining bytes
back into the DownloadRequest
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
76565e8979
adaptivdemux2: Improve a comment about unlocking download requests.
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
a14f4f7054
adaptivedemux2: Make download mechanism overrideable
...
Make the mechanism by which DownloadRequests are fulfilled overrideable by the
subclass, in case it has an internal mechanism it can use (such as blocking
preloads in HLS)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
cb27c05ca7
hlsdemux2: Add preloader helper.
...
Add a helper that submits and handles blocking preload requests for future
PART/MAP data from live playlists. Add handling in the hlsdemux stream to submit
preload requests when hitting the end of the available segments in a live
playlist.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
5ca336226e
hlsdemux2: Add preload equality helper
...
Add a helper function that compares two preload hints for equality based on URI
and requested byte range.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
30bc72d6c7
adaptivedemux2: Define RFC8673_LAST_BYTE_POS
...
Define the recommended value from RFC8673 for the last byte of an open-ended
range request intended to invoke chunked blocking downloads of an incrementally
created resource.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
61516eadf6
hlsdemux2: Ignore partial segments when not live
...
Add some checks that LL-HLS support is enabled and that the current playlist is
live before proceeding to play any partial segments.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
401ca3ef44
hlsdemux2: Print playlist age in debug output
...
Store the timestamp when playlists are updated, and add some debug output to the
update_fragment_info that estimates how far from the live edge the fragment
currently is
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
43e042c4b7
hlsdemux2: Implement LL-HLS flag and part-hold-back/hold-back in live.
...
Add a flag to hlsdemux to enable or disable LL-HLS handling.
When LL-HLS is enabled and an LL-HLS playlist is loaded, use the part-hold-back
threshold to choose a starting segment.
For live streams that aren't LL-HLS, use the provided hold-back attribute, or
fall back to landing 3 segments from the end.
Make the gst_hls_media_playlist_seek() method able to choose a partial segment
within 2 target durations of the end of the playlist when requested.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:22 +00:00
Jan Schmidt
9848c1a1a1
m3u8demux2: Fix off-by-one and leak.
...
Fix an off-by-one in gst_hls_media_playlist_sync_to_playlist() that would ignore
the first fragment in the reference playlist. The error was harmless, since we
expect the reference playlist to be older than the playlist we're
synchronising (so the first/oldest segment in the reference playlist will likely
not exist in the new playlist), so this is just for correctness.
Also fix a segment leak in gst_hls_media_playlist_advance_fragment() when
ignoring the partial_only segment.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
676fffd23c
hlsdemux2: Fix segment advance on partial segments.
...
Fix the duration passed to gst_adaptive_demux2_stream_advance_fragment() when
advancing from a partial segment.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
e318bc3df5
hlsdemux2: Improve some debug output
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
3537614c2b
hlsdemux2: Add and use gst_hls_media_playlist_find_position()
...
Add a function for synchronising current position with the contents of a
playlist that is specifically for that and can handle synchronising to a partial
segment.
gst_hls_media_playlist_seek() will be used only when performing external seek
requests, to find the best segment or partial segment at which to resume
playback.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
c25814bac0
hlsdemux2: Add debug in find_segment_in_playlist()
...
In m3u8 segment matching, print the PDT that was matched between playlists.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
857541ae07
hlsdemux2: Fix some m3u8 segment leaks
...
Make sure unref m3u8 segments in some missed paths.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
7b9547a119
hlsdemux2: Allow starting at the partial_only segment
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
1b8af98208
hlsdemux2: Recalculate partial segments in anchor segment
...
When recalculating the partial segment stream times in
gst_hls_media_playlist_recalculate_stream_time(), don't miss the anchor segment
itself.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
e1a6ec22ee
hlsdemux2: Dump init uri details for segments.
...
When dumping an m3u8 playlist to debug, include information about any
initialisation data.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
2c82fdf276
hlsdemux2: Use gst_hls_media_playlist_recalculate_stream_time()
...
Instead of recalculating stream times manually in a playlist, let the playlist
do it, so that it fixes up partial segment stream times too.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
d76aacfb82
hlsdemux2: LL-HLS improvements
...
Fixes for stream_time recalculation and handling in partial segments.
Disallow bitrate switching when in the middle of partial segments - only at a
full segment (or right before the first partial segment of a segment).
It's possible but more difficult to switch bitrates in the middle of a partial
segment group, since they are less likely to have aligned keyframes. In any
case, the seek code can't do that right now.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
b6abe94890
hlsdemux2: Continue implementing LL-HLS support
...
Somewhat working support for proceeding into the partial segments appearing at
the live edge of the playlist.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
92e849070f
hlsdemux2: Mark locations where partial segments need handling
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
cfc62a69f7
hlsdemux2: Start adding partial_segment handling
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
9aa2497062
hlsdemux2: Note STABLE-RENDITION-ID is not handled
...
Add a comment that STABLE-RENDITION-ID is not yet parsed or used.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
e2750d4ae3
hlsdemux2: Calculate stream times for partial segments
...
When calculating stream times for segments, fill in the stream time fields on
any attached partial segments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
43a8d45ac6
hlsdemux2: Add unit test for parsing LL-HLS playlist
...
Test parsing of partial segments (EXT-X-PART, EXT-X-PART-INF) and preload
hints (EXT-X-PRELOAD)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
3c50f54310
hlsdemux2: Implement preload hint parsing
...
Load EXT-X-PRELOAD-HINT into a preload_hints array in the media playlist
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
3ed6a23a4d
hlsdemux2: Implement EXT-X-SERVER-CONTROL parsing
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
07f51396af
hlsdemux2: Add parsing of partial segments
...
Add partial segments to each media segment, and potentially create a trailing
dummy segment if there are partial segments at the end of the playlist
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Jan Schmidt
fac7177354
hlsdemux2: make helper function for parsing times
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Edward Hervey
4e946890b2
adaptivedemux2: Global output position is always positive
...
Change to non-signed GstClockTime for tracking
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3883 >
2023-02-03 16:52:21 +00:00
Seungha Yang
e1a22402d3
tools: Make sure UTF-8 encoded command line arguments on Windows
...
On Windows, arguments passed in main() are system codepage
encoded and might not be valid UTF-8 string.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3828 >
2023-02-03 16:05:19 +00:00
Seungha Yang
090d50e1a0
tests: Add CUDA memory allocator test
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:43 +00:00
Seungha Yang
10ade466ef
nvenc: Use CUDA stream of memory if exists
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:43 +00:00
Seungha Yang
7a8bb85523
cudaupload, cudadownload: Update for shared CUDA stream
...
Use CUDA stream of memory if exists
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:43 +00:00
Seungha Yang
aabcba16db
nvdecoder: Skip synchronization if downstream buffer holds CUDA stream
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
ddc5f1d425
cudaconvertscale: Add support for shared CUDA stream
...
If CUDA stream is shared by upstream/downstream, don't sync at
convert element
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
1cb47d549b
cudaconverter: Don't sync per conversion
...
Caller should take care of synchronization
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
8d14194fdd
nvencoder: Add support for shared CUDA stream
...
Sets CUDA stream on CUDA buffer pool so that CUDA stream object
can be shared
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
d409c35367
cudabufferpool: Add support for CUDA stream use in memory
...
* Use GstCudaPoolAllocator
* Pass configured GstCudaStream object to allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
30d06e03c2
cudamemory: Make GstCudaStream-aware
...
This will be used for CUDA stream sharing.
* Adding GstCudaPoolAllocator object. The pool allocator will
control synchronization of allocated memory objects.
* Modify gst_cuda_allocator_alloc() API so that caller can specify/set
GstCudaStream object for the newly allocated memory.
* GST_CUDA_MEMORY_TRANSFER_NEED_SYNC flag is added in addition to
existing GST_CUDA_MEMORY_TRANSFER_NEED_{UPLOAD,DOWNLOAD}.
The flag indicates that any GPU command queued in the CUDA stream
may not be finished yet, and caller should take care of the
synchronization.
The flag is controlled by GstCudaMemory object if the memory holds
GstCudaStream. (Otherwise, GstCudaMemory will do synchronization
as before this commit). Specifically, GstCudaMemory object will set
the new flag automatically when memory is mapped with
(GST_MAP_CUDA | GST_MAP_WRITE) flags. Caller will need to unset
the flag via GST_MEMORY_FLAG_UNSET() if it's already synchronized
by client code.
* gst_cuda_memory_sync() helper function is added to perform synchronization
* Why not use CUevent object to keep track of synchronization status?
CUDA provides fence-like interface already via CUevent object,
but cuEventRecord/cuEventQuery APIs are not zero-cost operations.
Instead, in this version, the status is tracked by using map and
object flags.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
9eaae61a44
cudamemory: Allow nullptr allocator object
...
The GstCudaAllocator object doesn't hold any device object.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
0a81c8deb3
nvcodec: Port to GstCudaStream
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
a7c54ebc06
cuda: Add GstCudaStream object
...
Wrap CUstream handle with GstCudaStream to make it ref-counted
object. This GstCudaStream object will be used later for
CUDA stream sharing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
661b5f60c6
cuda: Provide single header include entry point
...
Add "gstcuda.h" header file
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629 >
2023-02-03 15:27:42 +00:00
Seungha Yang
c0a4f41525
pluginloader-win32: Prepend gstreamer-1.0-0.dll directory to PATH env for child process
...
Usually gst-plugin-scanner.exe will be located under libexec/gstreamer-1.0
or even somewhere user specified location via GST_PLUGIN_SCANNER
environment. So, in order for child process to be able to load
GStreamer DLLs, parent process will need to update PATH env
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3886 >
2023-02-03 14:25:21 +00:00
Seungha Yang
bc0708eafb
nvencoder: Fix min buffers parameter of allocation query in auto GPU mode
...
At the time when propose_allocation() get called, encoder session
would not be initialized yet.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3888 >
2023-02-03 22:19:22 +09:00
Sebastian Dröge
8aa376d541
gstreamer: Decide rate-control-mode based on the bitrate/cqp/crf settings
...
And also keep the default encoder settings but simply override them with
our own values that we care about.
This mirrors the encoder configuration behaviour from ffmpeg.
2023-02-03 12:48:56 +02:00
Sebastian Dröge
70c83bc59c
gstreamer: Use GLib types instead of stdint.h types consistently
2023-02-03 12:48:56 +02:00
Sebastian Dröge
dd1db338df
gstreamer: Fix double unref
...
The ownership of the caps is passed to `gst_video_encoder_set_output_state()`.
2023-02-03 12:48:56 +02:00
Sebastian Dröge
df064c6cc2
gstreamer: Configure colorimetry and HDR metadata if present
...
This raises the minimum GStreamer requirement to 1.16 as used by the CI
and optionally makes use of 1.18 features, including HDR.
2023-02-03 12:48:25 +02:00
Sebastian Dröge
aeee6f5b6a
gstreamer: Set correct maximum width/height limits
2023-02-03 12:35:24 +02:00
Sebastian Dröge
65eb56e7ad
gstreamer: Use correct 10-bit format on big endian systems
2023-02-03 12:35:24 +02:00
Sebastian Dröge
90fd191392
gstreamer: Set force_key_frames=true
in CQP/CRF mode
...
Other modes don't support that so keyframes can't be requested at
arbitrary times.
2023-02-03 12:35:24 +02:00
Sebastian Dröge
f24643b48f
gstreamer: Add support for setting arbitrary parameters via parameters-string
property
2023-02-03 12:35:18 +02:00
Sebastian Dröge
d746164ba0
gstreamer: Fix naming of function name that was taken over from the SVT-HEVC encoder
2023-02-03 12:34:38 +02:00
Sebastian Dröge
ddb9a037e1
gstreamer: Don't overwrite application configuration on initialization and initialize with the default configuration
2023-02-03 12:34:38 +02:00
Sebastian Dröge
7b1b33aff2
gstreamer: Clean up property handling
...
Use more correct types, defaults and clean up property names a bit.
This now matches the configuration provided by ffmpeg.
2023-02-03 12:34:38 +02:00
Sebastian Dröge
78ee7e82d9
gstreamer: Mark all internal functions as static
2023-02-03 12:34:38 +02:00
Sebastian Dröge
10769e7fe6
gstreamer: Fix encoder and buffer state life cycle
...
Allocate/deallocate the encoder in `open()`/`close()` and its buffers in
`start()` / `stop()`.
Also fail correctly if configuring the encoder fails.
2023-02-03 12:34:38 +02:00
Sebastian Dröge
24d6027d2e
gstreamer: Remove unused frame_count
and dts_offset
2023-02-03 12:34:38 +02:00
Sebastian Dröge
2d250439f1
gstreamer: Fix debug category description
2023-02-03 12:34:38 +02:00
Adrian Fiergolski
79d2af5626
avtp: rvf: add missing since markers
...
Add missing markers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1335 >
2023-02-02 19:15:46 +01:00
Adrian Fiergolski
9f880b37fc
avtp: rvf: add AVTP RVF de-payload support
...
Add AVTP Raw Video Format de-payload support. The element supports only
GRAY16_LE output format, so:
- active pixels (no vertical blanking),
- progressive mode,
- 8 and 16-bit pixel depth,
- mono pixel format,
- grayscale colorspace.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1335 >
2023-02-02 19:15:42 +01:00
Adrian Fiergolski
d8f449ccda
avtp: cvf: extract AVTP VF depayload base class
...
Extract a part which could be common with the AVTP RVF depayload plugin to a separate class.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1335 >
2023-02-02 19:15:38 +01:00
Adrian Fiergolski
4f2fde0163
avtp: rvf: add AVTP RVF payload support
...
Add AVTP Raw Video Format payload support. The element supports only GRAY16_LE
input format, so:
- active pixels (no vertical blanking),
- progressive mode,
- 8 and 16-bit pixel depth,
- mono pixel format,
- grayscale colorspace.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1335 >
2023-02-02 19:15:33 +01:00
Adrian Fiergolski
8702a1fa67
avtp: cvf: extract AVTP VF payload base class
...
Extract a part which could be common with the AVTP RVF payload plugin to a separate class.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1335 >
2023-02-02 19:15:29 +01:00
Jan Schmidt
edd5911249
gl/cocoa: Return a strong ref to the parent GstGLContext
...
If the GstGLCAOpenGLLayer was initialized via a parent
context, make sure to ref the context before returning it
from getGLContext as all callers will unref it.
Follow up to !3729
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3881 >
2023-02-02 13:53:07 +00:00
Jan Schmidt
138863b327
gsturi: Add API to order query strings
...
Add gst_uri_get_query_string_ordered() and gst_uri_to_string_with_keys() that
allow constructing the URI string with query arguments in a specific order.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3803 >
2023-02-02 11:02:47 +01:00
Piotr Brzeziński
ae200a4d62
vtenc: Disable HW acceleration for interlaced ProRes
...
Due to a bug in the VT API, attempting to encode interlaced content
with ProRes results in an error, halting the pipeline instead of
gracefully falling back to software encoding.
Should be removed in the future if Apple ever fixes this issue.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3222 >
2023-02-02 06:18:02 +00:00